diff options
author | Mitsuru Oshima <oshima@google.com> | 2009-07-14 10:37:22 -0700 |
---|---|---|
committer | Mitsuru Oshima <oshima@google.com> | 2009-07-14 10:37:22 -0700 |
commit | a5e441525660765e0913140daff4d12a0d94e88c (patch) | |
tree | 24315283f931f67796cb90246ceb292176dd63ac /core/java | |
parent | cf29e116129f38309c18ba14b9893b079a712289 (diff) | |
download | frameworks_base-a5e441525660765e0913140daff4d12a0d94e88c.zip frameworks_base-a5e441525660765e0913140daff4d12a0d94e88c.tar.gz frameworks_base-a5e441525660765e0913140daff4d12a0d94e88c.tar.bz2 |
Fix to use DP instead of pixels for Thumb drawable size.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/widget/FastScroller.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java index cd965fc..2da777a 100644 --- a/core/java/android/widget/FastScroller.java +++ b/core/java/android/widget/FastScroller.java @@ -26,6 +26,7 @@ import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.SystemClock; +import android.util.TypedValue; import android.view.MotionEvent; /** @@ -116,17 +117,19 @@ class FastScroller { mThumbDrawable.setAlpha(ScrollFade.ALPHA_MAX); } - private void useThumbDrawable(Drawable drawable) { + private void useThumbDrawable(Context context, Drawable drawable) { mThumbDrawable = drawable; - mThumbW = 64; //mCurrentThumb.getIntrinsicWidth(); - mThumbH = 52; //mCurrentThumb.getIntrinsicHeight(); + mThumbW = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, + 64, context.getResources().getDisplayMetrics()); + mThumbH = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, + 52, context.getResources().getDisplayMetrics()); mChangedBounds = true; } private void init(Context context) { // Get both the scrollbar states drawables final Resources res = context.getResources(); - useThumbDrawable(res.getDrawable( + useThumbDrawable(context, res.getDrawable( com.android.internal.R.drawable.scrollbar_handle_accelerated_anim2)); mOverlayDrawable = res.getDrawable( |