mirror of
https://github.com/fcitx5-android/fcitx5-android.git
synced 2026-08-02 20:16:06 +08:00
Make Theme.Monet able to export (#719)
This commit is contained in:
parent
e414817d01
commit
81e04ec06b
@ -323,5 +323,33 @@ sealed class Theme : Parcelable {
|
||||
genericActiveBackgroundColor = primary,
|
||||
genericActiveForegroundColor = onPrimary
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
fun toCustom() = Custom(
|
||||
name = name + "#" + this.accentKeyBackgroundColor.toHexString(), // Use primary color as identifier
|
||||
isDark = isDark,
|
||||
backgroundImage = null,
|
||||
backgroundColor = backgroundColor,
|
||||
barColor = barColor,
|
||||
keyboardColor = keyboardColor,
|
||||
keyBackgroundColor = keyBackgroundColor,
|
||||
keyTextColor = keyTextColor,
|
||||
candidateTextColor = candidateTextColor,
|
||||
candidateLabelColor = candidateLabelColor,
|
||||
candidateCommentColor = candidateCommentColor,
|
||||
altKeyBackgroundColor = altKeyBackgroundColor,
|
||||
altKeyTextColor = altKeyTextColor,
|
||||
accentKeyBackgroundColor = accentKeyBackgroundColor,
|
||||
accentKeyTextColor = accentKeyTextColor,
|
||||
keyPressHighlightColor = keyPressHighlightColor,
|
||||
keyShadowColor = keyShadowColor,
|
||||
popupBackgroundColor = popupBackgroundColor,
|
||||
popupTextColor = popupTextColor,
|
||||
spaceBarColor = spaceBarColor,
|
||||
dividerColor = dividerColor,
|
||||
clipboardEntryColor = clipboardEntryColor,
|
||||
genericActiveBackgroundColor = genericActiveBackgroundColor,
|
||||
genericActiveForegroundColor = genericActiveForegroundColor
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -127,6 +127,9 @@ abstract class ThemeListAdapter : RecyclerView.Adapter<ThemeListAdapter.ViewHold
|
||||
if (theme is Theme.Custom) {
|
||||
onExportTheme(theme)
|
||||
true
|
||||
} else if (theme is Theme.Monet) {
|
||||
onExportTheme(theme.toCustom())
|
||||
true
|
||||
} else false
|
||||
}
|
||||
editButton.setOnClickListener {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user