Исправления, автоклуб
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.dinect.checker"
|
||||
android:versionCode="1"
|
||||
android:versionName="0.0.5">
|
||||
android:versionName="0.1">
|
||||
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
In most cases you can leave this as-is, but you if you want to provide
|
||||
additional functionality it is fine to subclass or reimplement
|
||||
FlutterApplication and put your custom class here. -->
|
||||
<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"
|
||||
<application android:name="io.flutter.app.FlutterApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher">
|
||||
<activity android:name="com.dinect.checker.MainActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@android:style/Theme.Black.NoTitleBar"
|
||||
@@ -32,7 +32,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name="com.dinect.checker.activity.CameraActivity"
|
||||
<activity android:name="com.dinect.checker.CameraActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme"/>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.dinect.checker.activity;
|
||||
package com.dinect.checker;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
@@ -64,7 +64,7 @@ import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.content.DialogInterface;
|
||||
import android.view.LayoutInflater;
|
||||
import com.dinect.checker.activity.Utils;
|
||||
import com.dinect.checker.Utils;
|
||||
import com.dinect.checker.R;
|
||||
|
||||
public class CameraActivity extends AppCompatActivity implements Camera.PreviewCallback {
|
||||
@@ -209,15 +209,11 @@ public class CameraActivity extends AppCompatActivity implements Camera.PreviewC
|
||||
int result = mScanner.scanImage(barcode);
|
||||
|
||||
if (result != 0) {
|
||||
mCamera.cancelAutoFocus();
|
||||
mCamera.setPreviewCallback(null);
|
||||
mCamera.stopPreview();
|
||||
mPreviewing = false;
|
||||
SymbolSet syms = mScanner.getResults();
|
||||
for (Symbol sym : syms) {
|
||||
String symData = sym.getData();
|
||||
if (!TextUtils.isEmpty(symData) && Utils.isOnline(this)) {
|
||||
mPreviewing = false;
|
||||
requestUser(sym.getData());
|
||||
break;
|
||||
} else {
|
||||
@@ -288,7 +284,6 @@ public class CameraActivity extends AppCompatActivity implements Camera.PreviewC
|
||||
if (code == 200) {
|
||||
try {
|
||||
String s = response.body().string();
|
||||
Log.d("kifio", s);
|
||||
JSONArray users = new JSONArray(s);
|
||||
if (users.length() > 0) {
|
||||
Intent intent = new Intent();
|
||||
@@ -325,7 +320,7 @@ public class CameraActivity extends AppCompatActivity implements Camera.PreviewC
|
||||
|
||||
private CameraActivity mActivity;
|
||||
private String mCode = "";
|
||||
private String mUrl = "https://pos-api-int.dinect.com/20130701/users?auto=";
|
||||
private String mUrl = "http://pos-api-autoclub.dinect.com/20130701/users?auto=";
|
||||
private String mCard = "";
|
||||
private String mToken = "";
|
||||
|
||||
@@ -347,11 +342,8 @@ public class CameraActivity extends AppCompatActivity implements Camera.PreviewC
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Log.d("kifio", mUrl);
|
||||
Log.d("kifio", mToken);
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.addHeader("DM-Authorization", "dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08")
|
||||
.addHeader("DM-Authorization", "dmapptoken bdea0f3ba9034b688019a7cac753d1209e2b227f")
|
||||
.addHeader("Authorization", "dmtoken " + mToken)
|
||||
.url(mUrl)
|
||||
.build();
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.dinect.checker.activity;
|
||||
package com.dinect.checker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.app.Activity;
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.dinect.checker.activity;
|
||||
package com.dinect.checker;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import com.dinect.checker.activity.CameraActivity;
|
||||
import com.dinect.checker.CameraActivity;
|
||||
import io.flutter.app.FlutterActivity;
|
||||
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||
import io.flutter.plugin.common.MethodCall;
|
||||
@@ -32,10 +33,9 @@ public class MainActivity extends FlutterActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
GeneratedPluginRegistrant.registerWith(this);
|
||||
|
||||
final String INSTANCE_ID_CHANNEL = "com.dinect.checker/instance_id";
|
||||
mPreferences = getPreferences(Context.MODE_PRIVATE);
|
||||
|
||||
mChannel = new MethodChannel(getFlutterView(), INSTANCE_ID_CHANNEL);
|
||||
mChannel = new MethodChannel(getFlutterView(), "com.dinect.checker/instance_id");
|
||||
mChannel.setMethodCallHandler(
|
||||
new MethodCallHandler() {
|
||||
@Override
|
||||
@@ -73,19 +73,20 @@ public class MainActivity extends FlutterActivity {
|
||||
mPreferences.edit().putInt(PREF_DOC_ID, docId).apply();
|
||||
result.success(String.valueOf(docId));
|
||||
break;
|
||||
case "isOnline":
|
||||
boolean online = Utils.isOnline(MainActivity.this);
|
||||
if (!online) {
|
||||
Toast.makeText(MainActivity.this, "Проверьте интернет соединение", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
result.success(online);
|
||||
break;
|
||||
case "getPosID":
|
||||
|
||||
String posId = mPreferences.getString(PREF_POS_ID, null);
|
||||
|
||||
if (posId == null) {
|
||||
posId = String.valueOf(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
Log.d("kifio", posId);
|
||||
|
||||
mPreferences.edit().putString(PREF_POS_ID, posId).apply();
|
||||
result.success(posId);
|
||||
|
||||
break;
|
||||
default:
|
||||
result.notImplemented();
|
||||
@@ -119,15 +120,15 @@ public class MainActivity extends FlutterActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleItemClick() {
|
||||
public void handleItemClick() {
|
||||
|
||||
}
|
||||
|
||||
private void getDocID() {
|
||||
public void getDocID() {
|
||||
|
||||
}
|
||||
|
||||
private void removeKeys() {
|
||||
public void removeKeys() {
|
||||
|
||||
}
|
||||
|
||||
@@ -159,4 +160,8 @@ public class MainActivity extends FlutterActivity {
|
||||
|
||||
}
|
||||
|
||||
public void isOnline() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.dinect.checker.activity;
|
||||
package com.dinect.checker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.NetworkInfo;
|
||||
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
Reference in New Issue
Block a user