修复初始化二维码问题
This commit is contained in:
@@ -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_FAILED;
|
||||||
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_LOADING;
|
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_OPEN_DOOR;
|
||||||
|
import static com.ydd.sportfaceid.event.QRCodeEvent.QR_EVENT_ACTION_LINK;
|
||||||
|
|
||||||
public class MainActivity extends SDBaseActivity {
|
public class MainActivity extends SDBaseActivity {
|
||||||
|
|
||||||
@@ -137,6 +138,7 @@ public class MainActivity extends SDBaseActivity {
|
|||||||
break;
|
break;
|
||||||
case QR_EVENT_ACTION_OPEN_DOOR:
|
case QR_EVENT_ACTION_OPEN_DOOR:
|
||||||
case QR_EVENT_ACTION_FAILED:
|
case QR_EVENT_ACTION_FAILED:
|
||||||
|
case QR_EVENT_ACTION_LINK:
|
||||||
qrCodePbCover.setVisibility(View.GONE);
|
qrCodePbCover.setVisibility(View.GONE);
|
||||||
qrCodePbCover.hide();
|
qrCodePbCover.hide();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public class QRCodeEvent {
|
|||||||
public static final int QR_EVENT_ACTION_LOADING = 1;
|
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_OPEN_DOOR = 2;
|
||||||
public static final int QR_EVENT_ACTION_FAILED = 3;
|
public static final int QR_EVENT_ACTION_FAILED = 3;
|
||||||
|
public static final int QR_EVENT_ACTION_LINK = 4;
|
||||||
|
|
||||||
private int action;
|
private int action;
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ public class ClientThread {
|
|||||||
private static ClientThread instance;
|
private static ClientThread instance;
|
||||||
private volatile EventLoopGroup workerGroup;
|
private volatile EventLoopGroup workerGroup;
|
||||||
private volatile Bootstrap bootstrap;
|
private volatile Bootstrap bootstrap;
|
||||||
private volatile boolean closed = false;
|
|
||||||
private String remoteHost;
|
private String remoteHost;
|
||||||
private int remotePort;
|
private int remotePort;
|
||||||
private Activity mContext;
|
private Activity mContext;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.ydd.sportfaceid.netty.message;
|
package com.ydd.sportfaceid.netty.message;
|
||||||
|
|
||||||
public enum MessageType {
|
public enum MessageType {
|
||||||
|
LINK("连接"),
|
||||||
LOAD("加载"),
|
LOAD("加载"),
|
||||||
OPEN_DOOR("开门"),
|
OPEN_DOOR("开门"),
|
||||||
FAILED("开门校验失败");
|
FAILED("开门校验失败");
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ public class MessageService {
|
|||||||
*/
|
*/
|
||||||
public void execute(MessageDTO message) {
|
public void execute(MessageDTO message) {
|
||||||
switch (message.getMessageType()) {
|
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:
|
case LOAD:
|
||||||
// TODO 安卓获取通知加载页面 (进入加载页面,显示欢迎用户的消息)
|
// TODO 安卓获取通知加载页面 (进入加载页面,显示欢迎用户的消息)
|
||||||
Log.d(TAG, "LOADING" + message.getMessage());
|
Log.d(TAG, "LOADING" + message.getMessage());
|
||||||
|
|||||||
@@ -74,7 +74,6 @@ public class SDSettingActivity extends SDBaseActivity {
|
|||||||
String result = null;
|
String result = null;
|
||||||
try {
|
try {
|
||||||
result = response.body().string();
|
result = response.body().string();
|
||||||
System.out.println("result ================" + result);
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
android:id="@+id/qr_code_enter_loading"
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="100dp">
|
android:layout_height="100dp">
|
||||||
@@ -116,15 +117,14 @@
|
|||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/qr_code_iv_enter"
|
android:id="@+id/qr_code_iv_enter"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
tools:src="@color/topInfoRed"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<android.support.v4.widget.ContentLoadingProgressBar
|
<android.support.v4.widget.ContentLoadingProgressBar
|
||||||
android:id="@+id/qr_code_pb_cover"
|
android:id="@+id/qr_code_pb_cover"
|
||||||
tools:visibility="visible"
|
tools:visibility="visible"
|
||||||
android:visibility="gone"
|
style="?android:attr/progressBarStyleLargeInverse"
|
||||||
android:background="#99000000"
|
android:background="@color/black"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user