Sfoglia il codice sorgente

更新TargetSDK至36
更新部分界面
添加透明主题

HapeLee 1 anno fa
parent
commit
22f34161ab

+ 1 - 1
app/build.gradle

@@ -50,7 +50,7 @@ android {
     defaultConfig {
         applicationId "io.legato.kazusa"
         minSdk 26
-        targetSdk 35
+        targetSdk 36
         versionCode 10000 + gitCommits
         versionName version
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

+ 2 - 1
app/src/main/java/io/legato/kazusa/base/BaseActivity.kt

@@ -12,6 +12,7 @@ import android.view.MotionEvent
 import android.view.View
 import androidx.activity.enableEdgeToEdge
 import androidx.appcompat.app.AppCompatActivity
+import androidx.core.graphics.drawable.toDrawable
 import androidx.viewbinding.ViewBinding
 import com.google.android.material.appbar.AppBarLayout
 import com.google.android.material.color.DynamicColors
@@ -28,7 +29,6 @@ import io.legato.kazusa.utils.hideSoftInput
 import io.legato.kazusa.utils.observeEvent
 import io.legato.kazusa.utils.toastOnUi
 import io.legato.kazusa.utils.windowSize
-import androidx.core.graphics.drawable.toDrawable
 
 
 abstract class BaseActivity<VB : ViewBinding>(
@@ -134,6 +134,7 @@ abstract class BaseActivity<VB : ViewBinding>(
             "4" -> setTheme(R.style.Theme_Base_Koharu)
             "5" -> setTheme(R.style.Theme_Base_Yuuka)
             "6" -> setTheme(R.style.Theme_Base_Phoebe)
+            "7" -> setTheme(R.style.AppTheme_Transparent)
         }
     }
 

+ 2 - 1
app/src/main/java/io/legato/kazusa/lib/prefs/ThemeCardPreference.kt

@@ -93,7 +93,8 @@ class ThemeCardPreference(context: Context, attrs: AttributeSet) : Preference(co
         "3" to R.style.Theme_Base_WH,
         "4" to R.style.Theme_Base_Koharu,
         "5" to R.style.Theme_Base_Yuuka,
-        "6" to R.style.Theme_Base_Phoebe
+        "6" to R.style.Theme_Base_Phoebe,
+        "7" to R.style.AppTheme_Transparent
         )
 
     private fun getThemeColors(value: String): List<Int> {

+ 34 - 0
app/src/main/java/io/legato/kazusa/lib/prefs/TipPreference.kt

@@ -0,0 +1,34 @@
+package io.legato.kazusa.lib.prefs
+
+import android.content.Context
+import android.util.AttributeSet
+import android.widget.TextView
+import androidx.core.content.withStyledAttributes
+import androidx.preference.PreferenceViewHolder
+import io.legato.kazusa.R
+
+class TipPreference(context: Context, attrs: AttributeSet) : Preference(context, attrs) {
+
+    private var tipText: String? = null
+
+    init {
+        layoutResource = R.layout.view_preference_tip
+
+        // 从 attrs.xml 中读取 tipText
+        context.withStyledAttributes(attrs, R.styleable.TipPreference) {
+            tipText = getString(R.styleable.TipPreference_tipText)
+        }
+    }
+
+    override fun onBindViewHolder(holder: PreferenceViewHolder) {
+        super.onBindViewHolder(holder)
+
+        val tipTextView = holder.findViewById(R.id.tip_text) as? TextView
+        tipTextView?.text = tipText ?: ""
+    }
+
+    fun setTipText(text: String) {
+        tipText = text
+        notifyChanged()
+    }
+}

+ 2 - 3
app/src/main/res/layout/activity_book_info.xml

@@ -344,16 +344,15 @@
         android:id="@+id/btn_read"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:minWidth="56dp"
         android:layout_gravity="bottom|end"
         android:layout_marginEnd="16dp"
         android:layout_marginBottom="24dp"
         android:text="@string/reading"
         android:textColor="?attr/colorOnPrimary"
         android:contentDescription="@string/reading"
-        app:iconGravity="textStart"
         app:icon="@drawable/ic_bottom_books"
         app:backgroundTint="?attr/colorSecondary"
-        app:iconTint="?attr/colorOnPrimary"
-        app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
+        app:iconTint="?attr/colorOnPrimary" />
 
 </androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 1 - 1
app/src/main/res/layout/activity_import_book.xml

@@ -39,7 +39,7 @@
             android:id="@+id/tv_go_back"
             android:layout_width="36dp"
             android:layout_height="36dp"
-            style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+            style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
             app:icon="@drawable/ic_return"
             app:iconGravity="textStart"
             tools:ignore="UnusedAttribute" />

+ 9 - 7
app/src/main/res/layout/dialog_read_aloud.xml

@@ -43,7 +43,7 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/iv_play_prev"
-            style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+            style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
             android:layout_width="wrap_content"
             android:layout_height="48dp"
             android:contentDescription="@string/prev_sentence"
@@ -53,7 +53,7 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/iv_play_pause"
-            style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+            style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
             android:layout_width="48dp"
             android:layout_height="48dp"
             android:layout_marginHorizontal="6dp"
@@ -64,7 +64,7 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/iv_stop"
-            style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+            style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
             android:layout_width="48dp"
             android:layout_height="48dp"
             android:layout_marginEnd="6dp"
@@ -75,7 +75,7 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/iv_play_next"
-            style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+            style="@style/Widget.Material3Expressive.Button.TonalButton"
             android:layout_width="wrap_content"
             android:layout_height="48dp"
             android:contentDescription="@string/next_sentence"
@@ -124,9 +124,10 @@
         <!-- 上一章按钮 -->
         <com.google.android.material.button.MaterialButton
             android:id="@+id/tv_pre"
-            style="@style/Widget.Material3.Button.OutlinedButton"
+            style="@style/Widget.Material3Expressive.Button.OutlinedButton"
             android:layout_width="0dp"
             android:layout_height="match_parent"
+            android:textColor="?attr/colorPrimary"
             android:layout_weight="1"
             android:layout_marginEnd="8dp"
             android:minHeight="36dp"
@@ -137,7 +138,7 @@
         <!-- 计时器文本按钮 -->
         <com.google.android.material.button.MaterialButton
             android:id="@+id/btn_timer"
-            style="@style/Widget.Material3.Button.TonalButton"
+            style="@style/Widget.Material3Expressive.Button.TonalButton"
             android:layout_width="0dp"
             android:layout_height="match_parent"
             android:layout_marginHorizontal="6dp"
@@ -148,9 +149,10 @@
         <!-- 下一章按钮 -->
         <com.google.android.material.button.MaterialButton
             android:id="@+id/tv_next"
-            style="@style/Widget.Material3.Button.OutlinedButton"
+            style="@style/Widget.Material3Expressive.Button.OutlinedButton"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
+            android:textColor="?attr/colorPrimary"
             android:layout_weight="1"
             android:layout_marginStart="6dp"
             android:text="@string/next_chapter"

+ 30 - 12
app/src/main/res/layout/dialog_read_book_style.xml

@@ -65,13 +65,15 @@
 
                 <io.legato.kazusa.ui.book.read.config.TextFontWeightConverter
                     android:id="@+id/text_font_weight_converter"
-                    style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                    style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                     android:layout_width="64dp"
                     android:layout_height="64dp"
+                    android:text="@string/font_weight_text"
                     android:layout_weight="2"
                     app:icon="@drawable/font_bold"
                     app:iconGravity="textTop"
-                    android:text="@string/font_weight_text" />
+                    android:textSize="10sp"
+                    tool:ignore="SmallSp" />
 
                 <View
                     android:layout_width="0dp"
@@ -82,11 +84,13 @@
                     android:id="@+id/tv_text_font"
                     android:layout_width="64dp"
                     android:layout_height="64dp"
+                    style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                     android:layout_weight="2"
-                    style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                    android:text="@string/text_font"
                     app:icon="@drawable/font_style"
                     app:iconGravity="textTop"
-                    android:text="@string/text_font" />
+                    android:textSize="10sp"
+                    tool:ignore="SmallSp" />
 
                 <View
                     android:layout_width="0dp"
@@ -97,11 +101,13 @@
                     android:id="@+id/tv_text_indent"
                     android:layout_width="64dp"
                     android:layout_height="64dp"
+                    style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                     android:layout_weight="2"
-                    style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                    android:text="@string/text_indent"
                     app:icon="@drawable/ic_segment"
                     app:iconGravity="textTop"
-                    android:text="@string/text_indent" />
+                    android:textSize="10sp"
+                    tool:ignore="SmallSp" />
 
                 <View
                     android:layout_width="0dp"
@@ -112,11 +118,13 @@
                     android:id="@+id/tv_padding"
                     android:layout_width="64dp"
                     android:layout_height="64dp"
+                    style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                     android:layout_weight="2"
-                    style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                    android:text="@string/padding"
                     app:icon="@drawable/ic_padding"
                     app:iconGravity="textTop"
-                    android:text="@string/padding" />
+                    android:textSize="10sp"
+                    tool:ignore="SmallSp" />
 
             </LinearLayout>
 
@@ -126,29 +134,39 @@
                 android:layout_marginTop="8dp"
                 android:gravity="center_vertical"
                 android:orientation="horizontal"
-                android:layout_marginHorizontal="12dp" >
+                android:layout_marginHorizontal="16dp">
 
                 <io.legato.kazusa.ui.book.read.config.ChineseConverter
                     android:id="@+id/chinese_converter"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
-                    style="@style/Widget.Material3.Button.IconButton.Outlined" />
+                    style="@style/Widget.Material3Expressive.Button.OutlinedButton" />
+
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="0dp"
+                    android:layout_weight="1" />
 
                 <com.google.android.material.button.MaterialButton
                     android:id="@+id/tv_tip"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
-                    style="@style/Widget.Material3.Button.IconButton.Outlined"
+                    style="@style/Widget.Material3Expressive.Button.OutlinedButton"
                     android:text="@string/information" />
 
+                <View
+                    android:layout_width="0dp"
+                    android:layout_height="0dp"
+                    android:layout_weight="1" />
+
                 <com.google.android.material.button.MaterialButton
                     android:id="@+id/tv_more"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
-                    style="@style/Widget.Material3.Button.IconButton.Outlined"
+                    style="@style/Widget.Material3Expressive.Button.OutlinedButton"
                     android:text="@string/more_setting" />
 
             </LinearLayout>

+ 1 - 3
app/src/main/res/layout/view_pref.xml

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
+
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginHorizontal="16dp"
-    android:layout_marginVertical="8dp"
     android:orientation="vertical">
 
-
 </LinearLayout>

+ 24 - 0
app/src/main/res/layout/view_preference_tip.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_vertical"
+    android:orientation="vertical"
+    android:paddingHorizontal="16dp"
+    android:paddingBottom="8dp">
+
+    <ImageView
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginBottom="8dp"
+        android:src="@drawable/ic_cfg_about" />
+
+    <TextView
+        android:id="@+id/tip_text"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        android:text="@string/about"
+        android:textSize="12sp" />
+</LinearLayout>

+ 17 - 12
app/src/main/res/layout/view_read_menu.xml

@@ -141,7 +141,7 @@
 
                     <com.google.android.material.button.MaterialButton
                         android:id="@+id/tv_pre"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                        style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:clickable="true"
@@ -169,7 +169,7 @@
 
                     <com.google.android.material.button.MaterialButton
                         android:id="@+id/tv_next"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
+                        style="@style/Widget.Material3Expressive.Button.IconButton.Tonal"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:clickable="true"
@@ -194,8 +194,9 @@
                         android:id="@+id/fabSearch"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
-                        android:backgroundTint="@android:color/transparent"
+                        style="@style/Widget.Material3Expressive.Button.IconButton"
+                        android:background="?android:attr/selectableItemBackgroundBorderless"
+                        app:iconTint="?attr/colorPrimary"
                         android:contentDescription="@string/search_content"
                         android:tooltipText="@string/search_content"
                         app:icon="@drawable/ic_search"
@@ -211,8 +212,9 @@
                         android:id="@+id/iv_read_aloud"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
-                        android:backgroundTint="@android:color/transparent"
+                        style="@style/Widget.Material3Expressive.Button.IconButton"
+                        android:background="?android:attr/selectableItemBackgroundBorderless"
+                        app:iconTint="?attr/colorPrimary"
                         android:contentDescription="@string/read_aloud"
                         android:maxHeight="24dp"
                         app:icon="@drawable/ic_read_aloud"
@@ -229,8 +231,9 @@
                         android:id="@+id/iv_catalog"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
-                        android:backgroundTint="@android:color/transparent"
+                        style="@style/Widget.Material3Expressive.Button.IconButton"
+                        android:background="?android:attr/selectableItemBackgroundBorderless"
+                        app:iconTint="?attr/colorPrimary"
                         android:contentDescription="@string/chapter_list"
                         android:tooltipText="@string/chapter_list"
                         android:maxHeight="24dp"
@@ -248,8 +251,9 @@
                         android:id="@+id/fabAutoPage"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
-                        android:backgroundTint="@android:color/transparent"
+                        style="@style/Widget.Material3Expressive.Button.IconButton"
+                        android:background="?android:attr/selectableItemBackgroundBorderless"
+                        app:iconTint="?attr/colorPrimary"
                         android:contentDescription="@string/auto_next_page"
                         android:tooltipText="@string/auto_next_page"
                         app:icon="@drawable/ic_auto_page"
@@ -266,8 +270,9 @@
                         android:id="@+id/iv_setting"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
-                        style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
-                        android:backgroundTint="@android:color/transparent"
+                        style="@style/Widget.Material3Expressive.Button.IconButton"
+                        android:background="?android:attr/selectableItemBackgroundBorderless"
+                        app:iconTint="?attr/colorPrimary"
                         android:contentDescription="@string/setting"
                         android:tooltipText="@string/setting"
                         android:maxHeight="24dp"

+ 4 - 10
app/src/main/res/layout/view_select_action_bar.xml

@@ -7,9 +7,9 @@
     android:gravity="center_vertical"
     android:orientation="horizontal"
     android:paddingEnd="16dp"
-    android:paddingTop="6dp"
+    android:paddingTop="8dp"
     android:paddingStart="16dp"
-    android:paddingBottom="6dp"
+    android:paddingBottom="8dp"
     tools:ignore="RtlHardcoded">
 
     <io.legato.kazusa.lib.theme.view.ThemeCheckBox
@@ -17,18 +17,15 @@
         android:layout_width="0dp"
         android:layout_height="wrap_content"
         android:layout_weight="1"
-        android:padding="4dp"
         android:text="@string/select_all" />
 
     <com.google.android.material.button.MaterialButton
         android:id="@+id/btn_revert_selection"
+        style="@style/Widget.Material3Expressive.Button.TonalButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        style="@style/Widget.Material3.Button.TonalButton"
-        android:layout_margin="5dp"
+        android:layout_marginEnd="8dp"
         android:gravity="center"
-        android:minWidth="72dp"
-        android:padding="5dp"
         android:text="@string/revert_selection"
         app:isBottomBackground="true" />
 
@@ -36,10 +33,7 @@
         android:id="@+id/btn_select_action_main"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_margin="5dp"
         android:gravity="center"
-        android:minWidth="72dp"
-        android:padding="5dp"
         android:text="@string/app_name"
         android:visibility="gone"
         app:isBottomBackground="true" />

+ 17 - 2
app/src/main/res/layout/view_theme_mode.xml

@@ -2,14 +2,29 @@
 <com.google.android.material.button.MaterialButtonToggleGroup xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/theme_toggle_group"
-    style="@style/Widget.Material3.MaterialButtonGroup.Connected"
     android:layout_width="match_parent"
-    android:layout_height="48dp"
+    android:layout_height="wrap_content"
     android:orientation="horizontal"
+    android:layout_marginHorizontal="16dp"
+    android:layout_marginVertical="8dp"
     android:gravity="center"
     app:singleSelection="true"
     app:selectionRequired="true">
 
+    <TextView
+        android:id="@android:id/title"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="标题"
+        android:visibility="gone" />
+
+    <TextView
+        android:id="@android:id/summary"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="摘要"
+        android:visibility="gone" />
+
     <com.google.android.material.button.MaterialButton
         android:id="@+id/btn_system"
         style="@style/Widget.Material3Expressive.Button"

+ 49 - 0
app/src/main/res/values-night/colors.xml

@@ -289,6 +289,55 @@
     <color name="phoebe_theme_surfaceContainerHigh">#2C2A21</color>
     <color name="phoebe_theme_surfaceContainerHighest">#37352B</color>
 
+    <color name="transparent_theme_primary">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimary">#000000</color>
+    <color name="transparent_theme_primaryContainer">#80FFFFFF</color>
+    <color name="transparent_theme_onPrimaryContainer">#FF000000</color>
+    <color name="transparent_theme_secondary">#80FFFFFF</color>
+    <color name="transparent_theme_onSecondary">#FF000000</color>
+    <color name="transparent_theme_secondaryContainer">#40FFFFFF</color>
+    <color name="transparent_theme_onSecondaryContainer">#FF000000</color>
+    <color name="transparent_theme_tertiary">#80FFFFFF</color>
+    <color name="transparent_theme_onTertiary">#FF000000</color>
+    <color name="transparent_theme_tertiaryContainer">#40FFFFFF</color>
+    <color name="transparent_theme_onTertiaryContainer">#FF000000</color>
+    <color name="transparent_theme_error">#CF6679</color>
+    <color name="transparent_theme_onError">#000000</color>
+    <color name="transparent_theme_errorContainer">#8B0000</color>
+    <color name="transparent_theme_onErrorContainer">#FFFFFF</color>
+    <color name="transparent_theme_background">#00000000</color>
+    <color name="transparent_theme_onBackground">#EDE6FF</color>
+    <color name="transparent_theme_surface">#00FFFFFF</color>
+    <color name="transparent_theme_onSurface">#EDE6FF</color>
+    <color name="transparent_theme_surfaceVariant">#40FFFFFF</color>
+    <color name="transparent_theme_onSurfaceVariant">#B3FFFFFF</color>
+    <color name="transparent_theme_outline">#8AFFFFFF</color>
+    <color name="transparent_theme_outlineVariant">#33FFFFFF</color>
+    <color name="transparent_theme_scrim">#66000000</color>
+    <color name="transparent_theme_inverseSurface">#FFF9EC</color>
+    <color name="transparent_theme_inverseOnSurface">#1E1C13</color>
+    <color name="transparent_theme_inversePrimary">#A0FFFFFF</color>
+    <color name="transparent_theme_primaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimaryFixed">#000000</color>
+    <color name="transparent_theme_primaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_secondaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onSecondaryFixed">#000000</color>
+    <color name="transparent_theme_secondaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onSecondaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_tertiaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onTertiaryFixed">#000000</color>
+    <color name="transparent_theme_tertiaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onTertiaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_surfaceDim">#1AFFFFFF</color>
+    <color name="transparent_theme_surfaceBright">#33FFFFFF</color>
+    <color name="transparent_theme_surfaceContainerLowest">#0DFFFFFF</color>
+    <color name="transparent_theme_surfaceContainerLow">#1AFFFFFF</color>
+    <color name="transparent_theme_surfaceContainer">#33FFFFFF</color>
+    <color name="transparent_theme_surfaceContainerHigh">#4DFFFFFF</color>
+    <color name="transparent_theme_surfaceContainerHighest">#66FFFFFF</color>
+
+
     <color name="disabled">@color/md_dark_disabled</color>
 
     <color name="background_prefs">#10303030</color>

+ 1 - 0
app/src/main/res/values/array_values.xml

@@ -33,6 +33,7 @@
         <item>4</item>
         <item>5</item>
         <item>6</item>
+        <item>7</item>
     </string-array>
 
     <string-array name="screen_direction_value">

+ 1 - 0
app/src/main/res/values/arrays.xml

@@ -62,6 +62,7 @@
 		<item>Koharu</item>
 		<item>Yuuka</item>
 		<item>Phoebe</item>
+        <item>透明</item>
 	</string-array>
 
 

+ 4 - 0
app/src/main/res/values/attrs.xml

@@ -246,4 +246,8 @@
         <attr name="min" format="integer" />
     </declare-styleable>
 
+    <declare-styleable name="TipPreference">
+        <attr name="tipText" format="string" />
+    </declare-styleable>
+
 </resources>

+ 48 - 0
app/src/main/res/values/colors.xml

@@ -295,6 +295,54 @@
     <color name="phoebe_theme_surfaceContainerHigh">#EEE8DA</color>
     <color name="phoebe_theme_surfaceContainerHighest">#E8E2D4</color>
 
+    <color name="transparent_theme_primary">#000000</color>
+    <color name="transparent_theme_onPrimary">#FFFFFFFF</color>
+    <color name="transparent_theme_primaryContainer">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimaryContainer">#FF000000</color>
+    <color name="transparent_theme_secondary">#A0FFFFFF</color>
+    <color name="transparent_theme_onSecondary">#FF000000</color>
+    <color name="transparent_theme_secondaryContainer">#80FFFFFF</color>
+    <color name="transparent_theme_onSecondaryContainer">#FF000000</color>
+    <color name="transparent_theme_tertiary">#A0FFFFFF</color>
+    <color name="transparent_theme_onTertiary">#FF000000</color>
+    <color name="transparent_theme_tertiaryContainer">#80FFFFFF</color>
+    <color name="transparent_theme_onTertiaryContainer">#FF000000</color>
+    <color name="transparent_theme_error">#BA1A1A</color>
+    <color name="transparent_theme_onError">#FFFFFFFF</color>
+    <color name="transparent_theme_errorContainer">#FFDAD6</color>
+    <color name="transparent_theme_onErrorContainer">#93000A</color>
+    <color name="transparent_theme_background">#00FFFFFF</color>
+    <color name="transparent_theme_onBackground">#1E1C13</color>
+    <color name="transparent_theme_surface">#00FFFFFF</color>
+    <color name="transparent_theme_onSurface">#1E1C13</color>
+    <color name="transparent_theme_surfaceVariant">#1A000000</color>
+    <color name="transparent_theme_onSurfaceVariant">#80000000</color>
+    <color name="transparent_theme_outline">#7C7768</color>
+    <color name="transparent_theme_outlineVariant">#CCC6B4</color>
+    <color name="transparent_theme_scrim">#33000000</color>
+    <color name="transparent_theme_inverseSurface">#333027</color>
+    <color name="transparent_theme_inverseOnSurface">#F6F0E2</color>
+    <color name="transparent_theme_inversePrimary">#A0FFFFFF</color>
+    <color name="transparent_theme_primaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimaryFixed">#211B00</color>
+    <color name="transparent_theme_primaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onPrimaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_secondaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onSecondaryFixed">#000000</color>
+    <color name="transparent_theme_secondaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onSecondaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_tertiaryFixed">#A0FFFFFF</color>
+    <color name="transparent_theme_onTertiaryFixed">#000000</color>
+    <color name="transparent_theme_tertiaryFixedDim">#A0FFFFFF</color>
+    <color name="transparent_theme_onTertiaryFixedVariant">#A0FFFFFF</color>
+    <color name="transparent_theme_surfaceDim">#1AFFFFFF</color>
+    <color name="transparent_theme_surfaceBright">#33FFFFFF</color>
+    <color name="transparent_theme_surfaceContainerLowest">#0DFFFFFF</color>
+    <color name="transparent_theme_surfaceContainerLow">#1AFFFFFF</color>
+    <color name="transparent_theme_surfaceContainer">#33FFFFFF</color>
+    <color name="transparent_theme_surfaceContainerHigh">#4DFFFFFF</color>
+    <color name="transparent_theme_surfaceContainerHighest">#66FFFFFF</color>
+
     <color name="disabled">@color/md_light_disabled</color>
 
     <color name="divider">#66666666</color>

+ 55 - 2
app/src/main/res/values/themes.xml

@@ -4,10 +4,63 @@
 
     <!-- 透明主题 -->
     <style name="AppTheme.Transparent" parent="Base.AppTheme">
-        <item name="android:windowIsTranslucent">true</item>
-        <item name="android:windowBackground">@android:color/transparent</item>
+
+
+        <item name="colorPrimary">@color/transparent_theme_primary</item>
+        <item name="colorOnPrimary">@color/transparent_theme_onPrimary</item>
+        <item name="colorPrimaryContainer">@color/transparent_theme_primaryContainer</item>
+        <item name="colorOnPrimaryContainer">@color/transparent_theme_onPrimaryContainer</item>
+        <item name="colorSecondary">@color/transparent_theme_secondary</item>
+        <item name="colorOnSecondary">@color/transparent_theme_onSecondary</item>
+        <item name="colorSecondaryContainer">@color/transparent_theme_secondaryContainer</item>
+        <item name="colorOnSecondaryContainer">@color/transparent_theme_onSecondaryContainer</item>
+        <item name="colorTertiary">@color/transparent_theme_tertiary</item>
+        <item name="colorOnTertiary">@color/transparent_theme_onTertiary</item>
+        <item name="colorTertiaryContainer">@color/transparent_theme_tertiaryContainer</item>
+        <item name="colorOnTertiaryContainer">@color/transparent_theme_onTertiaryContainer</item>
+        <item name="colorError">@color/transparent_theme_error</item>
+        <item name="colorOnError">@color/transparent_theme_onError</item>
+        <item name="colorErrorContainer">@color/transparent_theme_errorContainer</item>
+        <item name="colorOnErrorContainer">@color/transparent_theme_onErrorContainer</item>
+        <item name="android:colorBackground">@color/transparent_theme_background</item>
+        <item name="android:textColor">@color/transparent_theme_onSurface</item>
+        <item name="colorOnBackground">@color/transparent_theme_onBackground</item>
+        <item name="colorSurface">@color/transparent_theme_surface</item>
+        <item name="colorOnSurface">@color/transparent_theme_onSurface</item>
+        <item name="colorSurfaceVariant">@color/transparent_theme_surfaceVariant</item>
+        <item name="colorOnSurfaceVariant">@color/transparent_theme_onSurfaceVariant</item>
+        <item name="colorOutline">@color/transparent_theme_outline</item>
+        <item name="colorOutlineVariant">@color/transparent_theme_outlineVariant</item>
+        <item name="colorSurfaceInverse">@color/transparent_theme_inverseSurface</item>
+        <item name="colorOnSurfaceInverse">@color/transparent_theme_inverseOnSurface</item>
+        <item name="colorPrimaryInverse">@color/transparent_theme_inversePrimary</item>
+        <item name="colorPrimaryFixed">@color/transparent_theme_primaryFixed</item>
+        <item name="colorOnPrimaryFixed">@color/transparent_theme_onPrimaryFixed</item>
+        <item name="colorPrimaryFixedDim">@color/transparent_theme_primaryFixedDim</item>
+        <item name="colorOnPrimaryFixedVariant">@color/transparent_theme_onPrimaryFixedVariant
+        </item>
+        <item name="colorSecondaryFixed">@color/transparent_theme_secondaryFixed</item>
+        <item name="colorOnSecondaryFixed">@color/transparent_theme_onSecondaryFixed</item>
+        <item name="colorSecondaryFixedDim">@color/transparent_theme_secondaryFixedDim</item>
+        <item name="colorOnSecondaryFixedVariant">@color/transparent_theme_onSecondaryFixedVariant
+        </item>
+        <item name="colorTertiaryFixed">@color/transparent_theme_tertiaryFixed</item>
+        <item name="colorOnTertiaryFixed">@color/transparent_theme_onTertiaryFixed</item>
+        <item name="colorTertiaryFixedDim">@color/transparent_theme_tertiaryFixedDim</item>
+        <item name="colorOnTertiaryFixedVariant">@color/transparent_theme_onTertiaryFixedVariant
+        </item>
+        <item name="colorSurfaceDim">@color/transparent_theme_surfaceDim</item>
+        <item name="colorSurfaceBright">@color/transparent_theme_surfaceBright</item>
+        <item name="colorSurfaceContainerLowest">@color/transparent_theme_surfaceContainerLowest
+        </item>
+        <item name="colorSurfaceContainerLow">@color/transparent_theme_surfaceContainerLow</item>
+        <item name="colorSurfaceContainer">@color/transparent_theme_surfaceContainer</item>
+        <item name="colorSurfaceContainerHigh">@color/transparent_theme_surfaceContainerHigh</item>
+        <item name="colorSurfaceContainerHighest">@color/transparent_theme_surfaceContainerHighest
+        </item>
     </style>
 
+
     <style name="Base.AppTheme" parent="Theme.Material3Expressive.DynamicColors.DayNight.NoActionBar">
         <item name="android:windowDrawsSystemBarBackgrounds">true</item>
         <item name="android:windowLightStatusBar">true</item>

+ 7 - 3
app/src/main/res/xml/pref_config_theme.xml

@@ -14,9 +14,7 @@
             android:defaultValue="0"
             android:entries="@array/theme_mode"
             android:entryValues="@array/theme_mode_v"
-            android:key="themeMode"
-            android:title="@string/theme_mode"
-            android:summary="切换浅色/深色/跟随系统" />
+            android:key="themeMode" />
 
         <io.legato.kazusa.lib.prefs.ThemeCardPreference
             android:key="app_theme"
@@ -26,6 +24,12 @@
             android:entryValues="@array/themes_value"
             android:defaultValue="0" />
 
+        <io.legato.kazusa.lib.prefs.TipPreference
+            android:key="theme_tip"
+            android:selectable="false"
+            app:iconSpaceReserved="false"
+            app:tipText="透明主题请于设置背景图片后设置" />
+
         <io.legato.kazusa.lib.prefs.IconListPreference
             android:defaultValue="ic_launcher"
             android:entries="@array/icon_names"

+ 1 - 1
build.gradle

@@ -2,7 +2,7 @@
 
 buildscript {
     ext{
-        compile_sdk_version = 35
+        compile_sdk_version = 36
         build_tool_version = '34.0.0'
 //        kotlin_version = '1.9.22'
 //        ksp_version = "1.0.17"