修复初始化二维码问题

This commit is contained in:
limqhz
2020-08-03 00:03:21 +08:00
parent 5b1393c73d
commit c3b9957fe5
7 changed files with 11 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ import butterknife.OnClick;
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_FAILED;
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_LOADING;
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_OPEN_DOOR;
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_LINK;
public class MainActivity extends SDBaseActivity {
@@ -137,6 +138,7 @@ public class MainActivity extends SDBaseActivity {
break;
case QR_EVENT_ACTION_OPEN_DOOR:
case QR_EVENT_ACTION_FAILED:
case QR_EVENT_ACTION_LINK:
qrCodePbCover.setVisibility(View.GONE);
qrCodePbCover.hide();
break;

View File

@@ -9,6 +9,7 @@ public class QRCodeEvent {
public static final int QR_EVENT_ACTION_LOADING = 1;
public static final int QR_EVENT_ACTION_OPEN_DOOR = 2;
public static final int QR_EVENT_ACTION_FAILED = 3;
public static final int QR_EVENT_ACTION_LINK = 4;
private int action;
private String msg;

View File

@@ -36,7 +36,6 @@ public class ClientThread {
private static ClientThread instance;
private volatile EventLoopGroup workerGroup;
private volatile Bootstrap bootstrap;
private volatile boolean closed = false;
private String remoteHost;
private int remotePort;
private Activity mContext;

View File

@@ -1,6 +1,7 @@
package com.ydd.sportfaceid.netty.message;
public enum MessageType {
LINK("连接"),
LOAD("加载"),
OPEN_DOOR("开门"),
FAILED("开门校验失败");

View File

@@ -60,6 +60,10 @@ public class MessageService {
*/
public void execute(MessageDTO message) {
switch (message.getMessageType()) {
case LINK:
Log.d(TAG, "LINK" + message.getMessage());
EventBus.getDefault().post(new QRCodeEvent(QRCodeEvent.QR_EVENT_ACTION_LINK, message.getMessage()));
break;
case LOAD:
// TODO 安卓获取通知加载页面 (进入加载页面,显示欢迎用户的消息)
Log.d(TAG, "LOADING" + message.getMessage());

View File

@@ -74,7 +74,6 @@ public class SDSettingActivity extends SDBaseActivity {
String result = null;
try {
result = response.body().string();
System.out.println("result ================" + result);
} catch (IOException e) {
e.printStackTrace();
}

View File

@@ -109,6 +109,7 @@
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@+id/qr_code_enter_loading"
android:layout_marginTop="15dp"
android:layout_width="100dp"
android:layout_height="100dp">
@@ -116,15 +117,14 @@
<ImageView
android:id="@+id/qr_code_iv_enter"
android:layout_gravity="center"
tools:src="@color/topInfoRed"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.v4.widget.ContentLoadingProgressBar
android:id="@+id/qr_code_pb_cover"
tools:visibility="visible"
android:visibility="gone"
android:background="#99000000"
style="?android:attr/progressBarStyleLargeInverse"
android:background="@color/black"
android:layout_width="match_parent"
android:layout_height="match_parent"/>