diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-07-14 10:50:53 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-07-14 10:50:53 -0700 |
commit | 82b43b10a07fd34d415263c8e522cf88c3867a04 (patch) | |
tree | 0ac93485af0d6e517c98d787ab18091506e56d38 /core/java | |
parent | 0d4586d326a60052503619076d143e73e5780ac7 (diff) | |
parent | e8b88ac15c5d93f7c28c31d62c534df4b9587712 (diff) | |
download | frameworks_base-82b43b10a07fd34d415263c8e522cf88c3867a04.zip frameworks_base-82b43b10a07fd34d415263c8e522cf88c3867a04.tar.gz frameworks_base-82b43b10a07fd34d415263c8e522cf88c3867a04.tar.bz2 |
am e8b88ac1: Merge change 7097 into donut
Merge commit 'e8b88ac15c5d93f7c28c31d62c534df4b9587712'
* commit 'e8b88ac15c5d93f7c28c31d62c534df4b9587712':
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( |