am 437be2d5: Refactor Emoji tab indicators to refer keyboard theme

* commit '437be2d5c4ee60f9c880369985eadde4a3a22957':
  Refactor Emoji tab indicators to refer keyboard theme
main
Tadashi G. Takaoka 2014-05-19 16:46:35 +00:00 committed by Android Git Automerger
commit ce63defaf8
29 changed files with 72 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 B

View File

@ -41,11 +41,9 @@
android:id="@android:id/tabs" android:id="@android:id/tabs"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/emoji_category_tab_selected_holo_dark"
android:divider="@null" android:divider="@null"
android:tabStripEnabled="true" android:tabStripEnabled="true"
android:tabStripLeft="@drawable/emoji_category_tab_unselected_holo_dark" style="?attr/emojiTabWidgetStyle" />
android:tabStripRight="@drawable/emoji_category_tab_unselected_holo_dark" />
<FrameLayout <FrameLayout
android:id="@android:id/tabcontent" android:id="@android:id/tabcontent"
android:layout_width="0dip" android:layout_width="0dip"
@ -79,8 +77,8 @@
<com.android.inputmethod.keyboard.emoji.EmojiCategoryPageIndicatorView <com.android.inputmethod.keyboard.emoji.EmojiCategoryPageIndicatorView
android:id="@+id/emoji_category_page_id_view" android:id="@+id/emoji_category_page_id_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="2dip"
android:background="@color/emoji_category_page_id_background_holo" /> style="?attr/emojiCategoryPageIndicatorViewStyle" />
<LinearLayout <LinearLayout
android:id="@+id/emoji_action_bar" android:id="@+id/emoji_action_bar"
android:orientation="horizontal" android:orientation="horizontal"

View File

@ -30,6 +30,10 @@
<attr name="keyPreviewTextViewStyle" format="reference"/> <attr name="keyPreviewTextViewStyle" format="reference"/>
<!-- EmojiPalettesView style --> <!-- EmojiPalettesView style -->
<attr name="emojiPalettesViewStyle" format="reference" /> <attr name="emojiPalettesViewStyle" format="reference" />
<!-- TabWidget of EmojiPlettesView style -->
<attr name="emojiTabWidgetStyle" format="reference" />
<!-- EmojiCategoryPageIndicatorView style -->
<attr name="emojiCategoryPageIndicatorViewStyle" format="reference" />
<!-- MoreKeysKeyboard style --> <!-- MoreKeysKeyboard style -->
<attr name="moreKeysKeyboardStyle" format="reference" /> <attr name="moreKeysKeyboardStyle" format="reference" />
<!-- MoreKeysKeyboardView style --> <!-- MoreKeysKeyboardView style -->
@ -181,6 +185,10 @@
<attr name="iconEmojiCategory6Tab" format="reference" /> <attr name="iconEmojiCategory6Tab" format="reference" />
</declare-styleable> </declare-styleable>
<declare-styleable name="EmojiCategoryPageIndicatorView">
<attr name="emojiCategoryPageIndicatorColor" format="color" />
</declare-styleable>
<declare-styleable name="SuggestionStripView"> <declare-styleable name="SuggestionStripView">
<attr name="suggestionStripOptions" format="integer"> <attr name="suggestionStripOptions" format="integer">
<!-- This should be aligned with SuggestionStripLayoutHelper.AUTO_CORRECT_* and etc. --> <!-- This should be aligned with SuggestionStripLayoutHelper.AUTO_CORRECT_* and etc. -->

View File

@ -34,6 +34,7 @@
<color name="spacebar_text_color_holo">#FFC0C0C0</color> <color name="spacebar_text_color_holo">#FFC0C0C0</color>
<color name="spacebar_text_shadow_color_holo">#80000000</color> <color name="spacebar_text_shadow_color_holo">#80000000</color>
<color name="gesture_floating_preview_color_holo">#C0000000</color> <color name="gesture_floating_preview_color_holo">#C0000000</color>
<color name="emoji_tab_page_indicator_background_holo">#111111</color>
<!-- Color resources for KLP theme. Base color = F0F0F0 --> <!-- Color resources for KLP theme. Base color = F0F0F0 -->
<color name="highlight_color_klp">#FFF0F0F0</color> <color name="highlight_color_klp">#FFF0F0F0</color>
<color name="typed_word_color_klp">#D8F0F0F0</color> <color name="typed_word_color_klp">#D8F0F0F0</color>
@ -53,12 +54,11 @@
<color name="suggestions_strip_background_lxx_dark">#263238</color> <color name="suggestions_strip_background_lxx_dark">#263238</color>
<color name="suggested_word_background_selected_lxx_dark">#384248</color> <color name="suggested_word_background_selected_lxx_dark">#384248</color>
<color name="gesture_floating_preview_color_lxx_dark">#C0000000</color> <color name="gesture_floating_preview_color_lxx_dark">#C0000000</color>
<color name="emoji_tab_page_indicator_background_lxx_dark">#263238</color>
<!-- Color resources for setup wizard and tutorial --> <!-- Color resources for setup wizard and tutorial -->
<color name="setup_background">#FFEBEBEB</color> <color name="setup_background">#FFEBEBEB</color>
<color name="setup_text_dark">#FF707070</color> <color name="setup_text_dark">#FF707070</color>
<color name="setup_text_action">@android:color/holo_blue_light</color> <color name="setup_text_action">@android:color/holo_blue_light</color>
<color name="setup_step_background">@android:color/background_light</color> <color name="setup_step_background">@android:color/background_light</color>
<color name="setup_welcome_video_margin_color">#FFCCCCCC</color> <color name="setup_welcome_video_margin_color">#FFCCCCCC</color>
<color name="emoji_category_page_id_background_holo">#FF000000</color>
<color name="emoji_category_page_id_foreground_holo">#80FFFFFF</color>
</resources> </resources>

