| | |
| | | // Toast("测试页面: " + (isChecked ? "开启" : "关闭")); |
| | | // }); |
| | | |
| | | QMUICommonListItemView itemKeepAdmin = mGroupListView.createItemView("保持管理员模式"); |
| | | itemKeepAdmin.setAccessoryType(QMUICommonListItemView.ACCESSORY_TYPE_SWITCH); |
| | | boolean isKeepAdmin = com.blankj.utilcode.util.SPUtils.getInstance().getBoolean("keep_admin_mode", false); |
| | | itemKeepAdmin.getSwitch().setChecked(isKeepAdmin); |
| | | itemKeepAdmin.getSwitch().setOnCheckedChangeListener((buttonView, isChecked) -> { |
| | | com.blankj.utilcode.util.SPUtils.getInstance().put("keep_admin_mode", isChecked); |
| | | Toast("管理员模式持久化: " + (isChecked ? "开启" : "关闭")); |
| | | }); |
| | | |
| | | QMUIGroupListView.newSection(this) |
| | | .setTitle("设置") |
| | | .addItemView(itemCmdLog, null) |
| | | // .addItemView(itemTestPage, null) |
| | | .addItemView(itemKeepAdmin, null) |
| | | .addTo(mGroupListView); |
| | | } |
| | | |