Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,23 @@ public static Colors getThemeColors(final String themeColors, final String theme
case THEME_USER:
final int accent = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_ACCENT_SUFFIX, false);
final int keyBgColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_KEYS_SUFFIX, false);
final int functionalKeyBgColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_FUNCTIONAL_KEYS_SUFFIX, false);
final int spaceBarBgColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_SPACEBAR_SUFFIX, false);
final int keyTextColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_TEXT_SUFFIX, false);
final int hintTextColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_HINT_TEXT_SUFFIX, false);
final int spaceBarTextColor = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_SPACEBAR_TEXT_SUFFIX, false);
final int background = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_BACKGROUND_SUFFIX, false);
return new Colors(themeStyle, hasBorders, accent, background, keyBgColor, ColorUtilKt.brightenOrDarken(keyBgColor, true), keyBgColor, keyTextColor, hintTextColor);
return new Colors(themeStyle, hasBorders, accent, background, keyBgColor, functionalKeyBgColor, spaceBarBgColor, keyTextColor, hintTextColor, spaceBarTextColor);
case THEME_USER_NIGHT:
final int accent2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_ACCENT_SUFFIX, true);
final int keyBgColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_KEYS_SUFFIX, true);
final int functionalKeyBgColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_FUNCTIONAL_KEYS_SUFFIX, true);
final int spaceBarBgColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_SPACEBAR_SUFFIX, true);
final int keyTextColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_TEXT_SUFFIX, true);
final int hintTextColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_HINT_TEXT_SUFFIX, true);
final int spaceBarTextColor2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_SPACEBAR_TEXT_SUFFIX, true);
final int background2 = Settings.readUserColor(prefs, context, Settings.PREF_COLOR_BACKGROUND_SUFFIX, true);
return new Colors(themeStyle, hasBorders, accent2, background2, keyBgColor2, ColorUtilKt.brightenOrDarken(keyBgColor2, true), keyBgColor2, keyTextColor2, hintTextColor2);
return new Colors(themeStyle, hasBorders, accent2, background2, keyBgColor2, functionalKeyBgColor2, spaceBarBgColor2, keyTextColor2, hintTextColor2, spaceBarTextColor2);
case THEME_DARK:
return new Colors(
themeStyle,
Expand All @@ -156,7 +162,8 @@ public static Colors getThemeColors(final String themeColors, final String theme
Color.parseColor("#2d393f"),
Color.parseColor("#364248"),
ContextCompat.getColor(context, R.color.key_text_color_lxx_dark),
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark)
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark),
ContextCompat.getColor(context, R.color.spacebar_letter_color_lxx_dark)
);
case THEME_HOLO_WHITE:
return new Colors(
Expand All @@ -169,6 +176,7 @@ public static Colors getThemeColors(final String themeColors, final String theme
Color.parseColor("#444444"), // should be 222222, but the key drawable is already grey
Color.parseColor("#FFFFFF"),
Color.parseColor("#FFFFFF"),
Color.parseColor("#282828"),
Color.parseColor("#282828")
);
case THEME_DARKER:
Expand All @@ -181,7 +189,8 @@ public static Colors getThemeColors(final String themeColors, final String theme
ContextCompat.getColor(context, R.color.key_background_functional_lxx_dark_border),
ContextCompat.getColor(context, R.color.key_background_normal_lxx_dark_border),
ContextCompat.getColor(context, R.color.key_text_color_lxx_dark),
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark)
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark),
ContextCompat.getColor(context, R.color.spacebar_letter_color_lxx_dark)
);
case THEME_BLACK:
return new Colors(
Expand All @@ -193,7 +202,8 @@ public static Colors getThemeColors(final String themeColors, final String theme
ContextCompat.getColor(context, R.color.background_amoled_dark),
ContextCompat.getColor(context, R.color.background_amoled_dark),
ContextCompat.getColor(context, R.color.key_text_color_lxx_dark),
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark)
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_dark),
ContextCompat.getColor(context, R.color.spacebar_letter_color_lxx_dark)
);
case THEME_LIGHT:
default:
Expand All @@ -206,7 +216,8 @@ public static Colors getThemeColors(final String themeColors, final String theme
ContextCompat.getColor(context, R.color.key_background_functional_lxx_light_border),
ContextCompat.getColor(context, R.color.key_background_normal_lxx_light_border),
ContextCompat.getColor(context, R.color.key_text_color_lxx_light),
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_light)
ContextCompat.getColor(context, R.color.key_hint_letter_color_lxx_light),
ContextCompat.getColor(context, R.color.spacebar_letter_color_lxx_light)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class Colors (
val functionalKey: Int,
val spaceBar: Int,
val keyText: Int,
val keyHintText: Int
val keyHintText: Int,
val spaceBarText: Int
) {
val navBar: Int
/** brightened or darkened variant of [background], to be used if exact background color would be
Expand All @@ -45,7 +46,6 @@ class Colors (
val doubleAdjustedBackground: Int
/** brightened or darkened variant of [keyText] */
val adjustedKeyText: Int
val spaceBarText: Int

val backgroundFilter: ColorFilter
val adjustedBackgroundFilter: ColorFilter
Expand Down Expand Up @@ -74,11 +74,9 @@ class Colors (
val darkerBackground = adjustLuminosityAndKeepAlpha(background, -0.2f)
navBar = darkerBackground
keyboardBackground = GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, intArrayOf(background, darkerBackground))
spaceBarText = keyText
} else {
navBar = background
keyboardBackground = null
spaceBarText = keyHintText
}

