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

Commit fd855c17 authored by Alan Viverette's avatar Alan Viverette Committed by android-build-merger
Browse files

Use symmetric conditions for advertising and performing ACTION_SCROLL

am: 47be54bb

Change-Id: Icdb68cd673269cbc2e41a44becbb0fa4c0ba4712
parents b0e095c9 47be54bb
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;