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

Commit 9a960b74 authored by arangelov's avatar arangelov Committed by Antoan Angelov
Browse files

Disable side swiping on RTL languages

The internal ViewPager seems to not handle RTL well. This CL
disables side swiping in that case.

Fixes: 159110029
Test: manually confirmed side swiping does not happen on RTL
languages
Test: manually side swiped on non-RTL languages

Change-Id: I30272426d1d1ef4f17ec656630cee01505f66c59
parent 58fd58de
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -74,12 +74,16 @@ public class ResolverViewPager extends ViewPager {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }

    /**
     * Sets whether swiping sideways should happen.
     * <p>Note that swiping is always disabled for RTL layouts (b/159110029 for context).
     */
    void setSwipingEnabled(boolean swipingEnabled) {
        mSwipingEnabled = swipingEnabled;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return mSwipingEnabled && super.onInterceptTouchEvent(ev);
        return !isLayoutRtl() && mSwipingEnabled && super.onInterceptTouchEvent(ev);
    }
}