Browse Source

1.添加解除管控弹窗需要密码才能解除。

20241218TB223FC(测试jar包)
wangwanlei 10 months ago
parent
commit
5f0404a3e0

+ 20
- 0
app/src/main/java/com/xhly/manageapp/viewmodel/BaseViewModel.kt View File

16
     val pwdResultData: LiveData<Boolean> = pwdResult
16
     val pwdResultData: LiveData<Boolean> = pwdResult
17
     private val timeResult = MutableLiveData<Long>()
17
     private val timeResult = MutableLiveData<Long>()
18
     val timeResultData: LiveData<Long> = timeResult
18
     val timeResultData: LiveData<Long> = timeResult
19
+    private val controlResult = MutableLiveData<Boolean>()
20
+    val controlResultData: LiveData<Boolean> = controlResult
19
     /**
21
     /**
20
      * 解除当前锁屏
22
      * 解除当前锁屏
21
      */
23
      */
67
             }
69
             }
68
         }
70
         }
69
     }
71
     }
72
+    /**
73
+     * 手动退出管控
74
+     */
75
+    fun postExitControl(password:String){
76
+        launchUI {
77
+            val map=HashMap<String,Any>()
78
+            map[password]=password
79
+            val result= loginService.postExitControl(map)
80
+            if (result.code==0){
81
+                val codeDetailBean = result.obj
82
+                controlResult.value = password==codeDetailBean.controlPwd
83
+            }else{
84
+                if (!result.msg.isNullOrEmpty()){
85
+                    netMessage.value=result.msg
86
+                }
87
+            }
88
+        }
89
+    }
70
 }
90
 }

+ 9
- 0
app/src/main/res/layout/activity_manage.xml View File

18
                 android:layout_height="wrap_content"
18
                 android:layout_height="wrap_content"
19
                 android:gravity="center_vertical">
19
                 android:gravity="center_vertical">
20
 
20
 
21
+                <androidx.appcompat.widget.AppCompatButton
22
+                    android:id="@+id/closemanage_btn"
23
+                    android:layout_width="0dp"
24
+                    android:layout_height="80dp"
25
+                    android:layout_weight="1"
26
+                    android:text="退出管控" />
27
+
21
                 <androidx.appcompat.widget.AppCompatButton
28
                 <androidx.appcompat.widget.AppCompatButton
22
                     android:id="@+id/adbopenBtn"
29
                     android:id="@+id/adbopenBtn"
23
                     android:layout_width="0dp"
30
                     android:layout_width="0dp"
81
                     android:layout_height="80dp"
88
                     android:layout_height="80dp"
82
                     android:layout_weight="1"
89
                     android:layout_weight="1"
83
                     android:text="wifi高级设置开关" />
90
                     android:text="wifi高级设置开关" />
91
+
84
                 <androidx.appcompat.widget.AppCompatButton
92
                 <androidx.appcompat.widget.AppCompatButton
85
                     android:id="@+id/wifi_high_btn2"
93
                     android:id="@+id/wifi_high_btn2"
86
                     android:layout_width="0dp"
94
                     android:layout_width="0dp"
176
                     android:layout_height="80dp"
184
                     android:layout_height="80dp"
177
                     android:layout_weight="1"
185
                     android:layout_weight="1"
178
                     android:text="限制飞行模式" />
186
                     android:text="限制飞行模式" />
187
+
179
                 <androidx.appcompat.widget.AppCompatButton
188
                 <androidx.appcompat.widget.AppCompatButton
180
                     android:id="@+id/status_btn"
189
                     android:id="@+id/status_btn"
181
                     android:layout_width="0dp"
190
                     android:layout_width="0dp"

+ 1
- 0
app/src/main/res/layout/layout_edit_dialog.xml View File

25
         android:gravity="center_vertical"
25
         android:gravity="center_vertical"
26
         android:hint="@string/inputregioncode"
26
         android:hint="@string/inputregioncode"
27
         android:singleLine="true"
27
         android:singleLine="true"
28
+        android:maxLength="20"
28
         android:textColor="@color/black"
29
         android:textColor="@color/black"
29
         android:textColorHint="#FFB8C2D9"
30
         android:textColorHint="#FFB8C2D9"
30
         android:textSize="16sp" />
31
         android:textSize="16sp" />

+ 1
- 0
app/src/main/res/values/strings.xml View File

40
     <string name="netset">网络设置</string>
40
     <string name="netset">网络设置</string>
41
     <string name="synctime">同步时间</string>
41
     <string name="synctime">同步时间</string>
42
     <string name="syncsucess">同步完成。</string>
42
     <string name="syncsucess">同步完成。</string>
43
+    <string name="exitcontrol">解除管控</string>
43
 </resources>
44
 </resources>

Loading…
Cancel
Save