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

The following examples show how to use android.support.v4.view.ViewCompat#ScrollAxis . 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: NestedChildHelper.java    From customview-samples with Apache License 2.0 4 votes vote down vote up
public boolean startNestedScroll(@ViewCompat.ScrollAxis int axes) {
    return startNestedScroll(axes, TYPE_TOUCH);
}
 
Example 2
Source File: NestedParent.java    From customview-samples with Apache License 2.0 2 votes vote down vote up
/**
 * 询问父控件是否处理嵌套滑动的方法。
 * 当某个继承NestedScrollingChild接口的孩子(包括直接孩子和间接孩子)
 * 通过startNestedScroll发起一个嵌套滑动事件后会调用到该方法,询问父控件是否接受嵌套滑动。
 * @param child:父控件的一个直接孩子,child可能是target也可能是target的父亲(不一定是直接父亲)。
 * @param target:发起嵌套滑动事件的控件。也就是调用startNestedScroll方法的view
 * @param axes :嵌套滑动方向,包括水平和竖直或都有
 * @return :返回true接受。
 */
boolean onStartNestedScroll(@NonNull View child, @NonNull View target, @ViewCompat.ScrollAxis int axes);
 
Example 3
Source File: NestedParent.java    From customview-samples with Apache License 2.0 2 votes vote down vote up
/**
 * onStartNestedScroll返回true会调用该方法,表示父控件接受嵌套滑动。
 * 它给父控件一个时机去初始化一些为了嵌套滑动做准备的配置
 * @param child:父控件的一个直接孩子,child可能是target也可能是target的父亲(不一定是直接父亲)。
 * @param target:发起嵌套滑动事件的控件。也就是调用startNestedScroll方法的view
 * @param axes :嵌套滑动方向,包括水平和竖直或都有
 */
void onNestedScrollAccepted(@NonNull View child, @NonNull View target, @ViewCompat.ScrollAxis int axes);
 
Example 4
Source File: NestedParent.java    From customview-samples with Apache License 2.0 2 votes vote down vote up
/**
 * Return the current axes of nested scrolling for this NestedScrollingParent.
 *
 * <p>A NestedScrollingParent returning something other than {@link ViewCompat#SCROLL_AXIS_NONE}
 * is currently acting as a nested scrolling parent for one or more descendant views in
 * the hierarchy.</p>
 *
 * @return Flags indicating the current axes of nested scrolling
 * @see ViewCompat#SCROLL_AXIS_HORIZONTAL
 * @see ViewCompat#SCROLL_AXIS_VERTICAL
 * @see ViewCompat#SCROLL_AXIS_NONE
 */
@ViewCompat.ScrollAxis
int getNestedScrollAxes();
 
Example 5
Source File: NestedChild.java    From customview-samples with Apache License 2.0 2 votes vote down vote up
/**
 * 开始嵌套滑动,一般在down事件触发
 * @param axes:嵌套滑动方向
 * @return
 */
boolean startNestedScroll(@ViewCompat.ScrollAxis int axes);