diff options
author | Winson Chung <winsonc@google.com> | 2013-08-12 16:19:28 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-08-20 10:56:05 -0700 |
commit | 5f8afe6280eae34620067696173e71943e1a30a3 (patch) | |
tree | eb0ebdf56f2ad0950894424a49de9d1e8dc832e0 /src/com/android/launcher3/BubbleTextView.java | |
parent | 8a6870101c3d99257fc050d11bb69f50f5240622 (diff) | |
download | android_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.tar.gz android_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.tar.bz2 android_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.zip |
Initial Changes for Dynamic Grid
Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 868e3acad..bb6903d43 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -25,6 +25,7 @@ import android.graphics.Region; import android.graphics.Region.Op; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.util.TypedValue; import android.view.MotionEvent; import android.widget.TextView; @@ -34,7 +35,6 @@ import android.widget.TextView; * too aggressive. */ public class BubbleTextView extends TextView { - static final float CORNER_RADIUS = 4.0f; static final float SHADOW_LARGE_RADIUS = 4.0f; static final float SHADOW_SMALL_RADIUS = 1.75f; static final float SHADOW_Y_OFFSET = 2.0f; @@ -55,6 +55,8 @@ public class BubbleTextView extends TextView { private int mPressedOutlineColor; private int mPressedGlowColor; + private boolean mIsTextVisible; + private boolean mBackgroundSizeChanged; private Drawable mBackground; @@ -76,6 +78,15 @@ public class BubbleTextView extends TextView { init(); } + public void onFinishInflate() { + super.onFinishInflate(); + + // Ensure we are using the right text size + LauncherAppState app = LauncherAppState.getInstance(); + DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize); + } + private void init() { mLongPressHelper = new CheckLongPressHelper(this); mBackground = getBackground(); @@ -326,6 +337,20 @@ public class BubbleTextView extends TextView { if (mBackground != null) mBackground.setCallback(null); } + public void setTextVisibility(boolean visible) { + Resources res = getResources(); + if (visible) { + setTextColor(res.getColor(R.color.workspace_icon_text_color)); + } else { + setTextColor(res.getColor(android.R.color.transparent)); + } + mIsTextVisible = visible; + } + + public boolean isTextVisible() { + return mIsTextVisible; + } + @Override protected boolean onSetAlpha(int alpha) { if (mPrevAlpha != alpha) { |