Java Code Examples for android.support.v4.view.ViewCompat#SCROLL_AXIS_VERTICAL

The following examples show how to use android.support.v4.view.ViewCompat#SCROLL_AXIS_VERTICAL . 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: TopSheetBehavior.java    From AndroidTopSheet with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, V child,
                                   View directTargetChild, View target, int nestedScrollAxes) {
    mLastNestedScrollDy = 0;
    mNestedScrolled = false;
    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
Example 2
Source File: SliderBox.java    From PullRefreshView with Apache License 2.0 5 votes vote down vote up
/*****************************************************************************************/

    @Override
    public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
        if (!isNestedScrollingEnabled()) {
            setNestedScrollingEnabled(true);
        }
        return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
    }
 
Example 3
Source File: SpringHeaderBehavior.java    From SpringHeader with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child,
                                   View directTargetChild, View target, int nestedScrollAxes) {
    boolean started = (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0
            && mState != STATE_HOVERING;
    if (started && mAnimator != null && mAnimator.isRunning()) {
        mAnimator.cancel();
    }
    return started;
}
 
Example 4
Source File: ScrollAwareFABBehavior.java    From Awesome-WanAndroid with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout,
                                   FloatingActionButton child,
                                   View directTargetChild,
                                   View target,
                                   int nestedScrollAxes) {
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||
            super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}
 
Example 5
Source File: ScrollAwareFabBehaviorForDeleteActivities.java    From privacy-friendly-shopping-list with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(
        CoordinatorLayout coordinatorLayout,
        FloatingActionButton child,
        View directTargetChild,
        View target,
        int nestedScrollAxes)
{
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
 
Example 6
Source File: FlingYResolver.java    From PullRefreshView with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
    if (!isNestedScrollingEnabled()) {
        setNestedScrollingEnabled(true);
    }
    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
Example 7
Source File: FloatingActionButtonAwareBehaviour.java    From Typesetter with MIT License 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout,
                                   View child, View directTargetChild, View target, int nestedScrollAxes) {
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL
            || super.onStartNestedScroll(coordinatorLayout, child,
            directTargetChild, target, nestedScrollAxes);
}
 
Example 8
Source File: MyFabBehavior.java    From CoordinatorLayoutExample with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {

    if(child.getVisibility() == View.VISIBLE&&viewY==0){
        //获取控件距离父布局(coordinatorLayout)底部距离
        viewY=coordinatorLayout.getHeight()-child.getY();
    }

    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;//判断是否竖直滚动
}
 
Example 9
Source File: ScrollAwareFABBehavior.java    From AndroidBleManager with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                                   final View directTargetChild, final View target, final int nestedScrollAxes) {
    // Ensure we react to vertical scrolling
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL
            || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}
 
Example 10
Source File: ScrollFABBehavior.java    From chaoli-forum-for-android-2 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout,
                                   FloatingActionButton child, View directTargetChild, View target, int nestedScrollAxes) {

    final boolean ret = nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||
            super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target,
                    nestedScrollAxes);
    return ret;
}
 
Example 11
Source File: RNBottomSheetBehavior.java    From react-native-bottom-sheet-behavior with MIT License 4 votes vote down vote up
@Override
public boolean onStartNestedScroll( CoordinatorLayout coordinatorLayout, V child, View directTargetChild, View target, int nestedScrollAxes ) {
  mNestedScrolled = false;
  return ( nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL ) != 0;
}
 
Example 12
Source File: ScrollAwareFABBehavior.java    From SteamGifts with MIT License 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child, View directTargetChild, View target, int nestedScrollAxes) {
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}
 
Example 13
Source File: SwipeRefreshLayout.java    From android-source-codes with Creative Commons Attribution 4.0 International 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
    return isEnabled() && !mReturningToStart && !mRefreshing
            && (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
Example 14
Source File: FabOnScroll.java    From ForPDA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child, View directTargetChild, View target, int nestedScrollAxes) {
    //Log.d("SUKA", "FabOnScroll onStartNestedScroll " + nestedScrollAxes);
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
 
Example 15
Source File: ScrollAwareFABBehavior.java    From react-native-bottom-sheet-behavior with MIT License 4 votes vote down vote up
@Override
    public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                                       final View directTargetChild, final View target, final int nestedScrollAxes) {
//         Ensure we react to vertical scrolling
        return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
    }
 
Example 16
Source File: BottomNavigationBehavior.java    From Toutiao with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
 
Example 17
Source File: ScrollAwareFABBehavior.java    From MaoWanAndoidClient with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,
                                   final View directTargetChild, final View target, final int nestedScrollAxes) {
    // 确定是在垂直方向上滑动
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL || super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes);
}
 
Example 18
Source File: GroupHeaderBehavior.java    From CoordinatorLayoutExample with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull View child, @NonNull View directTargetChild, @NonNull View target, int axes, int type) {
    boolean isVertical = (axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
    logD(TAG, "isVertical = " + isVertical);
    return isVertical;
}
 
Example 19
Source File: UCViewHeaderBehavior.java    From UCMainViewForBehavior with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {

    //开始滑动的条件,垂直方向滑动,滑动未结束
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL && canScroll(child, 0) && !isClosed(child);
}
 
Example 20
Source File: QuickReturnFooterBehavior.java    From ZfsoftCampusAssit with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {
    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}