mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-13 03:41:19 +08:00
新增锁定刷新率上限、允许截图快速开关
This commit is contained in:
@@ -44,6 +44,29 @@
|
||||
<meta-data
|
||||
android:name="xposedscope"
|
||||
android:resource="@array/xposed_scope" />
|
||||
|
||||
<service
|
||||
android:name=".tile.LockMaxFpsTile"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_fps"
|
||||
android:label="@string/lock_max"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name=".tile.AllowScreenshots"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic_baseline_fullscreen_24"
|
||||
android:label="@string/allow_screenshots"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE"/>
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.lt2333.simplicitytools.tile
|
||||
|
||||
import android.service.quicksettings.Tile
|
||||
import android.service.quicksettings.TileService
|
||||
|
||||
class AllowScreenshots : TileService(){
|
||||
val key = "disable_flag_secure"
|
||||
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
val prefEditor = pref.edit()
|
||||
if (pref.getBoolean(key, false)) {
|
||||
prefEditor.putBoolean(key, false)
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
} else {
|
||||
prefEditor.putBoolean(key, true)
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
}
|
||||
prefEditor.commit()
|
||||
qsTile.updateTile()
|
||||
}
|
||||
|
||||
override fun onStartListening() {
|
||||
super.onStartListening()
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
if (pref.getBoolean(key, false)) {
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
} else {
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
}
|
||||
qsTile.updateTile()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.lt2333.simplicitytools.tile
|
||||
|
||||
import android.service.quicksettings.Tile
|
||||
import android.service.quicksettings.TileService
|
||||
|
||||
class LockMaxFpsTile : TileService() {
|
||||
|
||||
val key = "lock_max_fps"
|
||||
|
||||
override fun onClick() {
|
||||
super.onClick()
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
val prefEditor = pref.edit()
|
||||
if (pref.getBoolean(key, false)) {
|
||||
prefEditor.putBoolean(key, false)
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
} else {
|
||||
prefEditor.putBoolean(key, true)
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
}
|
||||
prefEditor.commit()
|
||||
qsTile.updateTile()
|
||||
}
|
||||
|
||||
override fun onStartListening() {
|
||||
super.onStartListening()
|
||||
val pref = getSharedPreferences("config", MODE_WORLD_READABLE)
|
||||
if (pref.getBoolean(key, false)) {
|
||||
qsTile.state = Tile.STATE_ACTIVE
|
||||
} else {
|
||||
qsTile.state = Tile.STATE_INACTIVE
|
||||
}
|
||||
qsTile.updateTile()
|
||||
}
|
||||
|
||||
}
|
||||
5
app/src/main/res/drawable/ic_baseline_fullscreen_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_fullscreen_24.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M7,14L5,14v5h5v-2L7,17v-3zM5,10h2L7,7h3L10,5L5,5v5zM17,17h-3v2h5v-5h-2v3zM14,5v2h3v3h2L19,5h-5z"/>
|
||||
</vector>
|
||||
21
app/src/main/res/drawable/ic_fps.xml
Normal file
21
app/src/main/res/drawable/ic_fps.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M7.21,8.05H2.39v2.79H6.57v1H2.39v3.93H1.21V7h6Z"
|
||||
android:fillColor="#fff"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M12.11,12.36H9.74v3.38H8.56V7.08h3.67c1.86,0.08 2.86,0.94 3,2.57C15.21,11.43 14.16,12.33 12.11,12.36ZM11.94,8H9.74v3.42h2.2c1.38,0 2.08,-0.59 2.11,-1.78S13.26,8.06 11.94,8Z"
|
||||
android:fillColor="#fff"
|
||||
android:strokeColor="#fff"/>
|
||||
<path
|
||||
android:strokeWidth="1"
|
||||
android:pathData="M16.2,13.12l1.19,-0.3a2.22,2.22 0,0 0,2.53 2.12c1.3,0 2,-0.55 2.07,-1.57 0.09,-0.7 -0.56,-1.22 -1.94,-1.56l-0.76,-0.21c-1.95,-0.37 -2.86,-1.16 -2.75,-2.37 0.11,-1.46 1.13,-2.22 3,-2.28s3.09,0.78 3.43,2.32l-1.19,0.3a1.91,1.91 0,0 0,-2.15 -1.69c-1.19,0.06 -1.83,0.51 -2,1.35s0.65,1.2 2.2,1.48l0.68,0.17 0.25,0.08c1.63,0.46 2.42,1.26 2.37,2.41C23.13,15 22.05,15.85 20,15.91S16.57,15 16.2,13.12Z"
|
||||
android:fillColor="#fff"
|
||||
android:strokeColor="#fff"/>
|
||||
</vector>
|
||||
@@ -63,5 +63,10 @@
|
||||
<string name="status_bar_time_day">显示日期</string>
|
||||
<string name="status_bar_time_week">显示星期</string>
|
||||
<string name="status_bar_time_hide_space">隐藏间隔</string>
|
||||
<string name="allow_screenshots">允许截图</string>
|
||||
<string name="lock_max">锁定上限</string>
|
||||
<string name="status_bar_time_double_hour">显示时辰</string>
|
||||
<string name="custom_clock_switch">自定义时钟-总开关</string>
|
||||
<string name="status_bar_time_period">显示时段</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user