Камера не падает, проверка интернет соединения в условиях отсутствия интернета, буквенная клавиатура на вводе суммы
This commit is contained in:
@@ -47,7 +47,6 @@ flutter {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile "com.google.android.gms:play-services-gcm:11.0.1"
|
|
||||||
compile 'com.android.support:appcompat-v7:25.0.0'
|
compile 'com.android.support:appcompat-v7:25.0.0'
|
||||||
compile 'com.squareup.okhttp3:okhttp:3.8.1'
|
compile 'com.squareup.okhttp3:okhttp:3.8.1'
|
||||||
compile 'com.squareup.okio:okio:1.13.0'
|
compile 'com.squareup.okio:okio:1.13.0'
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
-->
|
-->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.CAMERA"/>
|
<uses-permission android:name="android.permission.CAMERA"/>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
||||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||||
@@ -35,9 +36,5 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme"/>
|
android:theme="@style/AppTheme"/>
|
||||||
|
|
||||||
<service
|
|
||||||
android:name="com.dinect.checker.service.RegistrationIntentService"
|
|
||||||
android:exported="false"/>
|
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ import android.content.Intent;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.*;
|
||||||
import android.graphics.BitmapFactory;
|
|
||||||
import android.graphics.ImageFormat;
|
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.content.res.Resources ;
|
import android.content.res.Resources;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
@@ -62,50 +64,60 @@ import android.app.AlertDialog;
|
|||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import com.dinect.checker.activity.Utils;
|
||||||
import com.dinect.checker.R;
|
import com.dinect.checker.R;
|
||||||
|
|
||||||
public class CameraActivity extends AppCompatActivity implements SurfaceHolder.Callback {
|
public class CameraActivity extends AppCompatActivity implements Camera.PreviewCallback {
|
||||||
|
|
||||||
private Camera mCamera;
|
public static final String SCAN_MODES = "SCAN_MODES";
|
||||||
private Handler mAutoFocusHandler = new Handler();
|
public static final String SCAN_RESULT = "SCAN_RESULT";
|
||||||
private ImageScanner mScanner = new ImageScanner();
|
public static final String SCAN_RESULT_TYPE = "SCAN_RESULT_TYPE";
|
||||||
private HashMap<String, Integer> mContours = new HashMap<>();
|
public static final String ERROR_INFO = "ERROR_INFO";
|
||||||
|
|
||||||
private boolean mBarcodeScanned = false;
|
|
||||||
private boolean previewing = true;
|
|
||||||
private Handler autoFocusHandler;
|
|
||||||
private int mOffset;
|
private int mOffset;
|
||||||
private String mToken;
|
private String mToken;
|
||||||
private LogoutDialogFragment mDialog;
|
private LogoutDialogFragment mDialog;
|
||||||
|
private NetworkThread mNetworkThread;
|
||||||
|
|
||||||
|
private CameraPreview mPreview;
|
||||||
|
private Camera mCamera;
|
||||||
|
private ImageScanner mScanner;
|
||||||
|
private Handler mAutoFocusHandler;
|
||||||
|
private boolean mPreviewing = true;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
System.loadLibrary("iconv");
|
System.loadLibrary("iconv");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A safe way to get an instance of the Camera object. */
|
@Override
|
||||||
private static Camera getCameraInstance(){
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Camera c = null;
|
|
||||||
try {
|
|
||||||
c = Camera.open();
|
|
||||||
} catch (Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.a_scanner);
|
|
||||||
|
|
||||||
SurfaceView preview = (SurfaceView) findViewById(R.id.cameraPreview);
|
if(!isCameraAvailable()) {
|
||||||
SurfaceHolder holder = preview.getHolder();
|
// Cancel request if there is no rear-facing camera.
|
||||||
|
cancelRequest();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOffset = (int) (56 * getResources().getDisplayMetrics().density);
|
||||||
|
mToken = getIntent().getStringExtra(MainActivity.PREF_POS_TOKEN);
|
||||||
|
|
||||||
|
// Hide the window title.
|
||||||
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
|
mAutoFocusHandler = new Handler();
|
||||||
|
|
||||||
|
// Create and configure the ImageScanner;
|
||||||
|
setupScanner();
|
||||||
|
|
||||||
|
// Create a RelativeLayout container that will hold a SurfaceView,
|
||||||
|
// and set it as the content of our activity.
|
||||||
|
mPreview = new CameraPreview(this, this, autoFocusCB);
|
||||||
|
// setContentView(mPreview);
|
||||||
|
setContentView(R.layout.a_scanner);
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
mOffset = (int) (56 * getResources().getDisplayMetrics().density);
|
|
||||||
|
|
||||||
autoFocusHandler = new Handler();
|
|
||||||
|
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
|
||||||
@@ -114,108 +126,123 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mToken = getIntent().getStringExtra(MainActivity.PREF_POS_TOKEN);
|
FrameLayout root = (FrameLayout) findViewById(R.id.rootLayout);
|
||||||
|
root.addView(mPreview, 0);
|
||||||
if (mToken == null) {
|
}
|
||||||
Intent intent = new Intent();
|
|
||||||
intent.putExtra("item", "logout");
|
|
||||||
setResult(RESULT_OK, intent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
mCamera = getCameraInstance();
|
public void setupScanner() {
|
||||||
mCamera.setPreviewCallback(previewCallback);
|
mScanner = new ImageScanner();
|
||||||
holder.addCallback(this);
|
mScanner.setConfig(0, Config.X_DENSITY, 3);
|
||||||
|
mScanner.setConfig(0, Config.Y_DENSITY, 3);
|
||||||
|
|
||||||
|
int[] symbols = getIntent().getIntArrayExtra(SCAN_MODES);
|
||||||
|
if (symbols != null) {
|
||||||
|
mScanner.setConfig(Symbol.NONE, Config.ENABLE, 0);
|
||||||
|
for (int symbol : symbols) {
|
||||||
|
mScanner.setConfig(symbol, Config.ENABLE, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mCamera.startPreview();
|
|
||||||
previewing = true;
|
// Open the default i.e. the first rear facing camera.
|
||||||
|
mCamera = Camera.open();
|
||||||
|
if(mCamera == null) {
|
||||||
|
// Cancel request if mCamera is null.
|
||||||
|
cancelRequest();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mPreview.setCamera(mCamera);
|
||||||
|
mPreview.showSurfaceView();
|
||||||
|
|
||||||
|
mPreviewing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
mCamera.stopPreview();
|
|
||||||
previewing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
// Because the Camera object is a shared resource, it's very
|
||||||
public void onDestroy() {
|
// important to release it when the activity is paused.
|
||||||
super.onDestroy();
|
if (mCamera != null) {
|
||||||
if (mCamera != null)
|
mPreview.setCamera(null);
|
||||||
mCamera.release();
|
|
||||||
mCamera = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
|
||||||
try {
|
|
||||||
mCamera.setPreviewDisplay(holder);
|
|
||||||
mCamera.startPreview();
|
|
||||||
previewing = true;
|
|
||||||
try {
|
|
||||||
mCamera.autoFocus(autoFocusCallback);
|
|
||||||
} catch(Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
Log.d("kifio", "surfaceCreated");
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
|
||||||
setCameraDisplayOrientation(0);
|
|
||||||
Log.d("kifio", "surfaceChanged");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
|
||||||
Log.d("kifio", "surfaceDestroyed");
|
|
||||||
mCamera.cancelAutoFocus();
|
mCamera.cancelAutoFocus();
|
||||||
}
|
mCamera.setPreviewCallback(null);
|
||||||
|
mCamera.stopPreview();
|
||||||
|
mCamera.release();
|
||||||
|
|
||||||
void setCameraDisplayOrientation(int cameraId) {
|
// According to Jason Kuang on http://stackoverflow.com/questions/6519120/how-to-recover-camera-preview-from-sleep,
|
||||||
|
// there might be surface recreation problems when the device goes to sleep. So lets just hide it and
|
||||||
|
// recreate on resume
|
||||||
|
mPreview.hideSurfaceView();
|
||||||
|
|
||||||
int rotation = getWindowManager().getDefaultDisplay().getRotation();
|
mPreviewing = false;
|
||||||
int degrees = 0;
|
mCamera = null;
|
||||||
switch (rotation) {
|
|
||||||
case Surface.ROTATION_0:
|
|
||||||
degrees = 0;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_90:
|
|
||||||
degrees = 90;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_180:
|
|
||||||
degrees = 180;
|
|
||||||
break;
|
|
||||||
case Surface.ROTATION_270:
|
|
||||||
degrees = 270;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int result = 0;
|
|
||||||
|
public boolean isCameraAvailable() {
|
||||||
// получаем инфо по камере cameraId
|
PackageManager pm = getPackageManager();
|
||||||
CameraInfo info = new CameraInfo();
|
return pm.hasSystemFeature(PackageManager.FEATURE_CAMERA);
|
||||||
Camera.getCameraInfo(cameraId, info);
|
}
|
||||||
|
|
||||||
// задняя камера
|
public void cancelRequest() {
|
||||||
if (info.facing == CameraInfo.CAMERA_FACING_BACK) {
|
Intent dataIntent = new Intent();
|
||||||
result = ((360 - degrees) + info.orientation);
|
dataIntent.putExtra(ERROR_INFO, "Camera unavailable");
|
||||||
} else
|
setResult(RESULT_CANCELED, dataIntent);
|
||||||
// передняя камера
|
finish();
|
||||||
if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
|
}
|
||||||
result = ((360 - degrees) - info.orientation);
|
|
||||||
result += 360;
|
public void onPreviewFrame(byte[] data, Camera camera) {
|
||||||
|
if (mPreviewing) {
|
||||||
|
Camera.Parameters parameters = camera.getParameters();
|
||||||
|
Camera.Size size = parameters.getPreviewSize();
|
||||||
|
|
||||||
|
Image barcode = new Image(size.width, size.height, "Y800");
|
||||||
|
barcode.setData(data);
|
||||||
|
barcode.setCrop((size.width / 2) - mOffset, 0, (size.width / 2) + mOffset, size.height);
|
||||||
|
|
||||||
|
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 {
|
||||||
|
mPreviewing = true;
|
||||||
|
Toast.makeText(this, "Проверьте интернет соединение", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
result = result % 360;
|
}
|
||||||
mCamera.setDisplayOrientation(result);
|
|
||||||
}
|
private Runnable doAutoFocus = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
if(mCamera != null && mPreviewing) {
|
||||||
|
mCamera.autoFocus(autoFocusCB);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mimic continuous auto-focusing
|
||||||
|
Camera.AutoFocusCallback autoFocusCB = new Camera.AutoFocusCallback() {
|
||||||
|
public void onAutoFocus(boolean success, Camera camera) {
|
||||||
|
mAutoFocusHandler.postDelayed(doAutoFocus, 1000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
@@ -223,11 +250,8 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
|
||||||
if (item.getItemId() == R.id.logout) {
|
if (item.getItemId() == R.id.logout) {
|
||||||
mDialog = new LogoutDialogFragment();
|
mDialog = new LogoutDialogFragment();
|
||||||
mDialog.show(getFragmentManager(), "logout");
|
mDialog.show(getFragmentManager(), "logout");
|
||||||
@@ -248,54 +272,24 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviewCallback previewCallback = new PreviewCallback() {
|
|
||||||
public void onPreviewFrame(byte[] data, Camera camera) {
|
|
||||||
|
|
||||||
Parameters parameters = camera.getParameters();
|
|
||||||
Size size = parameters.getPreviewSize();
|
|
||||||
|
|
||||||
Image barcode = new Image(size.width, size.height, "Y800");
|
|
||||||
barcode.setData(data);
|
|
||||||
|
|
||||||
barcode.setCrop((size.width / 2) - mOffset, 0, (size.width / 2) + mOffset, size.height);
|
|
||||||
|
|
||||||
int result = mScanner.scanImage(barcode);
|
|
||||||
|
|
||||||
if (result != 0) {
|
|
||||||
previewing = false;
|
|
||||||
mCamera.setPreviewCallback(null);
|
|
||||||
mCamera.stopPreview();
|
|
||||||
|
|
||||||
SymbolSet syms = mScanner.getResults();
|
|
||||||
|
|
||||||
for (Symbol sym : syms) {
|
|
||||||
mBarcodeScanned = true;
|
|
||||||
requestUser(sym.getData());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private NetworkThread t;
|
|
||||||
|
|
||||||
private void requestUser(String code) {
|
private void requestUser(String code) {
|
||||||
t = new NetworkThread(this, code, mToken);
|
mNetworkThread = new NetworkThread(this, code, mToken);
|
||||||
t.start();
|
mNetworkThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleResult(Response response, String card) {
|
void handleResult(Response response, String card) {
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
previewing = true;
|
mPreviewing = true;
|
||||||
mCamera.setPreviewCallback(previewCallback);
|
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (response.code() == 200) {
|
Log.d("kifio", "status: " + response.code());
|
||||||
|
int code = response.code();
|
||||||
|
if (code == 200) {
|
||||||
try {
|
try {
|
||||||
String s = response.body().string();
|
String s = response.body().string();
|
||||||
JSONArray users = new JSONArray(s);
|
|
||||||
Log.d("kifio", s);
|
Log.d("kifio", s);
|
||||||
|
JSONArray users = new JSONArray(s);
|
||||||
if (users.length() > 0) {
|
if (users.length() > 0) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.putExtra("user", users.get(0).toString());
|
intent.putExtra("user", users.get(0).toString());
|
||||||
@@ -304,14 +298,17 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(this, "Пользователь с таким id не найден", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Пользователь с таким id не найден", Toast.LENGTH_SHORT).show();
|
||||||
previewing = true;
|
mPreviewing = true;
|
||||||
mCamera.setPreviewCallback(previewCallback);
|
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
}
|
}
|
||||||
} catch (IOException | JSONException e) {
|
} catch (IOException | JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
} else if(code == 204) {
|
||||||
|
mPreviewing = true;
|
||||||
|
Toast.makeText(this, "Пользователь с таким id не найден", Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
mPreviewing = true;
|
||||||
try {
|
try {
|
||||||
Log.d("kifio", response.body().string());
|
Log.d("kifio", response.body().string());
|
||||||
Toast.makeText(this, "Произошла ошибка", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "Произошла ошибка", Toast.LENGTH_SHORT).show();
|
||||||
@@ -320,28 +317,15 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t.close();
|
mNetworkThread.close();
|
||||||
|
mNetworkThread = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Runnable doAutoFocus = new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
if (previewing) {
|
|
||||||
mCamera.autoFocus(autoFocusCallback);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AutoFocusCallback autoFocusCallback = new AutoFocusCallback() {
|
|
||||||
public void onAutoFocus(boolean success, Camera camera) {
|
|
||||||
autoFocusHandler.postDelayed(doAutoFocus, 1000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static class NetworkThread extends Thread {
|
private static class NetworkThread extends Thread {
|
||||||
|
|
||||||
private CameraActivity mActivity;
|
private CameraActivity mActivity;
|
||||||
private String mCode = "";
|
private String mCode = "";
|
||||||
private String mUrl = "https://pos-api-int.dinect.com/20130701/?auto=";
|
private String mUrl = "https://pos-api-int.dinect.com/20130701/users?auto=";
|
||||||
private String mCard = "";
|
private String mCard = "";
|
||||||
private String mToken = "";
|
private String mToken = "";
|
||||||
|
|
||||||
@@ -363,6 +347,9 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
Log.d("kifio", mUrl);
|
||||||
|
Log.d("kifio", mToken);
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.addHeader("DM-Authorization", "dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08")
|
.addHeader("DM-Authorization", "dmapptoken 9fec83cdca38c357e6b65dbb17514cdd36bf2a08")
|
||||||
.addHeader("Authorization", "dmtoken " + mToken)
|
.addHeader("Authorization", "dmtoken " + mToken)
|
||||||
@@ -416,7 +403,6 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
negativeButton.setOnClickListener(new OnClickListener() {
|
negativeButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Log.d("kifio", "Negative click!");
|
|
||||||
((CameraActivity) getActivity()).dismissDialog();
|
((CameraActivity) getActivity()).dismissDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -424,7 +410,6 @@ public class CameraActivity extends AppCompatActivity implements SurfaceHolder.C
|
|||||||
positiveButton.setOnClickListener(new OnClickListener() {
|
positiveButton.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Log.d("kifio", "Positive click!");
|
|
||||||
((CameraActivity) getActivity()).logout();
|
((CameraActivity) getActivity()).logout();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,207 @@
|
|||||||
|
package com.dinect.checker.activity;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.hardware.Camera;
|
||||||
|
import android.hardware.Camera.CameraInfo;
|
||||||
|
import android.hardware.Camera.AutoFocusCallback;
|
||||||
|
import android.hardware.Camera.PreviewCallback;
|
||||||
|
import android.hardware.Camera.Size;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.Surface;
|
||||||
|
import android.view.SurfaceHolder;
|
||||||
|
import android.view.SurfaceView;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
class CameraPreview extends ViewGroup implements SurfaceHolder.Callback {
|
||||||
|
private final String TAG = "CameraPreview";
|
||||||
|
|
||||||
|
SurfaceView mSurfaceView;
|
||||||
|
SurfaceHolder mHolder;
|
||||||
|
Size mPreviewSize;
|
||||||
|
List<Size> mSupportedPreviewSizes;
|
||||||
|
Camera mCamera;
|
||||||
|
PreviewCallback mPreviewCallback;
|
||||||
|
AutoFocusCallback mAutoFocusCallback;
|
||||||
|
|
||||||
|
CameraPreview(Context context, PreviewCallback previewCallback, AutoFocusCallback autoFocusCb) {
|
||||||
|
super(context);
|
||||||
|
|
||||||
|
mPreviewCallback = previewCallback;
|
||||||
|
mAutoFocusCallback = autoFocusCb;
|
||||||
|
mSurfaceView = new SurfaceView(context);
|
||||||
|
addView(mSurfaceView);
|
||||||
|
|
||||||
|
// Install a SurfaceHolder.Callback so we get notified when the
|
||||||
|
// underlying surface is created and destroyed.
|
||||||
|
mHolder = mSurfaceView.getHolder();
|
||||||
|
mHolder.addCallback(this);
|
||||||
|
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCamera(Camera camera) {
|
||||||
|
mCamera = camera;
|
||||||
|
if (mCamera != null) {
|
||||||
|
mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes();
|
||||||
|
requestLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||||
|
// We purposely disregard child measurements because act as a
|
||||||
|
// wrapper to a SurfaceView that centers the camera preview instead
|
||||||
|
// of stretching it.
|
||||||
|
final int width = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
|
||||||
|
final int height = resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
|
||||||
|
setMeasuredDimension(width, height);
|
||||||
|
|
||||||
|
if (mSupportedPreviewSizes != null) {
|
||||||
|
mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
|
if (changed && getChildCount() > 0) {
|
||||||
|
final View child = getChildAt(0);
|
||||||
|
|
||||||
|
final int width = r - l;
|
||||||
|
final int height = b - t;
|
||||||
|
|
||||||
|
int previewWidth = width;
|
||||||
|
int previewHeight = height;
|
||||||
|
if (mPreviewSize != null) {
|
||||||
|
previewWidth = mPreviewSize.width;
|
||||||
|
previewHeight = mPreviewSize.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
child.layout(0, 0,width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hideSurfaceView() {
|
||||||
|
mSurfaceView.setVisibility(View.INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showSurfaceView() {
|
||||||
|
mSurfaceView.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
|
// The Surface has been created, acquire the camera and tell it where
|
||||||
|
// to draw.
|
||||||
|
try {
|
||||||
|
if (mCamera != null) {
|
||||||
|
mCamera.setPreviewDisplay(holder);
|
||||||
|
}
|
||||||
|
} catch (IOException exception) {
|
||||||
|
Log.e(TAG, "IOException caused by setPreviewDisplay()", exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||||
|
// Surface will be destroyed when we return, so stop the preview.
|
||||||
|
if (mCamera != null) {
|
||||||
|
mCamera.cancelAutoFocus();
|
||||||
|
mCamera.stopPreview();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Size getOptimalPreviewSize(List<Size> sizes, int w, int h) {
|
||||||
|
final double ASPECT_TOLERANCE = 0.1;
|
||||||
|
double targetRatio = (double) w / h;
|
||||||
|
if (sizes == null) return null;
|
||||||
|
|
||||||
|
Size optimalSize = null;
|
||||||
|
double minDiff = Double.MAX_VALUE;
|
||||||
|
|
||||||
|
int targetHeight = h;
|
||||||
|
|
||||||
|
// Try to find an size match aspect ratio and size
|
||||||
|
for (Size size : sizes) {
|
||||||
|
double ratio = (double) size.width / size.height;
|
||||||
|
if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue;
|
||||||
|
if (Math.abs(size.height - targetHeight) < minDiff) {
|
||||||
|
optimalSize = size;
|
||||||
|
minDiff = Math.abs(size.height - targetHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cannot find the one match the aspect ratio, ignore the requirement
|
||||||
|
if (optimalSize == null) {
|
||||||
|
minDiff = Double.MAX_VALUE;
|
||||||
|
for (Size size : sizes) {
|
||||||
|
if (Math.abs(size.height - targetHeight) < minDiff) {
|
||||||
|
optimalSize = size;
|
||||||
|
minDiff = Math.abs(size.height - targetHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return optimalSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
|
||||||
|
if (holder.getSurface() == null){
|
||||||
|
// preview surface does not exist
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mCamera != null) {
|
||||||
|
// Now that the size is known, set up the camera parameters and begin
|
||||||
|
// the preview.
|
||||||
|
setCameraDisplayOrientation(0);
|
||||||
|
Camera.Parameters parameters = mCamera.getParameters();
|
||||||
|
parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
|
||||||
|
requestLayout();
|
||||||
|
|
||||||
|
mCamera.setParameters(parameters);
|
||||||
|
mCamera.setPreviewCallback(mPreviewCallback);
|
||||||
|
mCamera.startPreview();
|
||||||
|
mCamera.autoFocus(mAutoFocusCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCameraDisplayOrientation(int cameraId) {
|
||||||
|
|
||||||
|
int rotation = ((Activity) getContext()).getWindowManager().getDefaultDisplay().getRotation();
|
||||||
|
int degrees = 0;
|
||||||
|
switch (rotation) {
|
||||||
|
case Surface.ROTATION_0:
|
||||||
|
degrees = 0;
|
||||||
|
break;
|
||||||
|
case Surface.ROTATION_90:
|
||||||
|
degrees = 90;
|
||||||
|
break;
|
||||||
|
case Surface.ROTATION_180:
|
||||||
|
degrees = 180;
|
||||||
|
break;
|
||||||
|
case Surface.ROTATION_270:
|
||||||
|
degrees = 270;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
// получаем инфо по камере cameraId
|
||||||
|
CameraInfo info = new CameraInfo();
|
||||||
|
Camera.getCameraInfo(cameraId, info);
|
||||||
|
|
||||||
|
// задняя камера
|
||||||
|
if (info.facing == CameraInfo.CAMERA_FACING_BACK) {
|
||||||
|
result = ((360 - degrees) + info.orientation);
|
||||||
|
} else
|
||||||
|
// передняя камера
|
||||||
|
if (info.facing == CameraInfo.CAMERA_FACING_FRONT) {
|
||||||
|
result = ((360 - degrees) - info.orientation);
|
||||||
|
result += 360;
|
||||||
|
}
|
||||||
|
result = result % 360;
|
||||||
|
mCamera.setDisplayOrientation(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
package com.dinect.checker.activity;
|
package com.dinect.checker.activity;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import com.dinect.checker.activity.CameraActivity;
|
import com.dinect.checker.activity.CameraActivity;
|
||||||
import com.dinect.checker.service.RegistrationIntentService;
|
|
||||||
import io.flutter.app.FlutterActivity;
|
import io.flutter.app.FlutterActivity;
|
||||||
import io.flutter.plugins.GeneratedPluginRegistrant;
|
import io.flutter.plugins.GeneratedPluginRegistrant;
|
||||||
import io.flutter.plugin.common.MethodCall;
|
import io.flutter.plugin.common.MethodCall;
|
||||||
import io.flutter.plugin.common.MethodChannel;
|
import io.flutter.plugin.common.MethodChannel;
|
||||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
|
||||||
import io.flutter.plugin.common.MethodChannel.Result;
|
import io.flutter.plugin.common.MethodChannel.Result;
|
||||||
import com.google.android.gms.iid.InstanceID;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.lang.System;
|
import java.lang.System;
|
||||||
@@ -43,15 +41,6 @@ public class MainActivity extends FlutterActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onMethodCall(MethodCall call, Result result) {
|
public void onMethodCall(MethodCall call, Result result) {
|
||||||
switch (call.method) {
|
switch (call.method) {
|
||||||
case "getInstanceID":
|
|
||||||
InstanceID instanceID = InstanceID.getInstance(MainActivity.this);
|
|
||||||
String id = instanceID.getId();
|
|
||||||
if (id != null) {
|
|
||||||
result.success(id);
|
|
||||||
} else {
|
|
||||||
result.error("UNAVAILABLE", "Can't get instanceID.", null);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "saveToken":
|
case "saveToken":
|
||||||
Map tokenArguments = call.arguments();
|
Map tokenArguments = call.arguments();
|
||||||
mPreferences.edit().putString(PREF_POS_TOKEN, (String) tokenArguments.get("token")).apply();
|
mPreferences.edit().putString(PREF_POS_TOKEN, (String) tokenArguments.get("token")).apply();
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.dinect.checker.activity;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
|
||||||
|
public class Utils {
|
||||||
|
|
||||||
|
private Utils() {}
|
||||||
|
|
||||||
|
public static boolean isOnline(Context context) {
|
||||||
|
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
NetworkInfo netInfo = cm.getActiveNetworkInfo();
|
||||||
|
return netInfo != null && netInfo.isConnected();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
package com.dinect.checker.service;
|
|
||||||
|
|
||||||
import android.app.IntentService;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import com.google.android.gms.iid.InstanceID;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class RegistrationIntentService extends IntentService {
|
|
||||||
|
|
||||||
public RegistrationIntentService() {
|
|
||||||
super(RegistrationIntentService.class.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onHandleIntent(@Nullable Intent intent) {
|
|
||||||
InstanceID instanceID = InstanceID.getInstance(this);
|
|
||||||
String token = instanceID.getId();
|
|
||||||
Log.d("kifio", token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,10 +6,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<SurfaceView android:id="@+id/cameraPreview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"/>
|
|
||||||
|
|
||||||
<LinearLayout android:orientation="vertical"
|
<LinearLayout android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ abstract class BaseState<T> extends State<T> {
|
|||||||
String error = null;
|
String error = null;
|
||||||
String textFieldValue = '';
|
String textFieldValue = '';
|
||||||
|
|
||||||
|
TextEditingController controller = new TextEditingController();
|
||||||
|
|
||||||
@override Widget build(BuildContext context) {
|
@override Widget build(BuildContext context) {
|
||||||
return new Scaffold(appBar: getAppBar(context), body: getBody(context));
|
return new Scaffold(appBar: getAppBar(context), body: getBody(context));
|
||||||
}
|
}
|
||||||
|
|||||||
12
lib/faq.dart
12
lib/faq.dart
@@ -79,13 +79,15 @@ class FAQScreenState<T> extends BaseState<FAQScreen> {
|
|||||||
new Entry('ОБЩАЯ ИНФОРМАЦИЯ', commonGuide)
|
new Entry('ОБЩАЯ ИНФОРМАЦИЯ', commonGuide)
|
||||||
];
|
];
|
||||||
|
|
||||||
static const String registrationGuide = '''После запуска приложения вы окажетесь на странице регистрации магазина.
|
static const String registrationGuide = '''
|
||||||
|
mPreviewing = true;После запуска приложения вы окажетесь на странице регистрации магазина.
|
||||||
Введите DIN код магазина (выдается партнером/менеджером International Auto Club, дублируется на почту)
|
Введите DIN код магазина (выдается партнером/менеджером International Auto Club, дублируется на почту)
|
||||||
Нажать кнопку: «Зарегистрировать»
|
Кликнете по кнопке: «Зарегистрировать»
|
||||||
Дождитесь подтверждение активации программы, нажатием кнопки “Обновите статус активации” обновите статус.
|
Дождитесь подтверждение активации программы, кликом по кнопке «Обновите статус активации» обновите статус.
|
||||||
После подтверждения запроса на активацию программы Партнером/менеджером нажмите кнопкиопку “Завершить регистрацию”, приложение готово к использованию.
|
После подтверждения запроса на активацию программы Партнером/менеджером кликнете по кнопке «Завершить регистрацию», приложение готово к использованию.
|
||||||
|
|
||||||
В случае желания изменить номер кассы, необходимо нажать на “значек” верхнем правом углу и вернуться на шаг регистрации.''';
|
При желании изменить номер кассы, необходимо кликнуть на «значок» верхнем правом углу и вернуться на шаг регистрации.
|
||||||
|
''';
|
||||||
|
|
||||||
static const String usageGuide = '''Действие 1:
|
static const String usageGuide = '''Действие 1:
|
||||||
При предъявлении покупателем штрих кода участника системы лояльности, запустите данное приложение.
|
При предъявлении покупателем штрих кода участника системы лояльности, запустите данное приложение.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:core';
|
||||||
|
|
||||||
import 'main.dart';
|
import 'main.dart';
|
||||||
import 'common.dart';
|
import 'common.dart';
|
||||||
@@ -23,9 +24,12 @@ class PurchaseScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||||
|
|
||||||
|
RegExp exp;
|
||||||
|
|
||||||
PurchaseScreenState(String userString, String card) {
|
PurchaseScreenState(String userString, String card) {
|
||||||
this.user = JSON.decode(userString);
|
this.user = JSON.decode(userString);
|
||||||
this.card = card;
|
this.card = card;
|
||||||
|
exp = new RegExp(r'''^(?!0\.00)\d{1,11}(\.\d{0,2})?$''');
|
||||||
getLoyality(user['loyalty_url']);
|
getLoyality(user['loyalty_url']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,30 +69,36 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
|
|
||||||
/// Смена состояния экрана при изменении текста в поле ввода.
|
/// Смена состояния экрана при изменении текста в поле ввода.
|
||||||
@override handleUserInput(String tmpString) {
|
@override handleUserInput(String tmpString) {
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
double.parse(tmpString);
|
|
||||||
tmpString = tmpString.replaceAll('-', '');
|
if (tmpString.length == 0 || exp.hasMatch(tmpString)) {
|
||||||
tmpString = tmpString.replaceAll(',', '');
|
if (tmpString.contains('.')) {
|
||||||
print(tmpString);
|
int dotIndex = tmpString.indexOf('.');
|
||||||
if (tmpString.contains('.')) {
|
integerPart = tmpString.substring(0, dotIndex);
|
||||||
int dotIndex = tmpString.indexOf('.');
|
fractionalPart = tmpString.substring(dotIndex + 1, tmpString.length);
|
||||||
integerPart = tmpString.substring(0, dotIndex);
|
if (fractionalPart.length > 2) {
|
||||||
fractionalPart = tmpString.substring(dotIndex + 1, tmpString.length);
|
fractionalPart = fractionalPart.substring(0, 2);
|
||||||
if (fractionalPart.length > 2) {
|
}
|
||||||
fractionalPart = fractionalPart.substring(0, 2);
|
controller.text = '${integerPart}.${fractionalPart}';
|
||||||
|
} else {
|
||||||
|
integerPart = tmpString;
|
||||||
|
controller.text = tmpString;
|
||||||
}
|
}
|
||||||
controller.text = '${integerPart}.${fractionalPart}';
|
textFieldValue = tmpString;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
integerPart = tmpString;
|
tmpString = tmpString.substring(0, tmpString.length - 1);
|
||||||
controller.text = tmpString;
|
controller.text = tmpString.replaceAll('a', '');
|
||||||
|
textFieldValue = tmpString;
|
||||||
}
|
}
|
||||||
textFieldValue = tmpString;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override getTextWidget() {
|
@override getTextWidget() {
|
||||||
return new TextField(decoration: new InputDecoration.collapsed(hintText: getHint(),
|
return new TextField(keyboardType: TextInputType.text, decoration: new InputDecoration.collapsed(hintText: getHint(),
|
||||||
hintStyle: new TextStyle(color: greyTextColor, fontSize: 16.0)),
|
hintStyle: new TextStyle(color: greyTextColor, fontSize: 16.0)),
|
||||||
|
controller: controller,
|
||||||
onChanged: (text) => handleUserInput(text));
|
onChanged: (text) => handleUserInput(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +146,10 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
|||||||
temporaryFractional = temporaryFractional + '0';
|
temporaryFractional = temporaryFractional + '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (temporaryInteger.length == 0) {
|
||||||
|
temporaryInteger = '0';
|
||||||
|
}
|
||||||
|
|
||||||
return temporaryInteger + '.' + temporaryFractional;
|
return temporaryInteger + '.' + temporaryFractional;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user