更新TargetSDK至36
更新部分界面 添加透明主题
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user