// create color filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ open class ColorsSettingsFragment : Fragment(R.layout.color_settings) {
private val colorPrefs = listOf(
Settings.PREF_COLOR_BACKGROUND_SUFFIX,
Settings.PREF_COLOR_KEYS_SUFFIX,
Settings.PREF_COLOR_FUNCTIONAL_KEYS_SUFFIX,
Settings.PREF_COLOR_SPACEBAR_SUFFIX,
Settings.PREF_COLOR_TEXT_SUFFIX,
Settings.PREF_COLOR_HINT_TEXT_SUFFIX,
Settings.PREF_COLOR_SPACEBAR_TEXT_SUFFIX,
Settings.PREF_COLOR_ACCENT_SUFFIX,
)

Expand Down Expand Up @@ -65,8 +68,11 @@ open class ColorsSettingsFragment : Fragment(R.layout.color_settings) {
val colorPrefNames = listOf(
R.string.select_color_background,
R.string.select_color_key_background,
R.string.select_color_functional_key_background,
R.string.select_color_spacebar_background,
R.string.select_color_key,
R.string.select_color_key_hint,
R.string.select_color_spacebar_text,
R.string.select_color_accent,
).map { requireContext().getString(it) }
val prefPrefix = if (isNight) Settings.PREF_THEME_USER_COLOR_NIGHT_PREFIX else Settings.PREF_THEME_USER_COLOR_PREFIX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static final String PREF_THEME_USER_COLOR_PREFIX = "theme_color_";
public static final String PREF_THEME_USER_COLOR_NIGHT_PREFIX = "theme_dark_color_";
public static final String PREF_COLOR_KEYS_SUFFIX = "keys";
public static final String PREF_COLOR_FUNCTIONAL_KEYS_SUFFIX = "functional_keys";
public static final String PREF_COLOR_SPACEBAR_SUFFIX = "spacebar";
public static final String PREF_COLOR_SPACEBAR_TEXT_SUFFIX = "spacebar_text";
public static final String PREF_COLOR_ACCENT_SUFFIX = "accent";
public static final String PREF_COLOR_TEXT_SUFFIX = "text";
public static final String PREF_COLOR_HINT_TEXT_SUFFIX = "hint_text";
Expand Down Expand Up @@ -511,9 +514,16 @@ private static int determineAutoColor(final SharedPreferences prefs, final Conte
else return Color.WHITE;
case PREF_COLOR_HINT_TEXT_SUFFIX:
if (ColorUtilKt.isBrightColor(readUserColor(prefs, context, PREF_COLOR_KEYS_SUFFIX, isNight))) return Color.DKGRAY;
else return Color.LTGRAY;
else return readUserColor(prefs, context, PREF_COLOR_TEXT_SUFFIX, isNight);
case PREF_COLOR_KEYS_SUFFIX:
return ColorUtilKt.brightenOrDarken(readUserColor(prefs, context, PREF_COLOR_BACKGROUND_SUFFIX, isNight), isNight);
case PREF_COLOR_FUNCTIONAL_KEYS_SUFFIX:
return ColorUtilKt.brightenOrDarken(readUserColor(prefs, context, PREF_COLOR_KEYS_SUFFIX, isNight), true);
case PREF_COLOR_SPACEBAR_SUFFIX:
return readUserColor(prefs, context, PREF_COLOR_KEYS_SUFFIX, isNight);
case PREF_COLOR_SPACEBAR_TEXT_SUFFIX:
if (ColorUtilKt.isBrightColor(readUserColor(prefs, context, PREF_COLOR_SPACEBAR_SUFFIX, isNight))) return Color.DKGRAY;
else return readUserColor(prefs, context, PREF_COLOR_TEXT_SUFFIX, isNight);
case PREF_COLOR_BACKGROUND_SUFFIX:
default:
return ContextCompat.getColor(getDayNightContext(context, isNight), R.color.keyboard_background);
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ Nouveau dictionnaire:
<string name="select_color_key">Texte des touches</string>
<string name="select_color_key_hint">Indice des touches</string>
<string name="select_color_key_background">Arrière-plan des touches</string>
<string name="select_color_functional_key_background">Arrière-plan des touches fonctionnelles</string>
<string name="select_color_spacebar_background">Arrière-plan de la barre d\'espace</string>
<string name="select_color_spacebar_text">Texte de la barre d\'espace</string>
<string name="select_color_accent">Couleur d\'accentuation</string>
<string name="settings_screen_about">À propos</string>
<string name="about_github_link" >Lien vers GitHub</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@

<!-- Color resources for the old LXX_Light theme, now used for THEME_LIGHT. -->
<color name="key_hint_letter_color_lxx_light">#B337474F</color>
<color name="spacebar_letter_color_lxx_light">#B337474F</color>
<color name="key_text_color_lxx_light">#37474F</color>

<!-- Color resources for the old LXX_Dark theme, now used for several dark themes. -->
<color name="key_text_color_lxx_dark">#FFFFFF</color>
<color name="key_hint_letter_color_lxx_dark">#80FFFFFF</color>
<color name="spacebar_letter_color_lxx_dark">#80FFFFFF</color>

<!-- Color resources for the old LXX_Dark_Border theme, now for THEME_DARKER. -->
<color name="keyboard_background_lxx_dark_border">#0d0d0d</color>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,12 @@ New dictionary:
<string name="select_color_key_hint">Key hint text</string>
<!-- Selection: key color. -->
<string name="select_color_key_background">Key background</string>
<!-- Selection: functional key color. -->
<string name="select_color_functional_key_background">Functional key background</string>
<!-- Selection: space bar color. -->
<string name="select_color_spacebar_background">Space bar background</string>
<!-- Selection: space bar text color. -->
<string name="select_color_spacebar_text">Space bar text</string>
<!-- Selection: accent color. -->
<string name="select_color_accent">Accent</string>
<!-- Settings screen title for about [CHAR LIMIT=33]-->
Expand Down