На экране проведения покупки правильно обрабатывается сумма покупки, передается на экран подтверждения

This commit is contained in:
Ivan Murashov
2017-07-24 18:07:30 +03:00
parent 355c05cf06
commit 080c7ec471
9 changed files with 200 additions and 140 deletions

View File

@@ -20,6 +20,7 @@
<application android:name="io.flutter.app.FlutterApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher_app">
<activity android:name="com.dinect.checker.activity.MainActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
@@ -31,6 +32,7 @@
</activity>
<activity android:name="com.dinect.checker.activity.CameraActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme"/>
<service

View File

@@ -66,6 +66,10 @@ public class MainActivity extends FlutterActivity {
Intent cameraIntent = new Intent(MainActivity.this, CameraActivity.class);
startActivityForResult(cameraIntent, START_SCANNER_REQUEST_CODE);
break;
case "removeKeys":
mPreferences.edit().remove(PREF_POS_TOKEN).apply();
mPreferences.edit().remove(PREF_POS_MERCHANT_ID).apply();
break;
default:
result.notImplemented();
break;
@@ -80,11 +84,11 @@ public class MainActivity extends FlutterActivity {
finish();
} else if (requestCode == START_SCANNER_REQUEST_CODE && resultCode == RESULT_OK) {
if (data == null) {
logout();
mChannel.invokeMethod("foo", null);
} else {
String code = data.getExtras().getString("code", null);
if (code == null) {
logout();
mChannel.invokeMethod("foo", null);
} else {
mChannel.invokeMethod("purchase", code);
}
@@ -92,10 +96,8 @@ public class MainActivity extends FlutterActivity {
}
}
private void logout() {
mChannel.invokeMethod("foo", null);
mPreferences.edit().remove(PREF_POS_TOKEN).apply();
mPreferences.edit().remove(PREF_POS_MERCHANT_ID).apply();
private void removeKeys() {
}
public void startScanner() {
@@ -122,4 +124,4 @@ public class MainActivity extends FlutterActivity {
}
}
}