diff options
author | Winson Chung <winsonc@google.com> | 2011-04-13 11:27:36 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-04-14 10:13:09 -0700 |
commit | 97d85d23b013347bead4e2f5fa430a79ce69431e (patch) | |
tree | 4e72157c6814cb5c517b09ea14fd4474acb9c7c9 /src/com/android/launcher2/CachedTextView.java | |
parent | 721a06bb6564a4ebe6dc6bf364cb569d255705ac (diff) | |
download | packages_apps_trebuchet-97d85d23b013347bead4e2f5fa430a79ce69431e.zip packages_apps_trebuchet-97d85d23b013347bead4e2f5fa430a79ce69431e.tar.gz packages_apps_trebuchet-97d85d23b013347bead4e2f5fa430a79ce69431e.tar.bz2 |
Fixing focus issues in Launcher (keyboard support).
Change-Id: Ieafd713393daf5628f229a66441bd3ed293245da
Diffstat (limited to 'src/com/android/launcher2/CachedTextView.java')
-rw-r--r-- | src/com/android/launcher2/CachedTextView.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/launcher2/CachedTextView.java b/src/com/android/launcher2/CachedTextView.java index 403d856..d0f6dd8 100644 --- a/src/com/android/launcher2/CachedTextView.java +++ b/src/com/android/launcher2/CachedTextView.java @@ -18,10 +18,11 @@ package com.android.launcher2; import android.content.Context; import android.graphics.Bitmap; +import android.graphics.Bitmap.Config; import android.graphics.Canvas; import android.graphics.Paint; -import android.graphics.Bitmap.Config; import android.graphics.PorterDuff.Mode; +import android.graphics.drawable.Drawable; import android.text.Layout; import android.util.AttributeSet; import android.widget.TextView; @@ -163,6 +164,16 @@ public class CachedTextView extends TextView { if (mPrevAlpha != alpha) { mPrevAlpha = alpha; mCachePaint.setAlpha(alpha); + + // We manually update the drawables alpha since the default TextView implementation may + // not do this if there is a background set (which we may due to the focus bg) + final Drawable[] dr = getCompoundDrawables(); + for (int i = 0; i < dr.length; ++i) { + if (dr[i] != null) { + dr[i].mutate().setAlpha(alpha); + } + } + super.onSetAlpha(alpha); } return true; |