Browse Source

[feat]键盘插件,键盘选择页,透明状态栏和导航栏

hezihao 7 months ago
parent
commit
8689986d2a

+ 1 - 1
plugins/keyboard_android/android/src/main/AndroidManifest.xml

@@ -15,7 +15,7 @@
         <activity
         <activity
             android:name=".keyboard.InputMethodPickerActivity"
             android:name=".keyboard.InputMethodPickerActivity"
             android:launchMode="singleTask"
             android:launchMode="singleTask"
-            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
+            android:theme="@style/AppTheme.InputMethodPicker" />
 
 
         <service
         <service
             android:name=".keyboard.CustomKeyboardService"
             android:name=".keyboard.CustomKeyboardService"

+ 14 - 0
plugins/keyboard_android/android/src/main/res/values/theme.xml

@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 <resources>
+    <!-- 输入法选择页面 -->
+    <style name="AppTheme.InputMethodPicker" parent="@android:style/Theme.Translucent.NoTitleBar">
+        <!-- 状态栏透明 -->
+        <item name="android:statusBarColor">@android:color/transparent</item>
+        <!-- 关闭半透明状态栏 -->
+        <item name="android:windowTranslucentStatus">false</item>
+        <!-- 确保窗口绘制系统栏背景 -->
+        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
+        <!-- 全屏布局标志 -->
+        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
+        <!-- 导航栏透明 -->
+        <item name="android:navigationBarColor">@android:color/transparent</item>
+    </style>
+
     <!-- 弹窗动画 -->
     <!-- 弹窗动画 -->
     <style name="PopupAnimation">
     <style name="PopupAnimation">
         <item name="android:windowEnterAnimation">@anim/popup_enter</item>
         <item name="android:windowEnterAnimation">@anim/popup_enter</item>