View File

@ -110,6 +110,8 @@
<!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it, <!-- Though {@link EmojiPalettesView} doesn't extend {@link KeyboardView}, some views inside it,
for instance delete button, need themed {@link KeyboardView} attributes. --> for instance delete button, need themed {@link KeyboardView} attributes. -->
<style name="EmojiPalettesView" /> <style name="EmojiPalettesView" />
<style name="EmojiTabWidget" />
<style name="EmojiCategoryPageIndicatorView" />
<style name="MoreKeysKeyboard" /> <style name="MoreKeysKeyboard" />
<style <style
name="MoreKeysKeyboardView" name="MoreKeysKeyboardView"

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.ICS</item> <item name="mainKeyboardViewStyle">@style/MainKeyboardView.ICS</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.ICS</item> <item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.ICS</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.ICS</item> <item name="emojiPalettesViewStyle">@style/EmojiPalettesView.ICS</item>
<item name="emojiTabWidgetStyle">@style/EmojiTabWidget.ICS</item>
<item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.ICS</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.ICS</item> <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.ICS</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.ICS</item> <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.ICS</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.ICS</item> <item name="suggestionStripViewStyle">@style/SuggestionStripView.ICS</item>
@ -95,6 +97,15 @@
<item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item> <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
<item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item> <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</style> </style>
<style name="EmojiCategoryPageIndicatorView.ICS">
<item name="android:background">@color/emoji_tab_page_indicator_background_holo</item>
<item name="emojiCategoryPageIndicatorColor">@color/highlight_color_ics</item>
</style>
<style name="EmojiTabWidget.ICS">
<item name="android:background">@drawable/emoji_category_tab_selected_ics</item>
<item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_holo_dark</item>
<item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_holo_dark</item>
</style>
<style <style
name="MoreKeysKeyboard.ICS" name="MoreKeysKeyboard.ICS"
parent="Keyboard.ICS" parent="Keyboard.ICS"

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.KLP</item> <item name="mainKeyboardViewStyle">@style/MainKeyboardView.KLP</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.KLP</item> <item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.KLP</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.KLP</item> <item name="emojiPalettesViewStyle">@style/EmojiPalettesView.KLP</item>
<item name="emojiTabWidgetStyle">@style/EmojiTabWidget.KLP</item>
<item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.KLP</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.KLP</item> <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.KLP</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.KLP</item> <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.KLP</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.KLP</item> <item name="suggestionStripViewStyle">@style/SuggestionStripView.KLP</item>
@ -95,6 +97,15 @@
<item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item> <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
<item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item> <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</style> </style>
<style name="EmojiCategoryPageIndicatorView.KLP">
<item name="android:background">@color/emoji_tab_page_indicator_background_holo</item>
<item name="emojiCategoryPageIndicatorColor">@color/highlight_color_klp</item>
</style>
<style name="EmojiTabWidget.KLP">
<item name="android:background">@drawable/emoji_category_tab_selected_klp</item>
<item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_holo_dark</item>
<item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_holo_dark</item>
</style>
<style <style
name="MoreKeysKeyboard.KLP" name="MoreKeysKeyboard.KLP"
parent="Keyboard.KLP" parent="Keyboard.KLP"

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.LXX_Dark</item> <item name="mainKeyboardViewStyle">@style/MainKeyboardView.LXX_Dark</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.LXX_Dark</item> <item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.LXX_Dark</item>
<item name="emojiPalettesViewStyle">@style/EmojiPalettesView.LXX_Dark</item> <item name="emojiPalettesViewStyle">@style/EmojiPalettesView.LXX_Dark</item>
<item name="emojiTabWidgetStyle">@style/EmojiTabWidget.LXX_Dark</item>
<item name="emojiCategoryPageIndicatorViewStyle">@style/EmojiCategoryPageIndicatorView.LXX_Dark</item>
<item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.LXX_Dark</item> <item name="moreKeysKeyboardStyle">@style/MoreKeysKeyboard.LXX_Dark</item>
<item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.LXX_Dark</item> <item name="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.LXX_Dark</item>
<item name="suggestionStripViewStyle">@style/SuggestionStripView.LXX_Dark</item> <item name="suggestionStripViewStyle">@style/SuggestionStripView.LXX_Dark</item>
@ -97,6 +99,15 @@
<item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item> <item name="iconEmojiCategory5Tab">@drawable/ic_emoji_symbols_holo_dark</item>
<item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item> <item name="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</style> </style>
<style name="EmojiCategoryPageIndicatorView.LXX_Dark">
<item name="android:background">@color/emoji_tab_page_indicator_background_lxx_dark</item>
<item name="emojiCategoryPageIndicatorColor">@color/highlight_color_lxx_dark</item>
</style>
<style name="EmojiTabWidget.LXX_Dark">
<item name="android:background">@drawable/emoji_category_tab_selected_lxx_dark</item>
<item name="android:tabStripLeft">@drawable/emoji_category_tab_unselected_lxx_dark</item>
<item name="android:tabStripRight">@drawable/emoji_category_tab_unselected_lxx_dark</item>
</style>
<style <style
name="MoreKeysKeyboard.LXX_Dark" name="MoreKeysKeyboard.LXX_Dark"
parent="Keyboard.LXX_Dark" parent="Keyboard.LXX_Dark"

