Merge change 7097 into donut
* changes: Fix to use DP instead of pixels for Thumb drawable size.
This commit is contained in:
@@ -26,6 +26,7 @@ import android.graphics.RectF;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,17 +117,19 @@ class FastScroller {
|
|||||||
mThumbDrawable.setAlpha(ScrollFade.ALPHA_MAX);
|
mThumbDrawable.setAlpha(ScrollFade.ALPHA_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void useThumbDrawable(Drawable drawable) {
|
private void useThumbDrawable(Context context, Drawable drawable) {
|
||||||
mThumbDrawable = drawable;
|
mThumbDrawable = drawable;
|
||||||
mThumbW = 64; //mCurrentThumb.getIntrinsicWidth();
|
mThumbW = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
|
||||||
mThumbH = 52; //mCurrentThumb.getIntrinsicHeight();
|
64, context.getResources().getDisplayMetrics());
|
||||||
|
mThumbH = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
|
||||||
|
52, context.getResources().getDisplayMetrics());
|
||||||
mChangedBounds = true;
|
mChangedBounds = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init(Context context) {
|
private void init(Context context) {
|
||||||
// Get both the scrollbar states drawables
|
// Get both the scrollbar states drawables
|
||||||
final Resources res = context.getResources();
|
final Resources res = context.getResources();
|
||||||
useThumbDrawable(res.getDrawable(
|
useThumbDrawable(context, res.getDrawable(
|
||||||
com.android.internal.R.drawable.scrollbar_handle_accelerated_anim2));
|
com.android.internal.R.drawable.scrollbar_handle_accelerated_anim2));
|
||||||
|
|
||||||
mOverlayDrawable = res.getDrawable(
|
mOverlayDrawable = res.getDrawable(
|
||||||
|
|||||||
Reference in New Issue
Block a user