summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java27
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) {