diff --git a/android/app/src/main/java/games/wenzi/ogame/MainActivity.java b/android/app/src/main/java/games/wenzi/ogame/MainActivity.java
index 8eeb0c5..9489197 100644
--- a/android/app/src/main/java/games/wenzi/ogame/MainActivity.java
+++ b/android/app/src/main/java/games/wenzi/ogame/MainActivity.java
@@ -1,8 +1,10 @@
package games.wenzi.ogame;
+import android.graphics.Color;
import android.os.Bundle;
import android.view.Window;
-import androidx.core.content.ContextCompat;
+import androidx.core.view.WindowCompat;
+import androidx.core.view.WindowInsetsControllerCompat;
import com.getcapacitor.BridgeActivity;
public class MainActivity extends BridgeActivity {
@@ -10,9 +12,20 @@ public class MainActivity extends BridgeActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // 设置状态栏颜色,防止 Capacitor 强制透明
Window window = getWindow();
- window.setStatusBarColor(ContextCompat.getColor(this, R.color.status_bar_color));
- window.setNavigationBarColor(ContextCompat.getColor(this, R.color.status_bar_color));
+
+ // 启用边到边显示(Edge-to-Edge)
+ WindowCompat.setDecorFitsSystemWindows(window, false);
+
+ // 设置透明状态栏和导航栏
+ window.setStatusBarColor(Color.TRANSPARENT);
+ window.setNavigationBarColor(Color.TRANSPARENT);
+
+ // 设置状态栏图标为浅色(因为背景是深色)
+ WindowInsetsControllerCompat controller = WindowCompat.getInsetsController(window, window.getDecorView());
+ if (controller != null) {
+ controller.setAppearanceLightStatusBars(false);
+ controller.setAppearanceLightNavigationBars(false);
+ }
}
}
diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml
index 6a6c20a..ad35f23 100644
--- a/android/app/src/main/res/values/styles.xml
+++ b/android/app/src/main/res/values/styles.xml
@@ -13,8 +13,10 @@
- false
- true
- @null
- - #1a1a2e
- - #1a1a2e
+ - @android:color/transparent
+ - @android:color/transparent
+ - false
+ - false
diff --git a/src/style.css b/src/style.css
index d4c10e8..5bed97c 100644
--- a/src/style.css
+++ b/src/style.css
@@ -120,6 +120,11 @@
@apply border-border outline-ring/50;
}
+ html {
+ /* 平滑过渡 */
+ transition: background-color 0.3s ease, color 0.3s ease;
+ }
+
body {
@apply bg-background text-foreground;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -128,11 +133,6 @@
-moz-osx-font-smoothing: grayscale;
}
- /* 平滑过渡 */
- html {
- transition: background-color 0.3s ease, color 0.3s ease;
- }
-
/* 滚动条样式 */
::-webkit-scrollbar {
width: 8px;