Java Code Examples for android.support.v4.view.accessibility.AccessibilityNodeInfoCompat#ACTION_SCROLL_BACKWARD

The following examples show how to use android.support.v4.view.accessibility.AccessibilityNodeInfoCompat#ACTION_SCROLL_BACKWARD . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VerticalViewPager.java    From actor-platform with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (internalCanScrollVertically(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (internalCanScrollVertically(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 2
Source File: VerticalViewPager.java    From ticdesign with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (internalCanScrollVertically(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (internalCanScrollVertically(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 3
Source File: CustomViewPager.java    From material-intro-screen with MIT License 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 4
Source File: VerticalViewPager.java    From VerticalViewPager with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (mAdapter != null && mCurItem >= 0 && mCurItem < mAdapter.getCount() - 1) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (mAdapter != null && mCurItem > 0 && mCurItem < mAdapter.getCount()) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 5
Source File: HorizontalViewPager.java    From DoubleViewPager with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (mAdapter != null && mCurItem >= 0 && mCurItem < mAdapter.getCount() - 1) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (mAdapter != null && mCurItem > 0 && mCurItem < mAdapter.getCount()) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 6
Source File: VelocityViewPager.java    From Muzesto with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 7
Source File: ViewPagerEx.java    From ImageSliderWithSwipes with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 8
Source File: VerticalViewPager.java    From InfiniteCycleViewPager with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (internalCanScrollVertically(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (internalCanScrollVertically(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 9
Source File: VerticalViewPager.java    From ankihelper with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (internalCanScrollVertically(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (internalCanScrollVertically(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 10
Source File: ViewPager.java    From V.FlyoutTest with MIT License 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 11
Source File: ViewPager.java    From AppCompat-Extension-Library with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 12
Source File: NineOldViewPager.java    From ncalc with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        }
        return false;
    }
    return false;
}
 
Example 13
Source File: LinkagePager.java    From music-player with MIT License 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 14
Source File: VerticalViewPager.java    From ChangeTabLayout with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (internalCanScrollVertically(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (internalCanScrollVertically(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 15
Source File: ViewPagerEx.java    From AndroidImageSlider with MIT License 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 16
Source File: FuckViewPager.java    From nono-android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 17
Source File: VerticalViewPager.java    From Overchan-Android with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollVertically1(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollVertically1(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 18
Source File: ViewPager.java    From CodenameOne with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollForward()) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollBackward()) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 19
Source File: ViewPagerEx.java    From UltimateAndroid with Apache License 2.0 6 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
            if (canScrollHorizontally(1)) {
                setCurrentItem(mCurItem + 1);
                return true;
            }
        } return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (canScrollHorizontally(-1)) {
                setCurrentItem(mCurItem - 1);
                return true;
            }
        } return false;
    }
    return false;
}
 
Example 20
Source File: DirectionalViewpager.java    From BookReader with Apache License 2.0 4 votes vote down vote up
@Override
public boolean performAccessibilityAction(View host, int action, Bundle args) {
    if (super.performAccessibilityAction(host, action, args)) {
        return true;
    }

    if (isHorizontal()) {
        switch (action) {
            case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
                if (canScrollHorizontally(1)) {
                    setCurrentItem(mCurItem + 1);
                    return true;
                }
            }
            return false;
            case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
                if (canScrollHorizontally(-1)) {
                    setCurrentItem(mCurItem - 1);
                    return true;
                }
            }
            return false;
        }
    } else {
        switch (action) {
            case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD: {
                if (internalCanScrollVertically(1)) {
                    setCurrentItem(mCurItem + 1);
                    return true;
                }
            }
            return false;
            case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
                if (internalCanScrollVertically(-1)) {
                    setCurrentItem(mCurItem - 1);
                    return true;
                }
            }
            return false;
        }
    }
    return false;
}