新增隐藏桌面图标

This commit is contained in:
LittleTurtle2333
2022-02-20 19:24:12 +08:00
parent 4ef98f0bd9
commit 53a2ffd8de
3 changed files with 30 additions and 1 deletions

View File

@@ -17,11 +17,21 @@
android:launchMode="singleTop"> android:launchMode="singleTop">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" /> <category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity-alias
android:name=".launcher"
android:enabled="true"
android:exported="true"
android:targetActivity=".activity.SettingsActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<meta-data <meta-data
android:name="xposedmodule" android:name="xposedmodule"
android:value="true" /> android:value="true" />

View File

@@ -3,7 +3,9 @@
package com.lt2333.simplicitytools.activity package com.lt2333.simplicitytools.activity
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.ComponentName
import android.content.Intent import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.widget.Toast import android.widget.Toast
@@ -55,6 +57,22 @@ class SettingsActivity : MIUIActivity() {
override fun mainItems(): ArrayList<BaseView> { override fun mainItems(): ArrayList<BaseView> {
return arrayListOf<BaseView>().apply { return arrayListOf<BaseView>().apply {
add(TextWithSwitchV(TextV(resId = R.string.main_switch), SwitchV("main_switch"))) add(TextWithSwitchV(TextV(resId = R.string.main_switch), SwitchV("main_switch")))
add(
TextWithSwitchV(
TextV(resId = R.string.HideLauncherIcon),
SwitchV("hLauncherIcon", customOnCheckedChangeListener = {
packageManager.setComponentEnabledSetting(
ComponentName(activity, "${BuildConfig.APPLICATION_ID}.launcher"),
if (it) {
PackageManager.COMPONENT_ENABLED_STATE_DISABLED
} else {
PackageManager.COMPONENT_ENABLED_STATE_ENABLED
},
PackageManager.DONT_KILL_APP
)
})
)
)
add(TitleTextV(resId = R.string.ui)) add(TitleTextV(resId = R.string.ui))
add( add(
TextWithSwitchV( TextWithSwitchV(

View File

@@ -54,5 +54,6 @@
<string name="skip_waiting_time">跳过 5/10 秒警告时间</string> <string name="skip_waiting_time">跳过 5/10 秒警告时间</string>
<string name="unlock_unlimited_cropping">解锁无限裁切图片/截图</string> <string name="unlock_unlimited_cropping">解锁无限裁切图片/截图</string>
<string name="hide_slave_wifi_icon">隐藏 辅助WIFI 图标</string> <string name="hide_slave_wifi_icon">隐藏 辅助WIFI 图标</string>
<string name="HideLauncherIcon">隐藏桌面图标</string>
</resources> </resources>