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

Commit 47be54bb authored by Alan Viverette's avatar Alan Viverette
Browse files

Use symmetric conditions for advertising and performing ACTION_SCROLL

Bug: 30186372
Change-Id: Ieea0cd539049990ffa98edabb2a7b026445dd14a
parent c9682ab5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1546,7 +1546,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        switch (action) {
            case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
            case R.id.accessibilityActionScrollDown: {
                if (isEnabled() && getLastVisiblePosition() < getCount() - 1) {
                if (isEnabled() && canScrollDown()) {
                    final int viewportHeight = getHeight() - mListPadding.top - mListPadding.bottom;
                    smoothScrollBy(viewportHeight, PositionScroller.SCROLL_DURATION);
                    return true;
@@ -1554,7 +1554,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            } return false;
            case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
            case R.id.accessibilityActionScrollUp: {
                if (isEnabled() && mFirstPosition > 0) {
                if (isEnabled() && canScrollUp()) {
                    final int viewportHeight = getHeight() - mListPadding.top - mListPadding.bottom;
                    smoothScrollBy(-viewportHeight, PositionScroller.SCROLL_DURATION);
                    return true;