Change preference name

This commit is contained in:
Rocka 2025-10-22 01:13:10 +08:00
parent bd645da624
commit 277e42eba3
No known key found for this signature in database
GPG Key ID: 28031158FFDD6853
3 changed files with 10 additions and 6 deletions

View File

@ -36,7 +36,10 @@ class ThemePrefs(sharedPreferences: SharedPreferences) :
val keyBorder = switch(R.string.key_border, "key_border", false)
val keySolidBorder = switch(R.string.key_solid_border, "key_solid_border", false)
val keyBorderStroke = switch(
R.string.key_border_stroke, "key_border_stroke", false,
enableUiOn = { keyBorder.getValue() }
)
val keyRippleEffect = switch(R.string.key_ripple_effect, "key_ripple_effect", false)

View File

@ -55,8 +55,8 @@ abstract class KeyView(ctx: Context, val theme: Theme, val def: KeyDef.Appearanc
CustomGestureView(ctx) {
val bordered: Boolean
val borderStroke: Boolean
val rippled: Boolean
val solidBordered: Boolean
val radius: Float
val hMargin: Int
val vMargin: Int
@ -64,8 +64,8 @@ abstract class KeyView(ctx: Context, val theme: Theme, val def: KeyDef.Appearanc
init {
val prefs = ThemeManager.prefs
bordered = prefs.keyBorder.getValue()
borderStroke = prefs.keyBorderStroke.getValue()
rippled = prefs.keyRippleEffect.getValue()
solidBordered = prefs.keySolidBorder.getValue()
radius = dp(prefs.keyRadius.getValue().toFloat())
val landscape = resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE
val hMarginPref =
@ -126,12 +126,13 @@ abstract class KeyView(ctx: Context, val theme: Theme, val def: KeyDef.Appearanc
}
val borderOrShadowWidth = dp(1)
// background: key border
appearanceView.background = if (solidBordered) borderedKeyBackgroundDrawable(
appearanceView.background = if (borderStroke) borderedKeyBackgroundDrawable(
bkgColor, theme.keyShadowColor,
radius, borderOrShadowWidth, hMargin, vMargin
) else shadowedKeyBackgroundDrawable(
bkgColor, theme.keyShadowColor,
radius, borderOrShadowWidth, hMargin, vMargin)
radius, borderOrShadowWidth, hMargin, vMargin
)
// foreground: press highlight or ripple
setupPressHighlight()
} else {

View File

@ -315,5 +315,5 @@
<string name="emoji_skin_tone_type_5">🏾 Type-5</string>
<string name="emoji_skin_tone_type_6">🏿 Type-6</string>
<string name="hide_unsupported_emojis">Hide unsupported Emojis</string>
<string name="key_solid_border">Enable solid border instead of shadow</string>
<string name="key_border_stroke">Enable stroke for key border</string>
</resources>