diff options
author | Flamefire <alex@grundis.de> | 2014-04-02 20:02:43 +0200 |
---|---|---|
committer | Flamefire <alex@grundis.de> | 2014-04-22 19:40:44 +0200 |
commit | 45936b33b0e03b1f3111a0bfaa61344cd10b2cd1 (patch) | |
tree | 55d20ae5f55397e9e28275a4e987774d1b18c4f4 /src/com/android/launcher3/PagedViewIcon.java | |
parent | 6a43e660cce2cda206f4fecf3ed4ecf9dce8f326 (diff) | |
download | android_packages_apps_Trebuchet-45936b33b0e03b1f3111a0bfaa61344cd10b2cd1.tar.gz android_packages_apps_Trebuchet-45936b33b0e03b1f3111a0bfaa61344cd10b2cd1.tar.bz2 android_packages_apps_Trebuchet-45936b33b0e03b1f3111a0bfaa61344cd10b2cd1.zip |
Add options to hide icon labels from drawer and homescreen
Forward port from CM 10.2
PS3: Fix typo
PS4: Rebase and global defaults
PS8: Rebase to head
Issue: There is already an Icon section in general, move both
settings there or leave separate in their categories?
Change-Id: I90ae4d2357e5f45fa9261c4eaa0fcf287996e327
Diffstat (limited to 'src/com/android/launcher3/PagedViewIcon.java')
-rw-r--r-- | src/com/android/launcher3/PagedViewIcon.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/com/android/launcher3/PagedViewIcon.java b/src/com/android/launcher3/PagedViewIcon.java index 8bfe42d24..785725852 100644 --- a/src/com/android/launcher3/PagedViewIcon.java +++ b/src/com/android/launcher3/PagedViewIcon.java @@ -20,7 +20,6 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Region; -import android.graphics.Region.Op; import android.util.AttributeSet; import android.util.TypedValue; import android.widget.TextView; @@ -44,6 +43,9 @@ public class PagedViewIcon extends TextView { private Bitmap mIcon; + private int mTextColor; + private boolean mIsTextVisible; + public PagedViewIcon(Context context) { this(context, null); } @@ -63,6 +65,8 @@ public class PagedViewIcon extends TextView { LauncherAppState app = LauncherAppState.getInstance(); DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize); + mTextColor = getCurrentTextColor(); + mIsTextVisible = mTextColor != getResources().getColor(android.R.color.transparent); } public void applyFromApplicationInfo(AppInfo info, boolean scaleUp, @@ -126,4 +130,23 @@ public class PagedViewIcon extends TextView { super.draw(canvas); canvas.restore(); } + + @Override + public void setTextColor(int color) { + mTextColor = color; + super.setTextColor(color); + } + + public void setTextVisibility(boolean visible) { + if (visible) { + super.setTextColor(mTextColor); + } else { + super.setTextColor(getResources().getColor(android.R.color.transparent)); + } + mIsTextVisible = visible; + } + + public boolean isTextVisible() { + return mIsTextVisible; + } } |