abouttreesummaryrefslogcommitdiff
path: root/res
diff options
context:
space:
mode:
authorJules Aguillon2021-12-28 19:12:50 +0100
committerJules Aguillon2021-12-28 19:12:50 +0100
commit40b1ec63a932606fb432ee81801acf147e9ee70e (patch)
tree8215f0203f449be7b1d2f06199f4ae726e3edd6c /res
parent93704cca0ace3bff31dea5d3841ba185ad89398a (diff)
downloadunexpected-keyboard-40b1ec63a932606fb432ee81801acf147e9ee70e.tar.gz
unexpected-keyboard-40b1ec63a932606fb432ee81801acf147e9ee70e.zip
Use the themes abstraction
Themes replace 'colors.xml' and soon will replace 'dimens.xml'.
Diffstat (limited to 'res')
-rw-r--r--res/layout/emoji_pane.xml4
-rw-r--r--res/layout/keyboard.xml2
-rw-r--r--res/values/colors.xml14
-rw-r--r--res/values/dimens.xml1
-rw-r--r--res/values/styles.xml13
-rw-r--r--res/values/themes.xml35
6 files changed, 48 insertions, 21 deletions
diff --git a/res/layout/emoji_pane.xml b/res/layout/emoji_pane.xml
index 2d249f3..3c58330 100644
--- a/res/layout/emoji_pane.xml
+++ b/res/layout/emoji_pane.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:hardwareAccelerated="false">
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:hardwareAccelerated="false" android:theme="@style/Dark">
<juloo.keyboard2.EmojiGroupButtonsBar android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"/>
- <juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:background="@color/bg" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height"/>
+ <juloo.keyboard2.EmojiGridView android:id="@+id/emoji_grid" android:background="?attr/colorKeyboard" android:layout_width="fill_parent" android:layout_height="@dimen/emoji_grid_height"/>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" key="switch_back_emoji"/>
<juloo.keyboard2.EmojiKeyButton style="@style/emojiKeyButton" android:layout_weight="4" key="space"/>
diff --git a/res/layout/keyboard.xml b/res/layout/keyboard.xml
index 43b3e47..b15f6d0 100644
--- a/res/layout/keyboard.xml
+++ b/res/layout/keyboard.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
-<juloo.keyboard2.Keyboard2View xmlns:android="http://schemas.android.com/apk/res/android" android:background="@color/bg" android:hardwareAccelerated="false"/>
+<juloo.keyboard2.Keyboard2View xmlns:android="http://schemas.android.com/apk/res/android" android:hardwareAccelerated="false" android:theme="@style/Dark" android:background="?attr/colorKeyboard"/>
diff --git a/res/values/colors.xml b/res/values/colors.xml
deleted file mode 100644
index 63d981b..0000000
--- a/res/values/colors.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <item name="bg" type="color">#1B1B1B</item>
- <item name="key_bg" type="color">#303030</item>
- <item name="key_down_bg" type="color">#1B1B1B</item>
- <item name="key_label" type="color">#FFFFFF</item>
- <item name="key_label_locked" type="color">#229933</item>
- <item name="key_label_activated" type="color">#226b99</item>
- <item name="key_sub_label" type="color">#A0A0A0</item>
- <item name="emoji_button_bg" type="color">#202020</item>
- <item name="emoji_color" type="color">#FFFFFF</item>
- <item name="emoji_key_bg" type="color">@color/emoji_button_bg</item>
- <item name="emoji_key_text" type="color">@color/key_label</item>
-</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a8286cb..0fe54d3 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -12,4 +12,5 @@
<dimen name="sublabel_text_size">12dp</dimen>
<dimen name="emoji_type_button_height">56dp</dimen>
<dimen name="emoji_grid_height">250dp</dimen>
+ <dimen name="emoji_text_size">28dp</dimen>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7dcbb33..bad63e1 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -4,8 +4,8 @@
<item name="android:padding">1px</item>
<item name="android:gravity">center</item>
<item name="android:minHeight">@dimen/label_text_size</item>
- <item name="android:background">@color/emoji_button_bg</item>
- <item name="android:textColor">@color/emoji_key_text</item>
+ <item name="android:background">?attr/emoji_button_bg</item>
+ <item name="android:textColor">?attr/emoji_key_text</item>
<item name="android:textSize">@dimen/label_text_size</item>
</style>
<style name="emojiKeyButton">
@@ -13,8 +13,13 @@
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
<item name="android:padding">0px</item>
- <item name="android:background">@color/emoji_key_bg</item>
- <item name="android:textColor">@color/emoji_key_text</item>
+ <item name="android:background">?attr/emoji_key_bg</item>
+ <item name="android:textColor">?attr/emoji_key_text</item>
<item name="android:textSize">@dimen/label_text_size</item>
</style>
+ <!-- Passed to TextView.setTextAppearance -->
+ <style name="emojiGridButton">
+ <item name="android:textSize">@dimen/emoji_text_size</item>
+ <item name="android:textColor">?attr/emoji_color</item>
+ </style>
</resources>
diff --git a/res/values/themes.xml b/res/values/themes.xml
new file mode 100644
index 0000000..02f97be
--- /dev/null
+++ b/res/values/themes.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <declare-styleable name="keyboard">
+ <!-- The background of the keyboard -->
+ <attr name="colorKeyboard" format="color"/>
+ <!-- Background of the keys -->
+ <attr name="colorKey" format="color"/>
+ <!-- Background of the keys when pressed -->
+ <attr name="colorKeyActivated" format="color"/>
+ <!-- Label colors -->
+ <attr name="colorLabel" format="color"/>
+ <attr name="colorLabelActivated" format="color"/>
+ <attr name="colorLabelLocked" format="color"/>
+ <!-- Corner labels -->
+ <attr name="colorSubLabel" format="color"/>
+ <!-- Emoji panel -->
+ <attr name="emoji_button_bg" type="color" format="color"/>
+ <attr name="emoji_color" type="color" format="color"/>
+ <attr name="emoji_key_bg" type="color" format="color"/>
+ <attr name="emoji_key_text" type="color" format="color"/>
+ </declare-styleable>
+ <style name="Dark">
+ <item name="colorKeyboard">#1B1B1B</item>
+ <item name="colorKey">#303030</item>
+ <item name="colorKeyActivated">#1B1B1B</item>
+ <item name="colorLabel">#FFFFFF</item>
+ <item name="colorLabelActivated">#226b99</item>
+ <item name="colorLabelLocked">#229933</item>
+ <item name="colorSubLabel">#A0A0A0</item>
+ <item name="emoji_button_bg" type="color">#202020</item>
+ <item name="emoji_color" type="color">#FFFFFF</item>
+ <item name="emoji_key_bg" type="color">?attr/emoji_button_bg</item>
+ <item name="emoji_key_text" type="color">?attr/colorLabel</item>
+ </style>
+</resources>