|
@@ -21,6 +21,7 @@ import com.blankj.utilcode.util.LogUtils;
|
|
|
import com.blankj.utilcode.util.ThreadUtils;
|
|
|
import com.kongzue.dialogx.dialogs.InputDialog;
|
|
|
|
|
|
+import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
|
|
@@ -67,7 +68,9 @@ import xn.xxp.widget.NavViewCompat;
|
|
|
import xn.xxp.widget.WaringDialog;
|
|
|
|
|
|
public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> implements HomeFragmentCallback {
|
|
|
- private final int MAX_UI_DEFAULT = 60;
|
|
|
+ private final int MAX_UI_DEFAULT = 60;// 中间UI恢复时间
|
|
|
+ private int defaultCdCount = 0;// 用户操作时间倒计时
|
|
|
+ // private int loadWarnCdCount = 0;// 预案查询倒计时
|
|
|
private DeviceConfigDao deviceConfigDao;
|
|
|
private LabConfigDao labConfigDao;
|
|
|
protected DeviceConfig deviceConfig;
|
|
@@ -77,7 +80,6 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
private HomeActivityHelp help;
|
|
|
private FragmentManager fragmentManager;
|
|
|
private CountDownTimer defaultCd;
|
|
|
- private int defaultCdCount = 0;
|
|
|
protected PeopleFlipperAdapter personFlipperAdapter;
|
|
|
protected PeopleFlipperAdapter experimentAdapter;
|
|
|
protected PeopleFlipperAdapter accessAdapter;
|
|
@@ -93,6 +95,7 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
@Override
|
|
|
protected void initViews(Bundle savedInstanceState) {
|
|
|
super.initViews(savedInstanceState);
|
|
|
+ EventBus.getDefault().register(this);
|
|
|
|
|
|
// 值班人员
|
|
|
personFlipperAdapter = new PeopleFlipperAdapter(1, personList);
|
|
@@ -139,7 +142,7 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
homeBoardAdapter = new HomeBoardAdapter();
|
|
|
binding.bulletinBoardView.setAdapter(homeBoardAdapter);
|
|
|
|
|
|
- // 倒计时业务 恢复中间UI
|
|
|
+ // 倒计时业务
|
|
|
defaultCd = new CountDownTimer(1000, 1000) {
|
|
|
@Override
|
|
|
public void onTick(long millisUntilFinished) {
|
|
@@ -148,13 +151,21 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
|
|
|
@Override
|
|
|
public void onFinish() {
|
|
|
+ // Ui恢复间隔
|
|
|
if (defaultCdCount >= MAX_UI_DEFAULT) {
|
|
|
defaultCdCount = 0;
|
|
|
closePersonPanel();
|
|
|
} else {
|
|
|
- defaultCd.start();
|
|
|
defaultCdCount++;
|
|
|
}
|
|
|
+// // 预案间隔
|
|
|
+// if (loadWarnCdCount >= 10) {
|
|
|
+// loadWarnCdCount = 0;
|
|
|
+// help.queryWarnList();
|
|
|
+// } else {
|
|
|
+// loadWarnCdCount++;
|
|
|
+// }
|
|
|
+ defaultCd.start();
|
|
|
}
|
|
|
};
|
|
|
defaultCd.start();
|
|
@@ -314,6 +325,7 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
protected void onDestroy() {
|
|
|
help.onDestroy();
|
|
|
super.onDestroy();
|
|
|
+ EventBus.getDefault().unregister(this);
|
|
|
MqttManager.Companion.getInstance().release();
|
|
|
if (null != timeTickReceiver) {
|
|
|
unregisterReceiver(timeTickReceiver);
|
|
@@ -344,6 +356,7 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
homeBoardAdapter.updateSensorValue(event.getData());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private WaringDialog waringDialog;
|
|
|
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
@@ -369,7 +382,6 @@ public class HomeActivity extends BaseCountDownActivity<ActivityHomeBinding> imp
|
|
|
waringDialog.dismiss();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
homeBoardAdapter.updateWaringValue(event.getData());
|
|
|
}
|
|
|
}
|