|
@@ -1,5 +1,6 @@
|
|
|
package com.xplora.xponboarding.Activity;
|
|
|
|
|
|
+import android.graphics.Color;
|
|
|
import android.os.Build;
|
|
|
import android.os.Bundle;
|
|
|
import android.util.Log;
|
|
@@ -33,17 +34,20 @@ public class QRActivity extends BaseActivatedActivity {
|
|
|
ImageView qrIv = findViewById(R.id.qr);
|
|
|
Button button = findViewById(R.id.mTestActivited);
|
|
|
|
|
|
- textView.setText(R.string.qrcode_scan);
|
|
|
+ String ticket = DataManager.getTicket();
|
|
|
+ boolean isTicketOK = ticket.length() > 0;
|
|
|
+ String host = "https://sgp.tecanswer.com/w/";
|
|
|
+ String content = host + "?" + "t=" + ticket;
|
|
|
+ int color = isTicketOK ? Color.BLACK : getColor(R.color.xp_red);
|
|
|
+ qrIv.setImageBitmap(QRCodeUtil.createQRCodeBitmapEx(content, 240, 240, color));
|
|
|
|
|
|
- String host = "https://start.myxplora.com/";
|
|
|
- String qr = "qr=" + DataManager.getIMEI();
|
|
|
- String c = "c=sikey";
|
|
|
- String t = "t=" + "X6";
|
|
|
- String bt = "bt=" + DataManager.getBTMac();
|
|
|
- String content = host + "?" + qr + "&" + c + "&" + t + "&" + bt;
|
|
|
- //content = Base64.getEncoder().encodeToString(content.getBytes(StandardCharsets.UTF_8));
|
|
|
- //Log.d(TAG, "initView: qr content:" + content);
|
|
|
- qrIv.setImageBitmap(QRCodeUtil.createQRCodeBitmap(content, 240, 240));
|
|
|
+ //如果 ticket 是空的,二维码标红
|
|
|
+ if (isTicketOK) {
|
|
|
+ textView.setText(R.string.qrcode_scan);
|
|
|
+ } else {
|
|
|
+ textView.setText(R.string.qrcode_error);
|
|
|
+ textView.setTextColor(getColor(R.color.xp_red));
|
|
|
+ }
|
|
|
|
|
|
if (Macros.DEBUG) {
|
|
|
button.setVisibility(View.VISIBLE);
|