@@ -10,9 +10,9 @@ | |||
{ | |||
"type": "SINGLE", | |||
"filters": [], | |||
"versionCode": 12, | |||
"versionName": "1.3.4", | |||
"outputFile": "jz_app_v1.3.4_release_0625.apk" | |||
"versionCode": 14, | |||
"versionName": "1.3.6", | |||
"outputFile": "jz_app_v1.3.6_release_0704.apk" | |||
} | |||
] | |||
} |
@@ -266,7 +266,7 @@ public class MyRetrofit implements ToastAction { | |||
//加密 | |||
// parameters.setBizContent(SM4Utils.encryptCBC(parameters.getBizContent(), SM4_KEY)); | |||
new MyRetrofit().getRetrofitGZ(code).create(Api.class) | |||
.message3GZ(linkedTreeMap) | |||
.message2GZ(linkedTreeMap) | |||
.enqueue(new ConverterGZ<Result>(context, start, false, loadHint) { | |||
@Override | |||
protected void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { |
@@ -0,0 +1,56 @@ | |||
package com.huntersun.vkyes.etcopencard.project.dialog; | |||
import android.app.Dialog; | |||
import android.content.Context; | |||
import android.graphics.Color; | |||
import android.graphics.drawable.ColorDrawable; | |||
import android.view.Window; | |||
import android.widget.TextView; | |||
import com.huntersun.vkyes.etcopencard.R; | |||
import com.huntersun.vkyes.etcopencard.project.view.CircularProgressView; | |||
public class PercentageProgressDialog extends Dialog { | |||
private TextView tvMessage; | |||
private CircularProgressView progressView; | |||
private String message = "加载中..."; | |||
private int progress = 0; | |||
public PercentageProgressDialog(Context context) { | |||
super(context); | |||
init(); | |||
} | |||
private void init() { | |||
requestWindowFeature(Window.FEATURE_NO_TITLE); | |||
setContentView(R.layout.dialog_progress_percentage); | |||
if (getWindow() != null) { | |||
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); | |||
} | |||
tvMessage = findViewById(R.id.tvMessage); | |||
progressView = findViewById(R.id.progressView); | |||
setCancelable(false); | |||
setCanceledOnTouchOutside(false); | |||
setMessage(message); | |||
setProgress(progress); | |||
} | |||
public void setMessage(String message) { | |||
this.message = message; | |||
if (tvMessage != null) { | |||
tvMessage.setText(message); | |||
} | |||
} | |||
public void setProgress(int progress) { | |||
this.progress = Math.max(0, Math.min(100, progress)); | |||
if (progressView != null) { | |||
progressView.setProgress(this.progress); | |||
} | |||
} | |||
} |
@@ -31,6 +31,7 @@ import com.huntersun.vkyes.etcopencard.project.copapply.OBURequest; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.PercentageProgressDialog; | |||
import com.huntersun.vkyes.etcopencard.project.tool.DateUtils; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.tool.Utils; | |||
@@ -66,6 +67,7 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
private String vehPosImgUrl;//行驶证正面 | |||
private String vehNegImgUrl;//行驶证反面 | |||
private int isXGM;//-1老SDK,其他是新国密 isPlk | |||
private PercentageProgressDialog progressDialog; | |||
//蓝牙链接状态 | |||
private boolean isConnect; | |||
@@ -91,6 +93,12 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
LiveEventBus.get("closeActiveSearchBluetooth", Boolean.class).observe(this, s -> { | |||
finish(); | |||
}); | |||
initProgressDialog(); | |||
} | |||
private void initProgressDialog() { | |||
progressDialog = new PercentageProgressDialog(this); | |||
progressDialog.setMessage("正在激活中..."); | |||
} | |||
@Override | |||
@@ -306,6 +314,8 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
* @return | |||
*/ | |||
public void activationCardAndObuApply(String issueType, String orderId, int isPlk) { | |||
progressDialog.setProgress(10); | |||
progressDialog.show(); | |||
isXGM = isPlk; | |||
HashMap<String, String> parmas = new HashMap<>(); | |||
parmas.put("issueType", issueType); | |||
@@ -314,6 +324,7 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
if (null != bizContent.cmd) { | |||
progressDialog.setProgress((Integer.parseInt(bizContent.stepNo)+1)*10); | |||
if ("CARD".equals(bizContent.cmdType)) { | |||
if (isPlk != -1) { | |||
BluetoothDialog.Builder.transCmd(bizContent.cmd.split(","), "10", new BluetoothDialog.PerformCmdCallBack() { | |||
@@ -340,6 +351,7 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
} | |||
} | |||
} else { | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(ObuActivationBLESearchActivity.this) | |||
.setCancel(null) | |||
.setTitle("提示") | |||
@@ -348,6 +360,16 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
.show(); | |||
} | |||
} | |||
@Override | |||
public void onError(Result resp) { | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(ObuActivationBLESearchActivity.this) | |||
.setCancel(null) | |||
.setTitle("提示") | |||
.setConfirm("确认") | |||
.setMessage(resp.message) | |||
.show(); | |||
} | |||
}); | |||
} | |||
@@ -367,6 +389,7 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
MyRetrofit.newInstanceGZ(ObuActivationBLESearchActivity.this, IFCode.IFCODE_ISSUE_CALLBACK, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
progressDialog.setProgress((Integer.parseInt(bizContent.stepNo)+1)*10); | |||
if ("100".equals(bizContent.stepNo)) { | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
gotoNext(true, "您的ETC已激活"); | |||
@@ -403,6 +426,12 @@ public class ObuActivationBLESearchActivity extends AppActivity { | |||
@Override | |||
public void onError(Result resp) { | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(ObuActivationBLESearchActivity.this) | |||
.setCancel(null) | |||
.setConfirm("确认") | |||
.setMessage(resp.message) | |||
.show(); | |||
} | |||
}); | |||
} |
@@ -5,6 +5,8 @@ import android.app.Activity; | |||
import android.bluetooth.BluetoothAdapter; | |||
import android.content.Intent; | |||
import android.os.Bundle; | |||
import android.os.Handler; | |||
import android.os.Looper; | |||
import android.text.TextUtils; | |||
import android.util.Log; | |||
import android.view.View; | |||
@@ -36,6 +38,7 @@ import com.huntersun.vkyes.etcopencard.project.copapply.OBURequest; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivateRequester; | |||
import com.huntersun.vkyes.etcopencard.project.copapply.ObuActivation; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.ConfirmDialog; | |||
import com.huntersun.vkyes.etcopencard.project.dialog.PercentageProgressDialog; | |||
import com.huntersun.vkyes.etcopencard.project.server.ObserverManager; | |||
import com.huntersun.vkyes.etcopencard.project.tool.DateUtils; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
@@ -104,6 +107,8 @@ public class OrderUtils { | |||
private Button btnPay; | |||
private Button btnSign;//去签约 | |||
private PercentageProgressDialog progressDialog; | |||
//数据 | |||
private ResultBean.BizContent orderData; //订单数据 | |||
@@ -136,9 +141,15 @@ public class OrderUtils { | |||
this.btnSign = btnSign; | |||
// checkUserPosition(); | |||
initBtnClick(); | |||
initProgressDialog(); | |||
setBtnViewVisibleOrHide(); | |||
} | |||
private void initProgressDialog() { | |||
progressDialog = new PercentageProgressDialog(context); | |||
progressDialog.setMessage("正在激活中..."); | |||
} | |||
/** | |||
* 设置按钮的显示和隐藏 | |||
*/ | |||
@@ -955,6 +966,8 @@ public class OrderUtils { | |||
* @return | |||
*/ | |||
public void activationCardAndObuApply(String issueType, String orderId,int isPlk) { | |||
progressDialog.setProgress(10); | |||
progressDialog.show(); | |||
HashMap<String, String> parmas = new HashMap<>(); | |||
parmas.put("issueType", issueType); | |||
parmas.put("orderId", orderId); | |||
@@ -962,6 +975,7 @@ public class OrderUtils { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
if (null != bizContent.cmd) { | |||
progressDialog.setProgress((Integer.parseInt(bizContent.stepNo)+1)*10); | |||
if ("CARD".equals(bizContent.cmdType)) { | |||
if (isPlk!=-1){ | |||
BluetoothDialog.Builder.transCmd(bizContent.cmd.split(","), "10", new BluetoothDialog.PerformCmdCallBack() { | |||
@@ -988,6 +1002,14 @@ public class OrderUtils { | |||
} | |||
} | |||
} else { | |||
// progressDialog.setProgress(progress); | |||
// if (progress < 100) { | |||
// handler.postDelayed(this, 30); | |||
// } else { | |||
// progressDialog.setMessage("激活成功!"); | |||
// handler.postDelayed(() -> progressDialog.dismiss(), 1000); | |||
// } | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(context) | |||
.setCancel(null) | |||
.setTitle("提示") | |||
@@ -996,6 +1018,17 @@ public class OrderUtils { | |||
.show(); | |||
} | |||
} | |||
@Override | |||
public void onError(Result resp) { | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(context) | |||
.setCancel(null) | |||
.setTitle("提示") | |||
.setConfirm("确认") | |||
.setMessage(resp.message) | |||
.show(); | |||
} | |||
}); | |||
} | |||
@@ -1012,11 +1045,13 @@ public class OrderUtils { | |||
params.put("cmd", cmd); | |||
params.put("cmdResult", cmdResult); | |||
params.put("stepNo", stepNo); | |||
MyRetrofit.newInstanceGZ(context, IFCode.IFCODE_ISSUE_CALLBACK, params, new MyRetrofit.ReturnResult() { | |||
MyRetrofit.newInstanceGZ(IFCode.IFCODE_ISSUE_CALLBACK, params, new MyRetrofit.ReturnResult() { | |||
@Override | |||
public void onSuccess(ResultBean resultBean, ResultBean.BizContent bizContent) { | |||
progressDialog.setProgress((Integer.parseInt(bizContent.stepNo)+1)*10); | |||
if ("100".equals(bizContent.stepNo)) { | |||
LiveEventBus.get("homeOneUpdateData").post(""); | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(context) | |||
.setCancel(null) | |||
.setConfirm("确认") | |||
@@ -1055,6 +1090,12 @@ public class OrderUtils { | |||
@Override | |||
public void onError(Result resp) { | |||
progressDialog.dismiss(); | |||
new MessageDialog.Builder(context) | |||
.setCancel(null) | |||
.setConfirm("确认") | |||
.setMessage(resp.message) | |||
.show(); | |||
} | |||
}); | |||
} |
@@ -0,0 +1,89 @@ | |||
package com.huntersun.vkyes.etcopencard.project.view; | |||
import android.content.Context; | |||
import android.graphics.Canvas; | |||
import android.graphics.Color; | |||
import android.graphics.Paint; | |||
import android.graphics.RectF; | |||
import android.util.AttributeSet; | |||
import android.view.View; | |||
public class CircularProgressView extends View { | |||
private Paint backgroundPaint; | |||
private Paint progressPaint; | |||
private Paint textPaint; | |||
private RectF rectF; | |||
private int progress = 0; | |||
private int strokeWidth = 20; | |||
private int backgroundColor = Color.parseColor("#CCCCCC"); | |||
private int progressColor = Color.parseColor("#00B38B"); | |||
public CircularProgressView(Context context) { | |||
super(context); | |||
init(); | |||
} | |||
public CircularProgressView(Context context, AttributeSet attrs) { | |||
super(context, attrs); | |||
init(); | |||
} | |||
private void init() { | |||
backgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |||
backgroundPaint.setStyle(Paint.Style.STROKE); | |||
backgroundPaint.setStrokeWidth(strokeWidth); | |||
backgroundPaint.setColor(backgroundColor); | |||
progressPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |||
progressPaint.setStyle(Paint.Style.STROKE); | |||
progressPaint.setStrokeWidth(strokeWidth); | |||
progressPaint.setColor(progressColor); | |||
progressPaint.setStrokeCap(Paint.Cap.ROUND); | |||
textPaint = new Paint(Paint.ANTI_ALIAS_FLAG); | |||
textPaint.setColor(Color.WHITE); | |||
textPaint.setTextSize(50); | |||
textPaint.setTextAlign(Paint.Align.CENTER); | |||
rectF = new RectF(); | |||
} | |||
@Override | |||
protected void onDraw(Canvas canvas) { | |||
super.onDraw(canvas); | |||
float centerX = getWidth() / 2f; | |||
float centerY = getHeight() / 2f; | |||
float radius = Math.min(centerX, centerY) - strokeWidth / 2f; | |||
rectF.set(centerX - radius, centerY - radius, centerX + radius, centerY + radius); | |||
// 绘制背景圆环 | |||
canvas.drawCircle(centerX, centerY, radius, backgroundPaint); | |||
// 绘制进度圆弧 | |||
float sweepAngle = 360 * progress / 100f; | |||
canvas.drawArc(rectF, -90, sweepAngle, false, progressPaint); | |||
// 绘制进度文字 | |||
String text = progress + "%"; | |||
float textY = centerY - (textPaint.descent() + textPaint.ascent()) / 2; | |||
canvas.drawText(text, centerX, textY, textPaint); | |||
} | |||
public void setProgress(int progress) { | |||
this.progress = progress; | |||
invalidate(); | |||
} | |||
public void setProgressColor(int color) { | |||
progressPaint.setColor(color); | |||
invalidate(); | |||
} | |||
public void setBackgroundColor(int color) { | |||
backgroundPaint.setColor(color); | |||
invalidate(); | |||
} | |||
} |
@@ -7,6 +7,7 @@ import android.app.Activity; | |||
import android.content.Context; | |||
import android.content.Intent; | |||
import android.os.Bundle; | |||
import android.util.Log; | |||
import android.view.KeyEvent; | |||
import android.view.View; | |||
@@ -31,6 +32,7 @@ import com.huntersun.vkyes.etcopencard.project.api.MyRetrofit; | |||
import com.huntersun.vkyes.etcopencard.project.api.Result; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.IFCode; | |||
import com.huntersun.vkyes.etcopencard.project.api.bean.ResultBean; | |||
import com.huntersun.vkyes.etcopencard.project.tool.FileImageTool; | |||
import com.huntersun.vkyes.etcopencard.project.tool.MyShared; | |||
import com.huntersun.vkyes.etcopencard.project.ui.activity.MainActivity; | |||
@@ -138,6 +140,8 @@ public final class LoginActivity extends AppActivity implements KeyboardWatcher. | |||
updateApp(); | |||
} | |||
private void updateApp() { | |||
MyRetrofit.newInstanceGZ(IFCode.IFCODE148, new ResultBean.BizContent<>(), new MyRetrofit.ReturnResult() { | |||
@Override | |||
@@ -472,6 +476,7 @@ public final class LoginActivity extends AppActivity implements KeyboardWatcher. | |||
Map<String, String> params = new HashMap<>(); | |||
params.put("code", code); | |||
params.put("loginSource", Constants.LOGIN_SOURCE); | |||
params.put("userType", "PERSONAL"); | |||
Log.e("registrationId", JPushInterface.getRegistrationID(getApplicationContext())); | |||
params.put("registrationId", JPushInterface.getRegistrationID(getApplicationContext())); | |||
//MyRetrofit.newInstance(IFCode.IFCODE5, params, new MyRetrofit.ReturnResult() { | |||
@@ -526,6 +531,7 @@ public final class LoginActivity extends AppActivity implements KeyboardWatcher. | |||
params.put("mobile", mPhoneView.getText() + ""); | |||
params.put("password", FunHelper.getText(mPasswordView)); | |||
params.put("loginSource", Constants.LOGIN_SOURCE); | |||
params.put("userType", "PERSONAL"); | |||
params.put("appId", "52030131"); //综合业务支撑平台使用 | |||
//MyRetrofit.newInstance(IFCode.IFCODE4, params, new MyRetrofit.ReturnResult() { | |||
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE1004, params, new MyRetrofit.ReturnResult() { | |||
@@ -552,6 +558,7 @@ public final class LoginActivity extends AppActivity implements KeyboardWatcher. | |||
params.put("mobile", FunHelper.getText(mPhoneView)); | |||
params.put("code", FunHelper.getText(mCodeView)); | |||
params.put("appId", "52030131"); | |||
params.put("userType", "PERSONAL"); | |||
params.put("loginSource", Constants.LOGIN_SOURCE); | |||
//MyRetrofit.newInstance(IFCode.IFCODE55, params, new MyRetrofit.ReturnResult() { | |||
MyRetrofit.newInstanceGZ(this, IFCode.IFCODE1005, params, new MyRetrofit.ReturnResult() { |
@@ -0,0 +1,25 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:layout_width="@dimen/dp_120" | |||
android:layout_height="wrap_content" | |||
android:background="@color/transparent" | |||
android:gravity="center" | |||
android:orientation="vertical" | |||
android:padding="@dimen/dp_12"> | |||
<TextView | |||
android:id="@+id/tvMessage" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:gravity="center" | |||
android:text="加载中..." | |||
android:textColor="#FFFFFF" | |||
android:textSize="@dimen/sp_14" | |||
android:textStyle="bold" /> | |||
<com.huntersun.vkyes.etcopencard.project.view.CircularProgressView | |||
android:id="@+id/progressView" | |||
android:layout_width="@dimen/dp_80" | |||
android:layout_height="@dimen/dp_80" | |||
android:layout_marginTop="16dp" /> | |||
</LinearLayout> |