diff --git a/app/src/main/java/li/songe/gkd/service/GkdAbService.kt b/app/src/main/java/li/songe/gkd/service/GkdAbService.kt index 2a7858b..3201ecb 100644 --- a/app/src/main/java/li/songe/gkd/service/GkdAbService.kt +++ b/app/src/main/java/li/songe/gkd/service/GkdAbService.kt @@ -5,7 +5,6 @@ import android.content.pm.PackageManager import android.graphics.Bitmap import android.os.Build import android.view.Display -import android.view.KeyEvent import android.view.accessibility.AccessibilityEvent import android.view.accessibility.AccessibilityNodeInfo import com.blankj.utilcode.util.LogUtils @@ -34,7 +33,6 @@ import li.songe.gkd.data.NodeInfo import li.songe.gkd.data.RpcError import li.songe.gkd.data.SubscriptionRaw import li.songe.gkd.db.DbSet -import li.songe.gkd.debug.SnapshotExt import li.songe.gkd.shizuku.newActivityTaskManager import li.songe.gkd.shizuku.shizukuIsSafeOK import li.songe.gkd.shizuku.useShizukuAliveState @@ -96,23 +94,6 @@ class GkdAbService : CompositionAbService({ return null } - var lastKeyEventTime = -1L - onKeyEvent { event -> // 当按下音量键时捕获快照 - val keyCode = event?.keyCode ?: return@onKeyEvent - if (storeFlow.value.captureVolumeKey && (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP)) { - val et = System.currentTimeMillis() - if (et - lastKeyEventTime > 3000) { - lastKeyEventTime = et - scope.launchTry(IO) { - val snapshot = SnapshotExt.captureSnapshot() - ToastUtils.showShort("保存快照成功") - LogUtils.d("截屏:保存快照", snapshot.id) - } - } - } - } - - var serviceConnected = false onServiceConnected { serviceConnected = true } onInterrupt { serviceConnected = false } diff --git a/app/src/main/java/li/songe/gkd/ui/DebugPage.kt b/app/src/main/java/li/songe/gkd/ui/DebugPage.kt index 52c8cb5..9b9f6f3 100644 --- a/app/src/main/java/li/songe/gkd/ui/DebugPage.kt +++ b/app/src/main/java/li/songe/gkd/ui/DebugPage.kt @@ -192,19 +192,6 @@ fun DebugPage() { } Divider() - TextSwitch( - name = "按键快照", - desc = "当用户按下音量键时,自动保存当前界面的快照", - checked = store.captureVolumeKey - ) { - updateStorage( - storeFlow, store.copy( - captureVolumeKey = it - ) - ) - } - Divider() - SettingItem(title = "快照记录", onClick = { navController.navigate(SnapshotPageDestination) }) diff --git a/app/src/main/java/li/songe/gkd/util/Store.kt b/app/src/main/java/li/songe/gkd/util/Store.kt index a372648..3ebff79 100644 --- a/app/src/main/java/li/songe/gkd/util/Store.kt +++ b/app/src/main/java/li/songe/gkd/util/Store.kt @@ -78,7 +78,7 @@ data class Store( val captureScreenshot: Boolean = false, val httpServerPort: Int = 8888, val updateSubsInterval: Long = 60 * 60_000, - val captureVolumeKey: Boolean = false, + @Deprecated("https://github.com/gkd-kit/gkd/issues/26") val captureVolumeKey: Boolean = false, val autoCheckAppUpdate: Boolean = true, val toastWhenClick: Boolean = true, val clickToast: String = "跳过", diff --git a/app/src/main/res/xml/ab_desc.xml b/app/src/main/res/xml/ab_desc.xml index 3ab3117..8fd58f5 100644 --- a/app/src/main/res/xml/ab_desc.xml +++ b/app/src/main/res/xml/ab_desc.xml @@ -1,12 +1,13 @@ \ No newline at end of file + android:settingsActivity="li.songe.gkd.MainActivity" + tools:ignore="UnusedAttribute" /> \ No newline at end of file