Skip to content

Commit

Permalink
feat(快照): 支持隐藏快照状态栏
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Sep 28, 2023
1 parent 23ea759 commit 2b95dd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 13 additions & 3 deletions app/src/main/java/li/songe/gkd/ui/DebugPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.core.app.NotificationManagerCompat
import androidx.core.content.ContextCompat
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import com.dylanc.activityresult.launcher.launchForResult
import com.ramcosta.composedestinations.annotation.Destination
Expand Down Expand Up @@ -96,8 +95,7 @@ fun DebugPage() {
if (shizukuIsOk) {
// check method type
appScope.launchTry(Dispatchers.IO) {
LogUtils.d(newActivityTaskManager()?.safeGetTasks()
?.map { t -> t.topActivity?.className })
newActivityTaskManager()?.safeGetTasks()
}
}
})
Expand Down Expand Up @@ -206,6 +204,18 @@ fun DebugPage() {
}
}
Divider()
TextSwitch(
name = "隐藏快照状态栏",
desc = "当保存快照时,隐藏截图里的顶部状态栏高度区域",
checked = store.hideSnapshotStatusBar
) {
updateStorage(
storeFlow, store.copy(
hideSnapshotStatusBar = it
)
)
}
Divider()

SettingItem(title = "快照记录", onClick = {
navController.navigate(SnapshotPageDestination)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/li/songe/gkd/util/Store.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ data class Store(
val toastWhenClick: Boolean = true,
val clickToast: String = "跳过",
val autoClearMemorySubs: Boolean = true,
val hideSnapshotStatusBar: Boolean = false,
) : Parcelable

val storeFlow by lazy {
Expand Down

0 comments on commit 2b95dd9

Please sign in to comment.