|
@@ -6,7 +6,6 @@ import android.content.IntentFilter;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.graphics.Color;
|
|
|
import android.graphics.drawable.GradientDrawable;
|
|
|
-import android.hardware.usb.UsbManager;
|
|
|
import android.os.AsyncTask;
|
|
|
import android.os.Bundle;
|
|
|
import android.os.CountDownTimer;
|
|
@@ -19,12 +18,11 @@ import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.EditText;
|
|
|
|
|
|
-import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
-import androidx.recyclerview.widget.RecyclerView;
|
|
|
import androidx.viewbinding.ViewBinding;
|
|
|
|
|
|
import com.blankj.utilcode.util.ActivityUtils;
|
|
|
import com.blankj.utilcode.util.AppUtils;
|
|
|
+import com.blankj.utilcode.util.ClickUtils;
|
|
|
import com.blankj.utilcode.util.LogUtils;
|
|
|
import com.blankj.utilcode.util.SPUtils;
|
|
|
import com.bumptech.glide.Glide;
|
|
@@ -36,12 +34,10 @@ import com.lztek.toolkit.Lztek;
|
|
|
import com.rc.core.ui.activity.BaseActivity;
|
|
|
import com.rc.httpcore.HttpClient;
|
|
|
import com.rc.httpcore.HttpConfig;
|
|
|
+import com.rc.httpcore.bean.RuleBean;
|
|
|
import com.rc.httpcore.client.ApiRepository;
|
|
|
import com.rc.httpcore.client.HttpTool;
|
|
|
-import com.rc.httpcore.exception.NetException;
|
|
|
|
|
|
-import java.net.ConnectException;
|
|
|
-import java.net.SocketTimeoutException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -50,13 +46,11 @@ import java.util.Map;
|
|
|
import io.reactivex.rxjava3.functions.Consumer;
|
|
|
import kotlin.Unit;
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
-import retrofit2.HttpException;
|
|
|
import xn.hxp.R;
|
|
|
import xn.hxp.app.ChemicalApp;
|
|
|
import xn.hxp.databinding.ActivityMainBinding;
|
|
|
import xn.hxp.receiver.TimeTickReceiver;
|
|
|
-import xn.hxp.receiver.UsbReceiver;
|
|
|
-import xn.hxp.ui.adapter.CabinetAdapter;
|
|
|
+import xn.hxp.ui.adapter.CabinetBannerAdapter;
|
|
|
import xn.hxp.ui.discard.LedgerActivity;
|
|
|
import xn.hxp.ui.discard.WasteChemicalsActivity;
|
|
|
import xn.hxp.ui.inquiry.InquiryActivity;
|
|
@@ -80,12 +74,10 @@ import xn.hxp.weidith.PlanDialog;
|
|
|
|
|
|
public class MainActivity extends BaseActivity {
|
|
|
|
|
|
+ private List<RuleBean> ruleBeanList = new ArrayList<>();
|
|
|
+
|
|
|
private ActivityMainBinding viewBinding;
|
|
|
private TimeUpdater timeUpdater;
|
|
|
- private CabinetAdapter mAdapter;
|
|
|
- private int currentPosition = 0;
|
|
|
- private RecyclerView recyclerView;
|
|
|
- private UsbReceiver mUsbReceiver;
|
|
|
private Lztek mLztek;
|
|
|
private String mDeviceNum;
|
|
|
private List<String> faceList;
|
|
@@ -93,10 +85,6 @@ public class MainActivity extends BaseActivity {
|
|
|
private int mCounter = 0;
|
|
|
private int MAX_TIME = 60;
|
|
|
private static final int WHAT_COUNT_DOWN = 1;
|
|
|
- private LinearLayoutManager layoutManager;
|
|
|
- private Handler handlerBanner;
|
|
|
- private Runnable updateRunnable;
|
|
|
- private boolean isUpdating = false;
|
|
|
private TimeTickReceiver timeTickReceiver = new TimeTickReceiver();
|
|
|
private PlanDialog planDialog;
|
|
|
private CountDownTimer heartbeatCdTimer;
|
|
@@ -125,10 +113,6 @@ public class MainActivity extends BaseActivity {
|
|
|
viewBinding.inc.imgE.setBackgroundResource(R.mipmap.icon_login_img);
|
|
|
}
|
|
|
|
|
|
- if (mAdapter.getData() != null && mAdapter.getData().size() > 1) {
|
|
|
- startUpdating();
|
|
|
- }
|
|
|
-
|
|
|
timeUpdater.startUpdating();
|
|
|
getCabinetIn();
|
|
|
basicConf();
|
|
@@ -140,7 +124,7 @@ public class MainActivity extends BaseActivity {
|
|
|
registerReceiver(timeTickReceiver, new IntentFilter(Intent.ACTION_TIME_TICK));
|
|
|
|
|
|
viewBinding.versionName.setText("版本号:" + AppUtils.getAppVersionName());
|
|
|
-
|
|
|
+ viewBinding.cabinetVP.registerLifecycleObserver(getLifecycle()).setAdapter(new CabinetBannerAdapter()).create(ruleBeanList);
|
|
|
viewBinding.test.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
@@ -226,7 +210,6 @@ public class MainActivity extends BaseActivity {
|
|
|
protected void onPause() {
|
|
|
LogUtils.i("============onPause");
|
|
|
try {
|
|
|
- stopUpdating();
|
|
|
timeUpdater.stopUpdating();
|
|
|
LogUtils.i("========UI在刷新停止");
|
|
|
mCountDownHandler.removeMessages(WHAT_COUNT_DOWN);
|
|
@@ -243,31 +226,23 @@ public class MainActivity extends BaseActivity {
|
|
|
|
|
|
private void getCabinetIn() {
|
|
|
showLoading("查询中...");
|
|
|
- ApiRepository.INSTANCE.getCabinetBySubId(ChemicalApp.subjectId)
|
|
|
+ addDisposable(ApiRepository.INSTANCE.getCabinetBySubId(ChemicalApp.subjectId)
|
|
|
.subscribe(data -> {
|
|
|
dismissLoading();
|
|
|
- mAdapter.setNewInstance(new ArrayList<>(data));
|
|
|
- if (mAdapter.getData() != null && mAdapter.getData().size() > 1) {
|
|
|
- handlerBanner = new Handler(Looper.getMainLooper());
|
|
|
- updateRunnable = new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- int currentPosition = layoutManager.findFirstVisibleItemPosition();
|
|
|
- if (currentPosition != RecyclerView.NO_POSITION) {
|
|
|
- int nextPosition = (currentPosition + 1) % mAdapter.getItemCount();
|
|
|
- recyclerView.smoothScrollToPosition(nextPosition);
|
|
|
- }
|
|
|
- if (isUpdating) {
|
|
|
- handlerBanner.postDelayed(this, 5000);
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- startUpdating();
|
|
|
+ ruleBeanList.clear();
|
|
|
+ ruleBeanList.addAll(data);
|
|
|
+ if (ruleBeanList.size() > 1) {
|
|
|
+ viewBinding.last.setVisibility(View.VISIBLE);
|
|
|
+ viewBinding.next.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ viewBinding.last.setVisibility(View.GONE);
|
|
|
+ viewBinding.next.setVisibility(View.GONE);
|
|
|
}
|
|
|
+ viewBinding.cabinetVP.refreshData(ruleBeanList);
|
|
|
}, throwable -> {
|
|
|
dismissLoading();
|
|
|
throwable.printStackTrace();
|
|
|
- });
|
|
|
+ }));
|
|
|
}
|
|
|
|
|
|
private void getUserIds() {
|
|
@@ -283,96 +258,18 @@ public class MainActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void initAdapter() {
|
|
|
- recyclerView = viewBinding.relView;
|
|
|
- layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
|
|
|
- recyclerView.setLayoutManager(layoutManager);
|
|
|
- recyclerView.setAdapter(mAdapter);
|
|
|
- recyclerView.setOnTouchListener((v, event) -> true);
|
|
|
-
|
|
|
- mAdapter.setOnItemChildClickListener((adapter, view, position) -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("logIn", 1);
|
|
|
- if (view.getId() == R.id.lingOne) {
|
|
|
- map.put("cabinetId", mAdapter.getData().get(position).getCabinetId());
|
|
|
- map.put("doorId", mAdapter.getData().get(position).getCabinetDoorVoList().get(0).getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
- } else if (view.getId() == R.id.lintTwo) {
|
|
|
- map.put("cabinetId", mAdapter.getData().get(position).getCabinetDoorVoList().get(1).getCabinetId());
|
|
|
- map.put("doorId", mAdapter.getData().get(position).getCabinetDoorVoList().get(1).getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
- } else if (view.getId() == R.id.lintThree) {
|
|
|
- map.put("cabinetId", mAdapter.getData().get(position).getCabinetDoorVoList().get(2).getCabinetId());
|
|
|
- map.put("doorId", mAdapter.getData().get(position).getCabinetDoorVoList().get(2).getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
- } else if (view.getId() == R.id.lintFour) {
|
|
|
- map.put("cabinetId", mAdapter.getData().get(position).getCabinetDoorVoList().get(3).getCabinetId());
|
|
|
- map.put("doorId", mAdapter.getData().get(position).getCabinetDoorVoList().get(3).getDoorUniqueId());
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
- } else if (view.getId() == R.id.imgViews) {
|
|
|
- map.put("cabinetId", "a");
|
|
|
- map.put("doorId", "a");
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
- }
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- private void startUpdating() {
|
|
|
- if (!isUpdating) {
|
|
|
- isUpdating = true;
|
|
|
- handlerBanner.post(updateRunnable);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void stopUpdating() {
|
|
|
- if (isUpdating) {
|
|
|
- isUpdating = false;
|
|
|
- handlerBanner.removeCallbacks(updateRunnable);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private void handleScanEvent(String cont) {
|
|
|
- // Implementation remains similar to Kotlin version
|
|
|
- }
|
|
|
-
|
|
|
- private void registerUsbBroadcast() {
|
|
|
- if (mUsbReceiver == null) {
|
|
|
- IntentFilter filter = new IntentFilter();
|
|
|
- filter.addAction(UsbReceiver.ACTION_USB_PERMISSION);
|
|
|
- filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED);
|
|
|
- filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED);
|
|
|
- filter.addAction(UsbReceiver.ACTION_USB_STATE);
|
|
|
- mUsbReceiver = new UsbReceiver();
|
|
|
- registerReceiver(mUsbReceiver, filter);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
protected void onDestroy() {
|
|
|
super.onDestroy();
|
|
|
unregisterReceiver(timeTickReceiver);
|
|
|
try {
|
|
|
timeUpdater.stopUpdating();
|
|
|
- stopUpdating();
|
|
|
mCountDownHandler.removeMessages(WHAT_COUNT_DOWN);
|
|
|
mCountDownHandler.removeCallbacksAndMessages(null);
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void subAddData() {
|
|
|
- mLztek = Lztek.create(this);
|
|
|
- String toUpperCase = mLztek.getEthMac().toUpperCase();
|
|
|
- mDeviceNum = toUpperCase.replace(":", "");
|
|
|
- ApiRepository.INSTANCE.monitor(mDeviceNum)
|
|
|
- .subscribe(data -> {
|
|
|
- }, this::showNetError);
|
|
|
- }
|
|
|
-
|
|
|
private void basicConf() {
|
|
|
ApiRepository.INSTANCE.basicConfig(ChemicalApp.subjectId)
|
|
|
.subscribe(data -> {
|
|
@@ -469,24 +366,6 @@ public class MainActivity extends BaseActivity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void throwableView(Throwable throwable) {
|
|
|
- String message = null;
|
|
|
- if (throwable instanceof NetException) {
|
|
|
- message = throwable.getMessage() != null ? throwable.getMessage() :
|
|
|
- "接口请求失败(" + ((NetException) throwable).getCode() + ")";
|
|
|
- } else if (throwable instanceof SocketTimeoutException) {
|
|
|
- message = "请求超时,请稍后重试";
|
|
|
- } else if (throwable instanceof ConnectException) {
|
|
|
- message = "无法连接服务器,请检查网络";
|
|
|
- } else if (throwable instanceof HttpException) {
|
|
|
- message = "服务器繁忙,请稍后重试";
|
|
|
- }
|
|
|
-
|
|
|
- if (message != null) {
|
|
|
- customDialogView(2, message);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private final Handler mCountDownHandler = new Handler(Looper.getMainLooper()) {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
@@ -540,130 +419,151 @@ public class MainActivity extends BaseActivity {
|
|
|
});
|
|
|
timeUpdater.startUpdating();
|
|
|
|
|
|
- mAdapter = new CabinetAdapter();
|
|
|
- initAdapter();
|
|
|
+ viewBinding.last.setOnClickListener(v -> viewBinding.cabinetVP.previousPage());
|
|
|
+ viewBinding.next.setOnClickListener(v -> viewBinding.cabinetVP.nextPage());
|
|
|
|
|
|
- viewBinding.imgLeft.setOnClickListener(v -> {
|
|
|
- if (currentPosition > 0) {
|
|
|
- currentPosition--;
|
|
|
- recyclerView.smoothScrollToPosition(currentPosition);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- viewBinding.imgRight.setOnClickListener(v -> {
|
|
|
- if (currentPosition < mAdapter.getItemCount() - 1) {
|
|
|
- currentPosition++;
|
|
|
- recyclerView.smoothScrollToPosition(currentPosition);
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
RelativeLayoutDebouncer.Companion.setDebouncedOnClickListener(viewBinding.inc.userLogin, 1000L, v -> {
|
|
|
basicConfLog();
|
|
|
});
|
|
|
|
|
|
// 存储
|
|
|
- viewBinding.addChemicals.setOnClickListener(v -> {
|
|
|
- //新增
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- if (ChemicalApp.administrators || ChemicalApp.responsibles) {
|
|
|
- planDialog = new PlanDialog(MainActivity.this, new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- UiManager.INSTANCE.switcher(MainActivity.this, AlreadyActivity.class);
|
|
|
- planDialog.dismiss();
|
|
|
- }
|
|
|
- }, new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- UiManager.INSTANCE.switcher(MainActivity.this, PlanAddActivity.class);
|
|
|
- planDialog.dismiss();
|
|
|
- }
|
|
|
- });
|
|
|
- planDialog.show();
|
|
|
+ viewBinding.addChemicals.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ //新增
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ if (ChemicalApp.administrators || ChemicalApp.responsibles) {
|
|
|
+ planDialog = new PlanDialog(MainActivity.this, new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, AlreadyActivity.class);
|
|
|
+ planDialog.dismiss();
|
|
|
+ }
|
|
|
+ }, new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, PlanAddActivity.class);
|
|
|
+ planDialog.dismiss();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ planDialog.show();
|
|
|
+ } else {
|
|
|
+ customDialogView(2, "当前人员无权限");
|
|
|
+ }
|
|
|
} else {
|
|
|
- customDialogView(2, "当前人员无权限");
|
|
|
+ basicConfLog();
|
|
|
}
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.reDis.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, WasteChemicalsActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.reDis.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, WasteChemicalsActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.reInq.setOnClickListener(v -> {
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("logIn", ChemicalApp.userData != null ? 1 : 0);
|
|
|
- map.put("cabinetId", "a");
|
|
|
- map.put("doorId", "a");
|
|
|
- UiManager.INSTANCE.switcher(this, map, InquiryActivity.class);
|
|
|
+ viewBinding.reInq.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("logIn", ChemicalApp.userData != null ? 1 : 0);
|
|
|
+ map.put("cabinetId", "a");
|
|
|
+ map.put("doorId", "a");
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, map, InquiryActivity.class);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- viewBinding.reCla.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, UseActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.reCla.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, UseActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.reRet.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, ChemicalsAlsoActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.reRet.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, ChemicalsAlsoActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.rlLedger.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, LedgerActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.rlLedger.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, LedgerActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.reLedger.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, ChemicalLabelingActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.reLedger.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, ChemicalLabelingActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.rlWarning.setOnClickListener(v -> {
|
|
|
- if (ChemicalApp.userData != null) {
|
|
|
- UiManager.INSTANCE.switcher(this, WarningEventsActivity.class);
|
|
|
- } else {
|
|
|
- basicConfLog();
|
|
|
+ viewBinding.rlWarning.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ if (ChemicalApp.userData != null) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, WarningEventsActivity.class);
|
|
|
+ } else {
|
|
|
+ basicConfLog();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- viewBinding.rlDem.setOnClickListener(v -> {
|
|
|
- UiManager.INSTANCE.switcher(this, MsdsActivity.class);
|
|
|
+ viewBinding.rlDem.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ UiManager.INSTANCE.switcher(MainActivity.this, MsdsActivity.class);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
- viewBinding.inc.tvOutLogin.setOnClickListener(v -> {
|
|
|
- ChemicalApp.userData = null;
|
|
|
- ChemicalApp.subjectId = null;
|
|
|
- HttpClient.INSTANCE.setToken(null);
|
|
|
- ActivityUtils.startActivity(StartActivity.class);
|
|
|
+ viewBinding.inc.tvOutLogin.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ ChemicalApp.userData = null;
|
|
|
+ ChemicalApp.subjectId = null;
|
|
|
+ HttpClient.INSTANCE.setToken(null);
|
|
|
+ ActivityUtils.startActivity(StartActivity.class);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
basicConf();
|
|
|
|
|
|
- viewBinding.caozuoRL.setOnClickListener(v -> {
|
|
|
- viewBinding.caozuoRL.setVisibility(View.GONE);
|
|
|
- viewBinding.caozuoQrRL.setVisibility(View.VISIBLE);
|
|
|
- viewBinding.caozuoQrRL.postDelayed(() -> {
|
|
|
- viewBinding.caozuoRL.setVisibility(View.VISIBLE);
|
|
|
- viewBinding.caozuoQrRL.setVisibility(View.GONE);
|
|
|
- }, 1000 * 60);
|
|
|
+
|
|
|
+ viewBinding.caozuoRL.setOnClickListener(new ClickUtils.OnDebouncingClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onDebouncingClick(View v) {
|
|
|
+ viewBinding.caozuoRL.setVisibility(View.GONE);
|
|
|
+ viewBinding.caozuoQrRL.setVisibility(View.VISIBLE);
|
|
|
+ viewBinding.caozuoQrRL.postDelayed(() -> {
|
|
|
+ viewBinding.caozuoRL.setVisibility(View.VISIBLE);
|
|
|
+ viewBinding.caozuoQrRL.setVisibility(View.GONE);
|
|
|
+ }, 1000 * 60);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
viewBinding.caozuoRL.post(() -> {
|