From 63e6a7031466149a60e0f38fa36be5f6238e08f8 Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Sat, 4 Apr 2015 21:48:01 +0200 Subject: [PATCH] Modify indicator: Larger text size, thinner indicator, no shadow. --- .../yaaic/fragment/ConversationFragment.java | 4 ---- .../org/yaaic/view/ConversationTabLayout.java | 7 +------ .../java/org/yaaic/view/SlidingTabStrip.java | 19 +------------------ 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/org/yaaic/fragment/ConversationFragment.java b/app/src/main/java/org/yaaic/fragment/ConversationFragment.java index db19fcf..1b87faf 100644 --- a/app/src/main/java/org/yaaic/fragment/ConversationFragment.java +++ b/app/src/main/java/org/yaaic/fragment/ConversationFragment.java @@ -21,7 +21,6 @@ along with Yaaic. If not, see . */ package org.yaaic.fragment; -import android.app.ActionBar; import android.app.Activity; import android.app.AlertDialog; import android.app.Fragment; @@ -37,12 +36,9 @@ import android.os.Handler; import android.os.IBinder; import android.speech.RecognizerIntent; import android.support.v4.view.ViewPager; -import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.text.InputType; import android.text.method.TextKeyListener; -import android.util.Log; -import android.util.TypedValue; import android.view.Gravity; import android.view.KeyEvent; import android.view.LayoutInflater; diff --git a/app/src/main/java/org/yaaic/view/ConversationTabLayout.java b/app/src/main/java/org/yaaic/view/ConversationTabLayout.java index 9eb49e9..6137e7a 100644 --- a/app/src/main/java/org/yaaic/view/ConversationTabLayout.java +++ b/app/src/main/java/org/yaaic/view/ConversationTabLayout.java @@ -75,7 +75,7 @@ public class ConversationTabLayout extends HorizontalScrollView { private static final int TITLE_OFFSET_DIPS = 24; private static final int TAB_VIEW_PADDING_DIPS = 16; - private static final int TAB_VIEW_TEXT_SIZE_SP = 12; + private static final int TAB_VIEW_TEXT_SIZE_SP = 18; private int mTitleOffset; @@ -197,11 +197,6 @@ public class ConversationTabLayout extends HorizontalScrollView { textView.setBackgroundResource(outValue.resourceId); } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - // If we're running on ICS or newer, enable all-caps to match the Action Bar tab style - textView.setAllCaps(true); - } - int padding = (int) (TAB_VIEW_PADDING_DIPS * getResources().getDisplayMetrics().density); textView.setPadding(padding, padding, padding, padding); diff --git a/app/src/main/java/org/yaaic/view/SlidingTabStrip.java b/app/src/main/java/org/yaaic/view/SlidingTabStrip.java index d1ece83..78e946a 100644 --- a/app/src/main/java/org/yaaic/view/SlidingTabStrip.java +++ b/app/src/main/java/org/yaaic/view/SlidingTabStrip.java @@ -28,23 +28,16 @@ import android.widget.LinearLayout; class SlidingTabStrip extends LinearLayout { - private static final int DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS = 2; - private static final byte DEFAULT_BOTTOM_BORDER_COLOR_ALPHA = 0x26; - private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 8; + private static final int SELECTED_INDICATOR_THICKNESS_DIPS = 4; private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5; private static final int DEFAULT_DIVIDER_THICKNESS_DIPS = 1; private static final byte DEFAULT_DIVIDER_COLOR_ALPHA = 0x20; private static final float DEFAULT_DIVIDER_HEIGHT = 0.5f; - private final int mBottomBorderThickness; - private final Paint mBottomBorderPaint; - private final int mSelectedIndicatorThickness; private final Paint mSelectedIndicatorPaint; - private final int mDefaultBottomBorderColor; - private final Paint mDividerPaint; private final float mDividerHeight; @@ -68,18 +61,11 @@ class SlidingTabStrip extends LinearLayout { context.getTheme().resolveAttribute(R.attr.colorForeground, outValue, true); final int themeForegroundColor = outValue.data; - mDefaultBottomBorderColor = setColorAlpha(themeForegroundColor, - DEFAULT_BOTTOM_BORDER_COLOR_ALPHA); - mDefaultTabColorizer = new SimpleTabColorizer(); mDefaultTabColorizer.setIndicatorColors(DEFAULT_SELECTED_INDICATOR_COLOR); mDefaultTabColorizer.setDividerColors(setColorAlpha(themeForegroundColor, DEFAULT_DIVIDER_COLOR_ALPHA)); - mBottomBorderThickness = (int) (DEFAULT_BOTTOM_BORDER_THICKNESS_DIPS * density); - mBottomBorderPaint = new Paint(); - mBottomBorderPaint.setColor(mDefaultBottomBorderColor); - mSelectedIndicatorThickness = (int) (SELECTED_INDICATOR_THICKNESS_DIPS * density); mSelectedIndicatorPaint = new Paint(); @@ -149,9 +135,6 @@ class SlidingTabStrip extends LinearLayout { height, mSelectedIndicatorPaint); } - // Thin underline along the entire bottom edge - canvas.drawRect(0, height - mBottomBorderThickness, getWidth(), height, mBottomBorderPaint); - // Vertical separators between the titles int separatorTop = (height - dividerHeightPx) / 2; for (int i = 0; i < childCount - 1; i++) {