Add LatinKeyboard.spacebarTextRatio attribute
Bug: 5776979
Change-Id: Ia568d1170ed33a000eb3bb02ecdf611e4b5ff2d5
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index d085644..2e8a003 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -321,10 +321,13 @@
<attr name="parentStyle" format="string" />
</declare-styleable>
+ <!-- Move these attributes to LatinKeyboardView -->
<declare-styleable name="LatinKeyboard">
<attr name="autoCorrectionSpacebarLedEnabled" format="boolean" />
<attr name="autoCorrectionSpacebarLedIcon" format="reference" />
<attr name="disabledShortcutIcon" format="reference" />
+ <!-- Size of the text for spacebar language label, in the proportion of key height. -->
+ <attr name="spacebarTextRatio" format="fraction" />
<attr name="spacebarTextColor" format="color" />
<attr name="spacebarTextShadowColor" format="color" />
</declare-styleable>
diff --git a/java/res/values/config.xml b/java/res/values/config.xml
index 8b99a1f..55f35f0 100644
--- a/java/res/values/config.xml
+++ b/java/res/values/config.xml
@@ -66,7 +66,6 @@
<dimen name="config_touch_noise_threshold_distance">2.0mm</dimen>
<!-- This configuration is the index of the array {@link KeyboardSwitcher.KEYBOARD_THEMES}. -->
<string name="config_default_keyboard_theme_id" translatable="false">5</string>
- <string name="config_text_size_of_language_on_spacebar" translatable="false">small</string>
<integer name="config_max_more_keys_column">5</integer>
<string-array name="auto_correction_threshold_values" translatable="false">
<!-- Off, When auto correction setting is Off, this value is not used. -->
diff --git a/java/res/values/dimens.xml b/java/res/values/dimens.xml
index 352141c..e46ff77 100644
--- a/java/res/values/dimens.xml
+++ b/java/res/values/dimens.xml
@@ -66,6 +66,7 @@
<fraction name="key_hint_label_ratio">44%</fraction>
<fraction name="key_uppercase_letter_ratio">35%</fraction>
<fraction name="key_preview_text_ratio">82%</fraction>
+ <fraction name="spacebar_text_ratio">33.735%</fraction>
<dimen name="key_preview_height">80sp</dimen>
<dimen name="key_preview_offset">0.1in</dimen>
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index 2025a7d..ed8795a 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -33,6 +33,7 @@
</style>
<style name="LatinKeyboard">
<item name="autoCorrectionSpacebarLedEnabled">true</item>
+ <item name="spacebarTextRatio">@fraction/spacebar_text_ratio</item>
<item name="spacebarTextColor">#FFC0C0C0</item>
<item name="spacebarTextShadowColor">#80000000</item>
</style>