更新TargetSDK至36

更新部分界面
添加透明主题
This commit is contained in:
HapeLee committed 2025-07-30 02:14:14 +08:00
1 parent c2353c9e71
commit 22f34161ab
21 files changed
+310 -59

No files matched your search

@@ -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> {
@@ -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()
}
}