Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09d0ee26 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio Committed by Android (Google) Code Review
Browse files

Merge "Fix bug #8629386 FastScroller is on the wrong side when switching to...

Merge "Fix bug #8629386 FastScroller is on the wrong side when switching to Hebrew in a RTL enabled app" into jb-mr2-dev
parents c7bdd50c 3a1f1e5b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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
+35 −5
Original line number Diff line number Diff line
@@ -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);
            }
        }
    }