View File

@ -16,29 +16,36 @@
package com.android.inputmethod.keyboard.emoji; package com.android.inputmethod.keyboard.emoji;
import com.android.inputmethod.latin.R;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.widget.LinearLayout; import android.view.View;
public final class EmojiCategoryPageIndicatorView extends LinearLayout { import com.android.inputmethod.latin.R;
public final class EmojiCategoryPageIndicatorView extends View {
private static final float BOTTOM_MARGIN_RATIO = 1.0f; private static final float BOTTOM_MARGIN_RATIO = 1.0f;
private final Paint mPaint = new Paint(); private final Paint mPaint = new Paint();
private int mCategoryPageSize = 0; private int mCategoryPageSize = 0;
private int mCurrentCategoryPageId = 0; private int mCurrentCategoryPageId = 0;
private float mOffset = 0.0f; private float mOffset = 0.0f;
public EmojiCategoryPageIndicatorView(final Context context) { public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) {
this(context, null /* attrs */); this(context, attrs, R.attr.emojiCategoryPageIndicatorViewStyle);
} }
public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) { public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs,
super(context, attrs); final int defStyle) {
mPaint.setColor(context.getResources().getColor( super(context, attrs, defStyle);
R.color.emoji_category_page_id_foreground_holo)); final TypedArray indicatorViewAttr = context.obtainStyledAttributes(attrs,
R.styleable.EmojiCategoryPageIndicatorView, defStyle,
R.style.EmojiCategoryPageIndicatorView);
final int indicatorColor = indicatorViewAttr.getColor(
R.styleable.EmojiCategoryPageIndicatorView_emojiCategoryPageIndicatorColor, 0);
indicatorViewAttr.recycle();
mPaint.setColor(indicatorColor);
} }
public void setCategoryPageId(final int size, final int id, final float offset) { public void setCategoryPageId(final int size, final int id, final float offset) {

View File

@ -16,14 +16,15 @@
package com.android.inputmethod.keyboard.emoji; package com.android.inputmethod.keyboard.emoji;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.ResourceUtils;
import android.content.res.Resources; import android.content.res.Resources;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.utils.ResourceUtils;
final class EmojiLayoutParams { final class EmojiLayoutParams {
private static final int DEFAULT_KEYBOARD_ROWS = 4; private static final int DEFAULT_KEYBOARD_ROWS = 4;
@ -67,10 +68,10 @@ final class EmojiLayoutParams {
vp.setLayoutParams(lp); vp.setLayoutParams(lp);
} }
public void setCategoryPageIdViewProperties(final LinearLayout ll) { public void setCategoryPageIdViewProperties(final View v) {
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) ll.getLayoutParams(); final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) v.getLayoutParams();
lp.height = mEmojiCategoryPageIdViewHeight; lp.height = mEmojiCategoryPageIdViewHeight;
ll.setLayoutParams(lp); v.setLayoutParams(lp);
} }
public int getActionBarHeight() { public int getActionBarHeight() {