mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 19:15:58 +00:00
Split the application into several pages
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package com.binbin.androidowner
|
||||
|
||||
import android.app.admin.DevicePolicyManager
|
||||
import android.content.ComponentName
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import com.binbin.androidowner.ui.theme.AndroidOwnerTheme
|
||||
|
||||
@Composable
|
||||
fun ApplicationManage(myDpm:DevicePolicyManager, myComponent:ComponentName){
|
||||
var pkgName by remember { mutableStateOf("com.mihoyo.yuanshen") }
|
||||
Column {
|
||||
TextField(value = pkgName, onValueChange = {pkgName = it}, label = { Text("包名") })
|
||||
Button(onClick = { myDpm.setApplicationHidden(myComponent,pkgName,true) }) {
|
||||
Text("隐藏")
|
||||
}
|
||||
Button(onClick = { myDpm.setApplicationHidden(myComponent,pkgName,false) }) {
|
||||
Text("显示")
|
||||
}
|
||||
Button(onClick = { myDpm.setUninstallBlocked(myComponent, pkgName, true) }) {
|
||||
Text("禁止卸载")
|
||||
}
|
||||
Button(onClick = { myDpm.setUninstallBlocked(myComponent, pkgName, false)}) {
|
||||
Text("允许卸载")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user