|
|
@ -49,7 +49,6 @@ import android.widget.RelativeLayout;
|
|
49
|
49
|
import android.widget.TextView;
|
|
50
|
50
|
import android.widget.Toast;
|
|
51
|
51
|
|
|
52
|
|
import com.blankj.utilcode.util.BarUtils;
|
|
53
|
52
|
import com.blankj.utilcode.util.CacheUtils;
|
|
54
|
53
|
import com.blankj.utilcode.util.EmptyUtils;
|
|
55
|
54
|
import com.blankj.utilcode.util.LogUtils;
|
|
|
@ -95,11 +94,12 @@ import pub.devrel.easypermissions.EasyPermissions;
|
|
95
|
94
|
* @author dswitkin@google.com (Daniel Switkin)
|
|
96
|
95
|
* @author Sean Owen
|
|
97
|
96
|
*/
|
|
98
|
|
public final class CaptureActivity extends Activity implements SurfaceHolder.Callback ,EasyPermissions.PermissionCallbacks{
|
|
99
|
|
private TextView tv_light,tv_input;
|
|
|
97
|
public final class CaptureActivity extends Activity implements SurfaceHolder.Callback,
|
|
|
98
|
EasyPermissions.PermissionCallbacks {
|
|
|
99
|
private TextView tv_light, tv_input;
|
|
100
|
100
|
private LoadingDialog loadingDialog;
|
|
101
|
|
private LinearLayout ll_light,ll_input;
|
|
102
|
|
private ImageView iv_light,iv_back,iv_tip;
|
|
|
101
|
private LinearLayout ll_light, ll_input;
|
|
|
102
|
private ImageView iv_light, iv_back, iv_tip;
|
|
103
|
103
|
private AlertDialogTwo alertDialog;
|
|
104
|
104
|
private ArrayList<OperatorPicsBean> operatorPicBeen;
|
|
105
|
105
|
private RelativeLayout rl_costway;
|
|
|
@ -125,7 +125,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
125
|
125
|
private CaptureActivityHandler handler;
|
|
126
|
126
|
private Result savedResultToShow;
|
|
127
|
127
|
private ViewfinderView viewfinderView;
|
|
128
|
|
private TextView statusView,tv_cost_type,tv_yue,tv_recharge;
|
|
|
128
|
private TextView statusView, tv_cost_type, tv_yue, tv_recharge;
|
|
129
|
129
|
private View resultView;
|
|
130
|
130
|
private Result lastResult;
|
|
131
|
131
|
private boolean hasSurface;
|
|
|
@ -144,7 +144,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
144
|
144
|
private Camera camera;
|
|
145
|
145
|
private Camera.Parameters params;
|
|
146
|
146
|
private boolean isOpen = false;
|
|
147
|
|
private String url="",user_id="",user_password="",user_phone="";
|
|
|
147
|
private String url = "", user_id = "", user_password = "", user_phone = "";
|
|
148
|
148
|
private long cha;
|
|
149
|
149
|
private static final String numType = "1";
|
|
150
|
150
|
private static final int checkInterface = 1;
|
|
|
@ -179,7 +179,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
179
|
179
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
|
180
|
180
|
setContentView(R.layout.capture);
|
|
181
|
181
|
activity = this;
|
|
182
|
|
tellList = CacheUtils.getInstance().getString("tellList","");
|
|
|
182
|
tellList = CacheUtils.getInstance().getString("tellList", "");
|
|
183
|
183
|
|
|
184
|
184
|
alertDialog = new AlertDialogTwo(CaptureActivity.this);
|
|
185
|
185
|
|
|
|
@ -204,13 +204,13 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
204
|
204
|
@Override
|
|
205
|
205
|
public void onClick(View v) {
|
|
206
|
206
|
|
|
207
|
|
if (!isOpen){
|
|
|
207
|
if (!isOpen) {
|
|
208
|
208
|
// CameraManager.openLight();
|
|
209
|
209
|
cameraManager.setTorch(true);
|
|
210
|
210
|
iv_light.setImageResource(R.drawable.icon_light_open);
|
|
211
|
211
|
tv_light.setText("关闭手电筒");
|
|
212
|
212
|
isOpen = true;
|
|
213
|
|
}else {
|
|
|
213
|
} else {
|
|
214
|
214
|
// CameraManager.closeLight();
|
|
215
|
215
|
cameraManager.setTorch(false);
|
|
216
|
216
|
iv_light.setImageResource(R.drawable.icon_light_close);
|
|
|
@ -270,15 +270,15 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
270
|
270
|
|
|
271
|
271
|
}
|
|
272
|
272
|
|
|
273
|
|
private void getIntentData(){
|
|
|
273
|
private void getIntentData() {
|
|
274
|
274
|
url = getIntent().getStringExtra("url");
|
|
275
|
275
|
user_id = getIntent().getStringExtra("user_id");
|
|
276
|
276
|
user_password = getIntent().getStringExtra("user_password");
|
|
277
|
277
|
user_phone = getIntent().getStringExtra("user_phone");
|
|
278
|
278
|
LogUtils.e(user_phone);
|
|
279
|
|
Log.e(TAG, "getIntentData: "+url );
|
|
280
|
|
cha = getIntent().getLongExtra("cha",0);
|
|
281
|
|
Log.e(TAG, "getIntentData: "+cha );
|
|
|
279
|
Log.e(TAG, "getIntentData: " + url);
|
|
|
280
|
cha = getIntent().getLongExtra("cha", 0);
|
|
|
281
|
Log.e(TAG, "getIntentData: " + cha);
|
|
282
|
282
|
userChargingCheck();
|
|
283
|
283
|
}
|
|
284
|
284
|
|
|
|
@ -331,12 +331,12 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
331
|
331
|
|
|
332
|
332
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
333
|
333
|
|
|
334
|
|
if (prefs.getBoolean(PreferencesActivity.KEY_DISABLE_AUTO_ORIENTATION, true)) {
|
|
335
|
|
setRequestedOrientation(getCurrentOrientation());
|
|
336
|
|
} else {
|
|
337
|
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); // 旋转
|
|
338
|
|
myOrientationDetector.enable(); //启用监听
|
|
339
|
|
}
|
|
|
334
|
if (prefs.getBoolean(PreferencesActivity.KEY_DISABLE_AUTO_ORIENTATION, true)) {
|
|
|
335
|
setRequestedOrientation(getCurrentOrientation());
|
|
|
336
|
} else {
|
|
|
337
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); // 旋转
|
|
|
338
|
myOrientationDetector.enable(); //启用监听
|
|
|
339
|
}
|
|
340
|
340
|
|
|
341
|
341
|
|
|
342
|
342
|
resetStatusView();
|
|
|
@ -621,7 +621,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
621
|
621
|
public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
|
|
622
|
622
|
|
|
623
|
623
|
inactivityTimer.onActivity();
|
|
624
|
|
Toast.makeText(getApplicationContext(),rawResult.getText(),Toast.LENGTH_SHORT);
|
|
|
624
|
Toast.makeText(getApplicationContext(), rawResult.getText(), Toast.LENGTH_SHORT);
|
|
625
|
625
|
lastResult = rawResult;
|
|
626
|
626
|
loadingDialog.show();
|
|
627
|
627
|
startCharging(rawResult.getText());
|
|
|
@ -950,7 +950,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
950
|
950
|
}
|
|
951
|
951
|
|
|
952
|
952
|
|
|
953
|
|
|
|
954
|
953
|
MyOrientationDetector myOrientationDetector;
|
|
955
|
954
|
|
|
956
|
955
|
@Override
|
|
|
@ -998,7 +997,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
998
|
997
|
} else {
|
|
999
|
998
|
orientation = -1;
|
|
1000
|
999
|
}
|
|
1001
|
|
if ((orientation == 90 && lastOrientation == 270) || (orientation == 270 && lastOrientation == 90)) {
|
|
|
1000
|
if ((orientation == 90 && lastOrientation == 270) || (orientation == 270 && lastOrientation == 90)) {
|
|
1002
|
1001
|
Log.i(TAG, "orientation:" + orientation + "lastOrientation:" + lastOrientation);
|
|
1003
|
1002
|
Intent intent = getIntent();
|
|
1004
|
1003
|
finish();
|
|
|
@ -1021,7 +1020,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1021
|
1020
|
e.printStackTrace();
|
|
1022
|
1021
|
}
|
|
1023
|
1022
|
String url = UrlConstants.HOST_URL + "member/get-score?id=" + user_id +
|
|
1024
|
|
"&phone=" +user_phone + "&password=" + URLEncoder.encode(user_password) + "&token=" + replace;
|
|
|
1023
|
"&phone=" + user_phone + "&password=" + URLEncoder.encode(user_password) + "&token=" + replace;
|
|
1025
|
1024
|
LogUtils.e(url);
|
|
1026
|
1025
|
OkHttpUtils.get().url(url).build().execute(new StringCallback() {
|
|
1027
|
1026
|
@Override
|
|
|
@ -1052,7 +1051,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1052
|
1051
|
|
|
1053
|
1052
|
}
|
|
1054
|
1053
|
});
|
|
1055
|
|
if (!tellList.contains(user_phone)){
|
|
|
1054
|
if (!tellList.contains(user_phone)) {
|
|
1056
|
1055
|
// showNonSecretDialog(money,free_status);
|
|
1057
|
1056
|
}
|
|
1058
|
1057
|
} else {
|
|
|
@ -1070,60 +1069,60 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1070
|
1069
|
});
|
|
1071
|
1070
|
}
|
|
1072
|
1071
|
|
|
1073
|
|
private void showNonSecretDialog(final String money, final String free_status){
|
|
|
1072
|
private void showNonSecretDialog(final String money, final String free_status) {
|
|
1074
|
1073
|
new Handler().postDelayed(new Runnable() {
|
|
1075
|
1074
|
@Override
|
|
1076
|
1075
|
public void run() {
|
|
1077
|
|
if (Float.parseFloat(money) > 3 && free_status.equals("0")) {
|
|
1078
|
|
boolean isDestory = true;
|
|
1079
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
1080
|
|
isDestory = CaptureActivity.this.isDestroyed();
|
|
1081
|
|
}
|
|
1082
|
|
if (!CaptureActivity.this.isFinishing() && isDestory == false) {
|
|
1083
|
|
alertDialog.builder()
|
|
1084
|
|
.setMsg("新增支付宝小额免密支付功能,开通后无需充值,直接充电,快来开通吧")
|
|
1085
|
|
.setPositiveButton("去开通", new View.OnClickListener() {
|
|
1086
|
|
@Override
|
|
1087
|
|
public void onClick(View v) {
|
|
1088
|
|
Intent intent = new Intent();
|
|
1089
|
|
intent.setClassName("com.electric.chargingpile",
|
|
1090
|
|
"com.electric.chargingpile.activity.NonSecretSeettingActivity");
|
|
1091
|
|
Uri uri = Uri.parse("chongdianzhuang://");
|
|
1092
|
|
intent.setData(uri);
|
|
1093
|
|
startActivity(intent);
|
|
1094
|
|
}
|
|
1095
|
|
}).setNegativeButton("忽略", new View.OnClickListener() {
|
|
1096
|
|
@Override
|
|
1097
|
|
public void onClick(View v) {
|
|
|
1076
|
if (Float.parseFloat(money) > 3 && free_status.equals("0")) {
|
|
|
1077
|
boolean isDestory = true;
|
|
|
1078
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
|
1079
|
isDestory = CaptureActivity.this.isDestroyed();
|
|
|
1080
|
}
|
|
|
1081
|
if (!CaptureActivity.this.isFinishing() && isDestory == false) {
|
|
|
1082
|
alertDialog.builder()
|
|
|
1083
|
.setMsg("新增支付宝小额免密支付功能,开通后无需充值,直接充电,快来开通吧")
|
|
|
1084
|
.setPositiveButton("去开通", new View.OnClickListener() {
|
|
|
1085
|
@Override
|
|
|
1086
|
public void onClick(View v) {
|
|
|
1087
|
Intent intent = new Intent();
|
|
|
1088
|
intent.setClassName("com.electric.chargingpile",
|
|
|
1089
|
"com.electric.chargingpile.activity.NonSecretSeettingActivity");
|
|
|
1090
|
Uri uri = Uri.parse("chongdianzhuang://");
|
|
|
1091
|
intent.setData(uri);
|
|
|
1092
|
startActivity(intent);
|
|
|
1093
|
}
|
|
|
1094
|
}).setNegativeButton("忽略", new View.OnClickListener() {
|
|
|
1095
|
@Override
|
|
|
1096
|
public void onClick(View v) {
|
|
1098
|
1097
|
|
|
1099
|
|
}
|
|
1100
|
|
}).show();
|
|
1101
|
|
tellList += user_phone;
|
|
1102
|
|
CacheUtils.getInstance().put("tellList",tellList);
|
|
1103
|
|
}
|
|
|
1098
|
}
|
|
|
1099
|
}).show();
|
|
|
1100
|
tellList += user_phone;
|
|
|
1101
|
CacheUtils.getInstance().put("tellList", tellList);
|
|
1104
|
1102
|
}
|
|
|
1103
|
}
|
|
1105
|
1104
|
}
|
|
1106
|
1105
|
}, 50);
|
|
1107
|
1106
|
}
|
|
1108
|
1107
|
|
|
1109
|
|
private void handlingOperations(String response,int interfaceType){
|
|
1110
|
|
LogUtils.e(interfaceType+"---"+response);
|
|
1111
|
|
String rtnCode = JsonUtils.getKeyResult(response,"rtnCode");
|
|
1112
|
|
String rtnMsg = JsonUtils.getKeyResult(response,"rtnMsg");
|
|
1113
|
|
switch (rtnCode){
|
|
|
1108
|
private void handlingOperations(String response, int interfaceType) {
|
|
|
1109
|
LogUtils.e(interfaceType + "---" + response);
|
|
|
1110
|
String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
|
|
|
1111
|
String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
|
|
|
1112
|
switch (rtnCode) {
|
|
1114
|
1113
|
case "01":
|
|
1115
|
|
if (interfaceType == startInterface){
|
|
1116
|
|
String data = JsonUtils.getKeyResult(response,"data");
|
|
1117
|
|
String orderid = JsonUtils.getKeyResult(data,"orderId");
|
|
|
1114
|
if (interfaceType == startInterface) {
|
|
|
1115
|
String data = JsonUtils.getKeyResult(response, "data");
|
|
|
1116
|
String orderid = JsonUtils.getKeyResult(data, "orderId");
|
|
1118
|
1117
|
Intent intent = new Intent();
|
|
1119
|
1118
|
intent.setClassName("com.electric.chargingpile",
|
|
1120
|
1119
|
"com.electric.chargingpile.activity.TLDLoadingActivity");
|
|
1121
|
|
intent.putExtra(ChargingConstants.ORDERID,orderid);
|
|
|
1120
|
intent.putExtra(ChargingConstants.ORDERID, orderid);
|
|
1122
|
1121
|
startActivity(intent);
|
|
1123
|
1122
|
}
|
|
1124
|
1123
|
break;
|
|
1125
|
1124
|
case "304":
|
|
1126
|
|
if (try304Count > 1){
|
|
|
1125
|
if (try304Count > 1) {
|
|
1127
|
1126
|
break;
|
|
1128
|
1127
|
}
|
|
1129
|
1128
|
try304Count++;
|
|
|
@ -1156,7 +1155,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1156
|
1155
|
}
|
|
1157
|
1156
|
break;
|
|
1158
|
1157
|
case "305":
|
|
1159
|
|
if (try305Count > 1){
|
|
|
1158
|
if (try305Count > 1) {
|
|
1160
|
1159
|
break;
|
|
1161
|
1160
|
}
|
|
1162
|
1161
|
try305Count++;
|
|
|
@ -1178,7 +1177,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1178
|
1177
|
}
|
|
1179
|
1178
|
break;
|
|
1180
|
1179
|
case "309":
|
|
1181
|
|
if (try309Count > 1){
|
|
|
1180
|
if (try309Count > 1) {
|
|
1182
|
1181
|
break;
|
|
1183
|
1182
|
}
|
|
1184
|
1183
|
try309Count++;
|
|
|
@ -1200,17 +1199,17 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1200
|
1199
|
}
|
|
1201
|
1200
|
break;
|
|
1202
|
1201
|
case "306":
|
|
1203
|
|
if (try306Count > 1){
|
|
|
1202
|
if (try306Count > 1) {
|
|
1204
|
1203
|
break;
|
|
1205
|
1204
|
}
|
|
1206
|
1205
|
try306Count++;
|
|
1207
|
1206
|
//跳转到充电详情界面
|
|
1208
|
|
String data306 = JsonUtils.getKeyResult(response,"data");
|
|
1209
|
|
String orderid = JsonUtils.getKeyResult(data306,"orderId");
|
|
|
1207
|
String data306 = JsonUtils.getKeyResult(response, "data");
|
|
|
1208
|
String orderid = JsonUtils.getKeyResult(data306, "orderId");
|
|
1210
|
1209
|
Intent intent306 = new Intent();
|
|
1211
|
1210
|
intent306.setClassName("com.electric.chargingpile",
|
|
1212
|
1211
|
"com.electric.chargingpile.activity.ChargingStatusActivity");
|
|
1213
|
|
intent306.putExtra(ChargingConstants.ORDERID,orderid);
|
|
|
1212
|
intent306.putExtra(ChargingConstants.ORDERID, orderid);
|
|
1214
|
1213
|
startActivity(intent306);
|
|
1215
|
1214
|
finish();
|
|
1216
|
1215
|
break;
|
|
|
@ -1230,7 +1229,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1230
|
1229
|
}
|
|
1231
|
1230
|
break;
|
|
1232
|
1231
|
case "311":
|
|
1233
|
|
if (try311Count > 1){
|
|
|
1232
|
if (try311Count > 1) {
|
|
1234
|
1233
|
break;
|
|
1235
|
1234
|
}
|
|
1236
|
1235
|
try311Count++;
|
|
|
@ -1253,29 +1252,29 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1253
|
1252
|
break;
|
|
1254
|
1253
|
case "1800":
|
|
1255
|
1254
|
//运营商为彭辉时的操作
|
|
1256
|
|
String data1800 = JsonUtils.getKeyResult(response,"data");
|
|
1257
|
|
String pileId = JsonUtils.getKeyResult(data1800,"pileId");
|
|
|
1255
|
String data1800 = JsonUtils.getKeyResult(response, "data");
|
|
|
1256
|
String pileId = JsonUtils.getKeyResult(data1800, "pileId");
|
|
1258
|
1257
|
Intent intent1800 = new Intent();
|
|
1259
|
1258
|
intent1800.setClassName("com.electric.chargingpile",
|
|
1260
|
1259
|
"com.electric.chargingpile.activity.SelectPileActivity");
|
|
1261
|
|
intent1800.putExtra(ChargingConstants.ORDERID,pileId);
|
|
|
1260
|
intent1800.putExtra(ChargingConstants.ORDERID, pileId);
|
|
1262
|
1261
|
startActivity(intent1800);
|
|
1263
|
1262
|
break;
|
|
1264
|
1263
|
default:
|
|
1265
|
1264
|
new Handler().postDelayed(new Runnable() {
|
|
1266
|
|
public void run() {
|
|
1267
|
|
restartPreviewAfterDelay(0L);
|
|
1268
|
|
}
|
|
1269
|
|
}, 1500);
|
|
1270
|
|
ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
|
|
|
1265
|
public void run() {
|
|
|
1266
|
restartPreviewAfterDelay(0L);
|
|
|
1267
|
}
|
|
|
1268
|
}, 1500);
|
|
|
1269
|
ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
|
|
1271
|
1270
|
break;
|
|
1272
|
1271
|
}
|
|
1273
|
1272
|
}
|
|
1274
|
1273
|
|
|
1275
|
|
private void userChargingCheck(){
|
|
|
1274
|
private void userChargingCheck() {
|
|
1276
|
1275
|
OkHttpUtils.get().url(UrlConstants.USER_CHARGING_CHECK_URL)
|
|
1277
|
|
.addParams(ChargingConstants.USERID,user_id)
|
|
1278
|
|
.addParams(ChargingConstants.PWD,user_password)
|
|
|
1276
|
.addParams(ChargingConstants.USERID, user_id)
|
|
|
1277
|
.addParams(ChargingConstants.PWD, user_password)
|
|
1279
|
1278
|
.build().execute(new StringCallback() {
|
|
1280
|
1279
|
@Override
|
|
1281
|
1280
|
public void onError(Call call, Exception e) {
|
|
|
@ -1286,22 +1285,22 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1286
|
1285
|
public void onResponse(String response) {
|
|
1287
|
1286
|
LogUtils.e(response);
|
|
1288
|
1287
|
if (EmptyUtils.isNotEmpty(response)) {
|
|
1289
|
|
handlingOperations(response,checkInterface);
|
|
|
1288
|
handlingOperations(response, checkInterface);
|
|
1290
|
1289
|
}
|
|
1291
|
1290
|
}
|
|
1292
|
1291
|
});
|
|
1293
|
1292
|
}
|
|
1294
|
1293
|
|
|
1295
|
|
private void startCharging(String result){
|
|
|
1294
|
private void startCharging(String result) {
|
|
1296
|
1295
|
OkHttpUtils.get().url(UrlConstants.START_CHARGING_URL)
|
|
1297
|
|
.addParams(ChargingConstants.FLAG,numType)
|
|
1298
|
|
.addParams(ChargingConstants.URL,URLEncoder.encode(result))
|
|
1299
|
|
.addParams(ChargingConstants.USERID,user_id)
|
|
1300
|
|
.addParams(ChargingConstants.PWD,user_password)
|
|
|
1296
|
.addParams(ChargingConstants.FLAG, numType)
|
|
|
1297
|
.addParams(ChargingConstants.URL, URLEncoder.encode(result))
|
|
|
1298
|
.addParams(ChargingConstants.USERID, user_id)
|
|
|
1299
|
.addParams(ChargingConstants.PWD, user_password)
|
|
1301
|
1300
|
.build().connTimeOut(30000).readTimeOut(30000).execute(new StringCallback() {
|
|
1302
|
1301
|
@Override
|
|
1303
|
1302
|
public void onError(Call call, Exception e) {
|
|
1304
|
|
ToastUtil.showToast(getApplicationContext(),"网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
|
|
|
1303
|
ToastUtil.showToast(getApplicationContext(), "网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
|
|
1305
|
1304
|
}
|
|
1306
|
1305
|
|
|
1307
|
1306
|
@Override
|
|
|
@ -1317,9 +1316,9 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1317
|
1316
|
});
|
|
1318
|
1317
|
}
|
|
1319
|
1318
|
|
|
1320
|
|
private void dismissDialog(){
|
|
|
1319
|
private void dismissDialog() {
|
|
1321
|
1320
|
if (activity != null && !activity.isFinishing()) {
|
|
1322
|
|
if (loadingDialog.isShowing()){
|
|
|
1321
|
if (loadingDialog.isShowing()) {
|
|
1323
|
1322
|
loadingDialog.dismiss();
|
|
1324
|
1323
|
}
|
|
1325
|
1324
|
|
|
|
@ -1353,8 +1352,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1353
|
1352
|
return EasyPermissions.hasPermissions(this, Manifest.permission.CALL_PHONE);
|
|
1354
|
1353
|
}
|
|
1355
|
1354
|
|
|
1356
|
|
private void getOperatorList(){
|
|
1357
|
|
String url = UrlConstants.HOST_URL+"suppiler/operator-list";
|
|
|
1355
|
private void getOperatorList() {
|
|
|
1356
|
String url = UrlConstants.HOST_URL + "suppiler/operator-list";
|
|
1358
|
1357
|
OkHttpUtils.get().url(url).build().execute(new StringCallback() {
|
|
1359
|
1358
|
@Override
|
|
1360
|
1359
|
public void onError(Call call, Exception e) {
|
|
|
@ -1364,8 +1363,9 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1364
|
1363
|
@Override
|
|
1365
|
1364
|
public void onResponse(String response) {
|
|
1366
|
1365
|
LogUtils.e(response);
|
|
1367
|
|
Gson g = new Gson();
|
|
1368
|
|
operatorPicBeen = g.fromJson(response,new TypeToken<ArrayList<OperatorPicsBean>>(){}.getType());
|
|
|
1366
|
Gson g = new Gson();
|
|
|
1367
|
operatorPicBeen = g.fromJson(response, new TypeToken<ArrayList<OperatorPicsBean>>() {
|
|
|
1368
|
}.getType());
|
|
1369
|
1369
|
}
|
|
1370
|
1370
|
});
|
|
1371
|
1371
|
}
|
|
|
@ -1456,6 +1456,4 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|
1456
|
1456
|
// }
|
|
1457
|
1457
|
|
|
1458
|
1458
|
|
|
1459
|
|
|
|
1460
|
|
|
|
1461
|
1459
|
}
|