am 09d0ee26: Merge "Fix bug #8629386 FastScroller is on the wrong side when switching to Hebrew in a RTL enabled app" into jb-mr2-dev
* commit '09d0ee261d11396e1541c23d8f4f3f5d7e6a9e18': Fix bug #8629386 FastScroller is on the wrong side when switching to Hebrew in a RTL enabled app
This commit is contained in:
@@ -2699,6 +2699,15 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
||||
mLastTouchMode = touchMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRtlPropertiesChanged(int layoutDirection) {
|
||||
super.onRtlPropertiesChanged(layoutDirection);
|
||||
|
||||
if (mFastScroller != null) {
|
||||
mFastScroller.setScrollbarPosition(getVerticalScrollbarPosition());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the ContextMenuInfo returned from {@link #getContextMenuInfo()}. This
|
||||
* methods knows the view, position and ID of the item that received the
|
||||
|
||||
@@ -216,8 +216,22 @@ class FastScroller {
|
||||
mHandler.removeCallbacks(mScrollFade);
|
||||
break;
|
||||
case STATE_EXIT:
|
||||
int viewWidth = mList.getWidth();
|
||||
mList.invalidate(viewWidth - mThumbW, mThumbY, viewWidth, mThumbY + mThumbH);
|
||||
final int viewWidth = mList.getWidth();
|
||||
final int top = mThumbY;
|
||||
final int bottom = mThumbY + mThumbH;
|
||||
final int left;
|
||||
final int right;
|
||||
switch (mList.getLayoutDirection()) {
|
||||
case View.LAYOUT_DIRECTION_RTL:
|
||||
left = 0;
|
||||
right = mThumbW;
|
||||
break;
|
||||
case View.LAYOUT_DIRECTION_LTR:
|
||||
default:
|
||||
left = viewWidth - mThumbW;
|
||||
right = viewWidth;
|
||||
}
|
||||
mList.invalidate(left, top, right, bottom);
|
||||
break;
|
||||
}
|
||||
mState = state;
|
||||
@@ -398,10 +412,26 @@ class FastScroller {
|
||||
} else if (mState == STATE_EXIT) {
|
||||
if (alpha == 0) { // Done with exit
|
||||
setState(STATE_NONE);
|
||||
} else if (mTrackDrawable != null) {
|
||||
mList.invalidate(viewWidth - mThumbW, 0, viewWidth, mList.getHeight());
|
||||
} else {
|
||||
mList.invalidate(viewWidth - mThumbW, y, viewWidth, y + mThumbH);
|
||||
final int left, right, top, bottom;
|
||||
if (mTrackDrawable != null) {
|
||||
top = 0;
|
||||
bottom = mList.getHeight();
|
||||
} else {
|
||||
top = y;
|
||||
bottom = y + mThumbH;
|
||||
}
|
||||
switch (mList.getLayoutDirection()) {
|
||||
case View.LAYOUT_DIRECTION_RTL:
|
||||
left = 0;
|
||||
right = mThumbW;
|
||||
break;
|
||||
case View.LAYOUT_DIRECTION_LTR:
|
||||
default:
|
||||
left = viewWidth - mThumbW;
|
||||
right = viewWidth;
|
||||
}
|
||||
mList.invalidate(left, top, right, bottom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user