Refactor Emoji tab indicators to refer keyboard theme

Bug: 14419121
Change-Id: I7086923fff153039c2d011bbccbfd04eb687a76a
This commit is contained in:
Tadashi G. Takaoka 2014-05-16 10:32:04 +09:00
parent 27ca9f1bf1
commit 437be2d5c4
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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/emoji_category_tab_selected_holo_dark"
android:divider="@null"
android:tabStripEnabled="true"
android:tabStripLeft="@drawable/emoji_category_tab_unselected_holo_dark"
android:tabStripRight="@drawable/emoji_category_tab_unselected_holo_dark" />
style="?attr/emojiTabWidgetStyle" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dip"
@ -79,8 +77,8 @@
<com.android.inputmethod.keyboard.emoji.EmojiCategoryPageIndicatorView
android:id="@+id/emoji_category_page_id_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/emoji_category_page_id_background_holo" />
android:layout_height="2dip"
style="?attr/emojiCategoryPageIndicatorViewStyle" />
<LinearLayout
android:id="@+id/emoji_action_bar"
android:orientation="horizontal"

View File

@ -30,6 +30,10 @@
<attr name="keyPreviewTextViewStyle" format="reference"/>
<!-- EmojiPalettesView style -->
<attr name="emojiPalettesViewStyle" format="reference" />
<!-- TabWidget of EmojiPlettesView style -->
<attr name="emojiTabWidgetStyle" format="reference" />
<!-- EmojiCategoryPageIndicatorView style -->
<attr name="emojiCategoryPageIndicatorViewStyle" format="reference" />
<!-- MoreKeysKeyboard style -->
<attr name="moreKeysKeyboardStyle" format="reference" />
<!-- MoreKeysKeyboardView style -->
@ -181,6 +185,10 @@
<attr name="iconEmojiCategory6Tab" format="reference" />
</declare-styleable>
<declare-styleable name="EmojiCategoryPageIndicatorView">
<attr name="emojiCategoryPageIndicatorColor" format="color" />
</declare-styleable>
<declare-styleable name="SuggestionStripView">
<attr name="suggestionStripOptions" format="integer">
<!-- 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_shadow_color_holo">#80000000</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 name="highlight_color_klp">#FFF0F0F0</color>
<color name="typed_word_color_klp">#D8F0F0F0</color>
@ -53,12 +54,11 @@
<color name="suggestions_strip_background_lxx_dark">#263238</color>
<color name="suggested_word_background_selected_lxx_dark">#384248</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 name="setup_background">#FFEBEBEB</color>
<color name="setup_text_dark">#FF707070</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_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>

View File

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

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.ICS</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.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="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.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="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</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
name="MoreKeysKeyboard.ICS"
parent="Keyboard.ICS"

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.KLP</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.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="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.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="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</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
name="MoreKeysKeyboard.KLP"
parent="Keyboard.KLP"

View File

@ -25,6 +25,8 @@
<item name="mainKeyboardViewStyle">@style/MainKeyboardView.LXX_Dark</item>
<item name="keyPreviewTextViewStyle">@style/KeyPreviewTextView.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="moreKeysKeyboardViewStyle">@style/MoreKeysKeyboardView.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="iconEmojiCategory6Tab">@drawable/ic_emoji_emoticons_holo_dark</item>
</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
name="MoreKeysKeyboard.LXX_Dark"
parent="Keyboard.LXX_Dark"

View File

@ -16,29 +16,36 @@
package com.android.inputmethod.keyboard.emoji;
import com.android.inputmethod.latin.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
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 final Paint mPaint = new Paint();
private int mCategoryPageSize = 0;
private int mCurrentCategoryPageId = 0;
private float mOffset = 0.0f;
public EmojiCategoryPageIndicatorView(final Context context) {
this(context, null /* attrs */);
public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) {
this(context, attrs, R.attr.emojiCategoryPageIndicatorViewStyle);
}
public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs) {
super(context, attrs);
mPaint.setColor(context.getResources().getColor(
R.color.emoji_category_page_id_foreground_holo));
public EmojiCategoryPageIndicatorView(final Context context, final AttributeSet attrs,
final int defStyle) {
super(context, attrs, defStyle);
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) {

View File

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