liuzhenxing1118 1 viikko sitten
vanhempi
sitoutus
4d50794c26
1 muutettua tiedostoa jossa 21 lisäystä ja 12 poistoa
  1. 21 12
      app/src/main/java/com/xplora/xponboarding/Activity/QRActivity.java

+ 21 - 12
app/src/main/java/com/xplora/xponboarding/Activity/QRActivity.java

@@ -29,7 +29,8 @@ public class QRActivity extends BaseBroadcastActivity {
     private ImageView mLoadingImage = null;
     private Animation mLoadingAnimation = null;
     private Timer mTimer = null;
-    private int mType = 1; // 0:imei 1:ticket 2:tcl
+
+    private final int mType = 2; // 0:imei 1:ticket 2:tcl
     private String mContent = "";
     private String mContentDisplay = "";
 
@@ -75,21 +76,29 @@ public class QRActivity extends BaseBroadcastActivity {
                     mContentDisplay = host + "?" + "t=" + mContent;
                 }
                 break;
+            default:
+                break;
         }
     }
 
     private void refreshView() {
-        if (mType == 2) {
-            initSikeyBroadcast();
-            actionLoadingAnimation(true);
-            mLoadingLayout.setVisibility(View.VISIBLE);
-        } else {
-            mContentDisplay = getString(R.string.qrcode_error);
-            initData();
-            refreshQrcodeView();
-            if (mContent.length() <= 0) {
-                startTimer();
-            }
+        switch (mType) {
+            case 0:
+            case 1:
+                mContentDisplay = getString(R.string.qrcode_error);
+                initData();
+                refreshQrcodeView();
+                if (mContent.length() <= 0) {
+                    startTimer();
+                }
+                break;
+            case 2:
+                initSikeyBroadcast();
+                actionLoadingAnimation(true);
+                mLoadingLayout.setVisibility(View.VISIBLE);
+                break;
+            default:
+                break;
         }
     }