Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoXiCheng committed Jan 7, 2024
1 parent ef12452 commit 0374fbc
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- release
env:
LATEST_VERSION: "1.5"
LATEST_VERSION: "2.0.0"

jobs:
build-and-deploy:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SKIP 是一款免费开源的安卓应用,旨在利用 Android 无障碍服务

## 主界面预览

<img src="https://guoxicheng.top/assets/image/skip-docs/main-interface.jpg" alt="https://guoxicheng.top/assets/image/skip-docs/main-interface.jpg" style="width: 30%;" />
<img src="https://guoxicheng.top/assets/image/skip-docs/main-interface-light.png" alt="https://guoxicheng.top/assets/image/skip-docs/main-interface-light.png" style="width: 30%;" />

## 使用说明

Expand All @@ -18,7 +18,7 @@ SKIP 是一款免费开源的安卓应用,旨在利用 Android 无障碍服务
## 如何贡献

- 应用市场APP种类繁多,情况各异,无法保证完全适配
- 如有问题可以提交issue,或者参考 👉 [贡献指南](https://guoxicheng.top/projects/SKIP-Docs/003-contribute.html)
- 如有问题可以提交issue,或者参考 👉 [贡献指南](https://guoxicheng.top/projects/SKIP-Docs/contribute.html)

## 许可证

Expand Down
Binary file added apk/SKIP-v2.0.0.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 24
targetSdk 32
versionCode 1
versionName "1.5"
versionName "2.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/com/android/skip/compose/ConfirmDialog.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.android.skip.compose

import android.content.res.Configuration
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -22,6 +23,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand All @@ -37,6 +39,7 @@ fun ConfirmDialog(
onDismiss: () -> Unit,
onAllow: () -> Unit
) {
val darkTheme = isSystemInDarkTheme()
Dialog(onDismissRequest = { /* 点击外部不关闭对话框 */ }) {
Card(
modifier = Modifier.height(200.dp),
Expand Down Expand Up @@ -70,9 +73,9 @@ fun ConfirmDialog(
Button(
onClick = onDismiss,
modifier = Modifier.weight(1f),
colors = if (themeTypeState.value == Configuration.UI_MODE_NIGHT_NO) ButtonDefaults.buttonColors(
Color(0xFFF0F0F0)
) else ButtonDefaults.buttonColors(Color(0xFF454545))
colors = if (darkTheme || themeTypeState.value == Configuration.UI_MODE_NIGHT_YES) ButtonDefaults.buttonColors(
Color(0xFF454545)
) else ButtonDefaults.buttonColors(Color(0xFFF0F0F0))
) {
Text(
text = stringResource(id = R.string.dialog_confirm_dismiss),
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/android/skip/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.core.view.ViewCompat
import com.android.skip.SKIP_APP_THEME
import com.android.skip.utils.DataStoreUtils
import com.android.skip.themeTypeState

private val darkColorScheme = darkColorScheme(
primary = Purple80,
Expand All @@ -37,7 +34,6 @@ private val lightColorScheme = lightColorScheme(
)



@Composable
fun AppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
Expand All @@ -50,6 +46,7 @@ fun AppTheme(
val context = LocalContext.current
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}

darkTheme -> darkColorScheme
else -> lightColorScheme
}
Expand All @@ -58,6 +55,9 @@ fun AppTheme(
SideEffect {
(view.context as Activity).window.statusBarColor = colorScheme.background.toArgb()
ViewCompat.getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
// 根据主题设置状态栏图标和文字颜色
ViewCompat.getWindowInsetsController((view.context as Activity).window.decorView)?.isAppearanceLightStatusBars =
!darkTheme || themeTypeState.value != Configuration.UI_MODE_NIGHT_YES
}
}

Expand Down
Binary file modified app/src/main/res/drawable-v24/backend_lock.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0374fbc

Please sign in to comment.