android.support.v4.view.ViewCompat#SCROLL_AXIS_VERTICAL源码实例Demo

下面列出了android.support.v4.view.ViewCompat#SCROLL_AXIS_VERTICAL 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: AndroidTopSheet   文件: TopSheetBehavior.java
@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;
}
 
@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;
}
 
@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);
}
 
源代码4 项目: CoordinatorLayoutExample   文件: MyFabBehavior.java
@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;//判断是否竖直滚动
}
 
@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);
}
 
源代码6 项目: PullRefreshView   文件: FlingYResolver.java
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
    if (!isNestedScrollingEnabled()) {
        setNestedScrollingEnabled(true);
    }
    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
@Override
public boolean onStartNestedScroll(
        CoordinatorLayout coordinatorLayout,
        FloatingActionButton child,
        View directTargetChild,
        View target,
        int nestedScrollAxes)
{
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
 
@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);
}
 
源代码9 项目: SpringHeader   文件: SpringHeaderBehavior.java
@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;
}
 
源代码10 项目: PullRefreshView   文件: SliderBox.java
/*****************************************************************************************/

    @Override
    public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
        if (!isNestedScrollingEnabled()) {
            setNestedScrollingEnabled(true);
        }
        return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
    }
 
@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);
}
 
@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;
}
 
源代码13 项目: ForPDA   文件: FabOnScroll.java
@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;
}
 
源代码14 项目: SteamGifts   文件: ScrollAwareFABBehavior.java
@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);
}
 
@Override
public boolean onStartNestedScroll( CoordinatorLayout coordinatorLayout, V child, View directTargetChild, View target, int nestedScrollAxes ) {
  mNestedScrolled = false;
  return ( nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL ) != 0;
}
 
源代码16 项目: android-source-codes   文件: SwipeRefreshLayout.java
@Override
public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) {
    return isEnabled() && !mReturningToStart && !mRefreshing
            && (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
@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;
    }
 
源代码18 项目: Toutiao   文件: BottomNavigationBehavior.java
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {
    return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
 
@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);
}
 
@Override
public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, View child, View directTargetChild, View target, int nestedScrollAxes) {
    return (nestedScrollAxes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0;
}
 
 同类方法