mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 20:16:06 +08:00
Change preference name
This commit is contained in:
parent
bd645da624
commit
277e42eba3
@ -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)
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user