diff options
author | Adam Cohen <adamcohen@google.com> | 2014-07-07 11:58:56 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-07-07 15:29:53 -0700 |
commit | 96bb79819ef9ddf2d1c0cb0b72c2c9f6db26b4fd (patch) | |
tree | 91ff1045255107518b9ea6c9d08667b44ef5a8d2 /src/com/android/launcher3/BubbleTextView.java | |
parent | e54e67f8982f42190dcc3b2ee02092f474d1f7c6 (diff) | |
download | android_packages_apps_Trebuchet-96bb79819ef9ddf2d1c0cb0b72c2c9f6db26b4fd.tar.gz android_packages_apps_Trebuchet-96bb79819ef9ddf2d1c0cb0b72c2c9f6db26b4fd.tar.bz2 android_packages_apps_Trebuchet-96bb79819ef9ddf2d1c0cb0b72c2c9f6db26b4fd.zip |
Enabling quantum look and feel everywhere
-> _l assets become default, new folder icon look is default
-> Starting to unify folder look / feel with all apps
-> New page indicators
Change-Id: I50b2c647fbcbe6ed27705527d8e16bd89e123d0b
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 160a5ebcc..54d7e506e 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -17,7 +17,9 @@ package com.android.launcher3; import android.content.Context; +import android.content.res.ColorStateList; import android.content.res.Resources; +import android.content.res.TypedArray; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Rect; @@ -64,7 +66,7 @@ public class BubbleTextView extends TextView { private float mSlop; private int mTextColor; - private boolean mShadowsEnabled = true; + private boolean mCustomShadowsEnabled = true; private boolean mIsTextVisible; private boolean mBackgroundSizeChanged; @@ -72,22 +74,28 @@ public class BubbleTextView extends TextView { private boolean mStayPressed; private CheckLongPressHelper mLongPressHelper; - private int mInstallState; private CharSequence mDefaultText = ""; public BubbleTextView(Context context) { - super(context); - init(); + this(context, null, 0); } public BubbleTextView(Context context, AttributeSet attrs) { - super(context, attrs); - init(); + this(context, attrs, 0); } public BubbleTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); + + Resources res = context.getResources(); + TypedArray a = context.obtainStyledAttributes(attrs, + R.styleable.BubbleTextView, defStyle, 0); + setGlowColor(a.getColor(R.styleable.BubbleTextView_glowColor, + res.getColor(R.color.outline_color))); + mCustomShadowsEnabled = a.getBoolean(R.styleable.BubbleTextView_customShadows, true); + a.recycle(); + init(); } @@ -98,7 +106,6 @@ public class BubbleTextView extends TextView { LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx); - setTextColor(getResources().getColor(R.color.workspace_icon_text_color)); } private void init() { @@ -106,12 +113,9 @@ public class BubbleTextView extends TextView { mBackground = getBackground(); mOutlineHelper = HolographicOutlineHelper.obtain(getContext()); - - final Resources res = getContext().getResources(); - mFocusedOutlineColor = mFocusedGlowColor = mPressedOutlineColor = mPressedGlowColor = - res.getColor(R.color.outline_color); - - setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR); + if (mCustomShadowsEnabled) { + setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR); + } } public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache) { @@ -322,7 +326,7 @@ public class BubbleTextView extends TextView { @Override public void draw(Canvas canvas) { - if (!mShadowsEnabled) { + if (!mCustomShadowsEnabled) { super.draw(canvas); return; } @@ -384,10 +388,10 @@ public class BubbleTextView extends TextView { super.setTextColor(color); } - public void setShadowsEnabled(boolean enabled) { - mShadowsEnabled = enabled; - getPaint().clearShadowLayer(); - invalidate(); + @Override + public void setTextColor(ColorStateList colors) { + mTextColor = colors.getDefaultColor(); + super.setTextColor(colors); } public void setTextVisibility(boolean visible) { |