|
@@ -255,34 +255,6 @@ class ManageActivity : BaseActivity<BaseViewModel, ActivityManageBinding>() {
|
255
|
255
|
}
|
256
|
256
|
}
|
257
|
257
|
|
258
|
|
- private fun showEditDialog() {
|
259
|
|
- CustomDialog.build()
|
260
|
|
- .setCustomView(object : OnBindView<CustomDialog>(R.layout.layout_edit_dialog) {
|
261
|
|
- override fun onBind(dialog: CustomDialog, v: View) {
|
262
|
|
- val titleTv = v.findViewById<TextView>(R.id.dialog_title_tv)
|
263
|
|
- val enterTv = v.findViewById<TextView>(R.id.dialog_enter_tv)
|
264
|
|
- val cancelTv = v.findViewById<TextView>(R.id.dialog_cancel_tv)
|
265
|
|
- val editText = v.findViewById<EditText>(R.id.dialog_et)
|
266
|
|
- editText.hint = getString(R.string.inputcode)
|
267
|
|
- titleTv.text = getString(R.string.exitcontrol)
|
268
|
|
- enterTv.setOnClickListener {
|
269
|
|
- val code = editText.text
|
270
|
|
- if ((!code.isNullOrBlank()) && code.length >= 6) {
|
271
|
|
- dialog.dismiss()
|
272
|
|
- try {
|
273
|
|
- viewModel.postExitControl(code.toString())
|
274
|
|
- } catch (e: Exception) {
|
275
|
|
-
|
276
|
|
- }
|
277
|
|
- }
|
278
|
|
- }
|
279
|
|
- cancelTv.setOnClickListener {
|
280
|
|
- dialog.dismiss()
|
281
|
|
- }
|
282
|
|
- }
|
283
|
|
- }).setCancelable(false).setMaskColor(Color.parseColor("#66000000"))
|
284
|
|
- .setAlign(CustomDialog.ALIGN.CENTER).show()
|
285
|
|
- }
|
286
|
258
|
|
287
|
259
|
|
288
|
260
|
override fun finish() {
|