當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewCompat.TYPE_TOUCH屬性代碼示例

本文整理匯總了Java中android.support.v4.view.ViewCompat.TYPE_TOUCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java ViewCompat.TYPE_TOUCH屬性的具體用法?Java ViewCompat.TYPE_TOUCH怎麽用?Java ViewCompat.TYPE_TOUCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.TYPE_TOUCH屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onStartNestedScroll

@Override
public boolean onStartNestedScroll(View child, View target, int axes, int type) {
    if (type == ViewCompat.TYPE_TOUCH) {
        return super.onStartNestedScroll(child, target, axes, type) || ((axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0);
    }
    return super.onStartNestedScroll(child, target, axes, type);
}
 
開發者ID:nichbar,項目名稱:Aequorea,代碼行數:7,代碼來源:SwipeBackCoordinatorLayout.java

示例2: onStopNestedScroll

@Override
    public void onStopNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout abl,
            View target, int type) {
        if (type == ViewCompat.TYPE_TOUCH) {
    // If we haven't been flung then let's see if the current view has been set to snap
    snapToChildIfNeeded(coordinatorLayout, abl);
  }

  // Keep a reference to the previous nested scrolling child
  mLastNestedScrollingChildRef = new WeakReference<>(target);
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:11,代碼來源:AppBarLayout.java

示例3: setNestedScrollAccepted

void setNestedScrollAccepted(int type, boolean accept) {
        switch (type) {
            case ViewCompat.TYPE_TOUCH:
                mDidAcceptNestedScrollTouch = accept;
                break;
            case ViewCompat.TYPE_NON_TOUCH:
                mDidAcceptNestedScrollNonTouch = accept;
                break;
        }
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:10,代碼來源:CoordinatorLayout.java

示例4: isNestedScrollAccepted

boolean isNestedScrollAccepted(int type) {
        switch (type) {
            case ViewCompat.TYPE_TOUCH:
                return mDidAcceptNestedScrollTouch;
            case ViewCompat.TYPE_NON_TOUCH:
                return mDidAcceptNestedScrollNonTouch;
        }
        return false;
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:9,代碼來源:CoordinatorLayout.java

示例5: onStartNestedScroll

@Override
public boolean onStartNestedScroll(View child, View target, int axes, int type) {
    if (type == ViewCompat.TYPE_TOUCH) {
        return super.onStartNestedScroll(child, target, axes, type)
                || ((axes & ViewCompat.SCROLL_AXIS_VERTICAL) != 0);
    }
    return super.onStartNestedScroll(child, target, axes, type);
}
 
開發者ID:kollerlukas,項目名稱:Camera-Roll-Android-App,代碼行數:8,代碼來源:SwipeBackCoordinatorLayout.java

示例6: onStartNestedScroll

/**
 * Called when a descendant of the CoordinatorLayout attempts to initiate a nested scroll.
 *
     * <p>Any Behavior associated with any direct child of the CoordinatorLayout may respond
     * to this event and return true to indicate that the CoordinatorLayout should act as
     * a nested scrolling parent for this scroll. Only Behaviors that return true from
     * this method will receive subsequent nested scroll events.</p>
 *
     * @param coordinatorLayout the CoordinatorLayout parent of the view this Behavior is
     *                          associated with
 * @param child the child view of the CoordinatorLayout this Behavior is associated with
     * @param directTargetChild the child view of the CoordinatorLayout that either is or
     *                          contains the target of the nested scroll operation
 * @param target the descendant view of the CoordinatorLayout initiating the nested scroll
     * @param axes the axes that this nested scroll applies to. See
     *                         {@link ViewCompat#SCROLL_AXIS_HORIZONTAL},
     *                         {@link ViewCompat#SCROLL_AXIS_VERTICAL}
     * @param type the type of input which cause this scroll event
 * @return true if the Behavior wishes to accept this nested scroll
     *
     * @see NestedScrollingParent2#onStartNestedScroll(View, View, int, int)
 */
    public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
            @NonNull V child, @NonNull View directTargetChild, @NonNull View target,
            @ScrollAxis int axes, @NestedScrollType int type) {
        if (type == ViewCompat.TYPE_TOUCH) {
            return onStartNestedScroll(coordinatorLayout, child, directTargetChild,
                    target, axes);
        }
  return false;
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:31,代碼來源:CoordinatorLayout.java

示例7: onNestedScrollAccepted

/**
* Called when a nested scroll has been accepted by the CoordinatorLayout.
*
    * <p>Any Behavior associated with any direct child of the CoordinatorLayout may elect
    * to accept the nested scroll as part of {@link #onStartNestedScroll}. Each Behavior
    * that returned true will receive subsequent nested scroll events for that nested scroll.
    * </p>
*
    * @param coordinatorLayout the CoordinatorLayout parent of the view this Behavior is
    *                          associated with
* @param child the child view of the CoordinatorLayout this Behavior is associated with
    * @param directTargetChild the child view of the CoordinatorLayout that either is or
    *                          contains the target of the nested scroll operation
* @param target the descendant view of the CoordinatorLayout initiating the nested scroll
    * @param axes the axes that this nested scroll applies to. See
    *                         {@link ViewCompat#SCROLL_AXIS_HORIZONTAL},
    *                         {@link ViewCompat#SCROLL_AXIS_VERTICAL}
    * @param type the type of input which cause this scroll event
    *
    * @see NestedScrollingParent2#onNestedScrollAccepted(View, View, int, int)
*/
   public void onNestedScrollAccepted(@NonNull CoordinatorLayout coordinatorLayout,
           @NonNull V child, @NonNull View directTargetChild, @NonNull View target,
           @ScrollAxis int axes, @NestedScrollType int type) {
       if (type == ViewCompat.TYPE_TOUCH) {
           onNestedScrollAccepted(coordinatorLayout, child, directTargetChild,
                   target, axes);
       }
   }
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:29,代碼來源:CoordinatorLayout.java

示例8: onStopNestedScroll

/**
* Called when a nested scroll has ended.
*
    * <p>Any Behavior associated with any direct child of the CoordinatorLayout may elect
    * to accept the nested scroll as part of {@link #onStartNestedScroll}. Each Behavior
    * that returned true will receive subsequent nested scroll events for that nested scroll.
    * </p>
*
    * <p><code>onStopNestedScroll</code> marks the end of a single nested scroll event
    * sequence. This is a good place to clean up any state related to the nested scroll.
    * </p>
*
    * @param coordinatorLayout the CoordinatorLayout parent of the view this Behavior is
    *                          associated with
* @param child the child view of the CoordinatorLayout this Behavior is associated with
    * @param target the descendant view of the CoordinatorLayout that initiated
    *               the nested scroll
    * @param type the type of input which cause this scroll event
    *
    * @see NestedScrollingParent2#onStopNestedScroll(View, int)
*/
   public void onStopNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
           @NonNull V child, @NonNull View target, @NestedScrollType int type) {
       if (type == ViewCompat.TYPE_TOUCH) {
           onStopNestedScroll(coordinatorLayout, child, target);
       }
   }
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:27,代碼來源:CoordinatorLayout.java

示例9: onNestedScroll

/**
    * Called when a nested scroll in progress has updated and the target has scrolled or
    * attempted to scroll.
*
    * <p>Any Behavior associated with the direct child of the CoordinatorLayout may elect
    * to accept the nested scroll as part of {@link #onStartNestedScroll}. Each Behavior
    * that returned true will receive subsequent nested scroll events for that nested scroll.
    * </p>
*
    * <p><code>onNestedScroll</code> is called each time the nested scroll is updated by the
    * nested scrolling child, with both consumed and unconsumed components of the scroll
    * supplied in pixels. <em>Each Behavior responding to the nested scroll will receive the
    * same values.</em>
    * </p>
*
    * @param coordinatorLayout the CoordinatorLayout parent of the view this Behavior is
    *                          associated with
* @param child the child view of the CoordinatorLayout this Behavior is associated with
* @param target the descendant view of the CoordinatorLayout performing the nested scroll
* @param dxConsumed horizontal pixels consumed by the target's own scrolling operation
* @param dyConsumed vertical pixels consumed by the target's own scrolling operation
    * @param dxUnconsumed horizontal pixels not consumed by the target's own scrolling
    *                     operation, but requested by the user
    * @param dyUnconsumed vertical pixels not consumed by the target's own scrolling operation,
*     but requested by the user
    * @param type the type of input which cause this scroll event
    *
    * @see NestedScrollingParent2#onNestedScroll(View, int, int, int, int, int)
*/
   public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull V child,
           @NonNull View target, int dxConsumed, int dyConsumed,
           int dxUnconsumed, int dyUnconsumed, @NestedScrollType int type) {
       if (type == ViewCompat.TYPE_TOUCH) {
           onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed,
                   dxUnconsumed, dyUnconsumed);
       }
   }
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:37,代碼來源:CoordinatorLayout.java

示例10: onNestedPreScroll

/**
     * Called when a nested scroll in progress is about to update, before the target has
     * consumed any of the scrolled distance.
 *
     * <p>Any Behavior associated with the direct child of the CoordinatorLayout may elect
     * to accept the nested scroll as part of {@link #onStartNestedScroll}. Each Behavior
     * that returned true will receive subsequent nested scroll events for that nested scroll.
     * </p>
 *
     * <p><code>onNestedPreScroll</code> is called each time the nested scroll is updated
     * by the nested scrolling child, before the nested scrolling child has consumed the scroll
     * distance itself. <em>Each Behavior responding to the nested scroll will receive the
     * same values.</em> The CoordinatorLayout will report as consumed the maximum number
     * of pixels in either direction that any Behavior responding to the nested scroll reported
     * as consumed.</p>
 *
     * @param coordinatorLayout the CoordinatorLayout parent of the view this Behavior is
     *                          associated with
 * @param child the child view of the CoordinatorLayout this Behavior is associated with
 * @param target the descendant view of the CoordinatorLayout performing the nested scroll
 * @param dx the raw horizontal number of pixels that the user attempted to scroll
 * @param dy the raw vertical number of pixels that the user attempted to scroll
     * @param consumed out parameter. consumed[0] should be set to the distance of dx that
     *                 was consumed, consumed[1] should be set to the distance of dy that
     *                 was consumed
     * @param type the type of input which cause this scroll event
     *
     * @see NestedScrollingParent2#onNestedPreScroll(View, int, int, int[], int)
 */
    public void onNestedPreScroll(@NonNull CoordinatorLayout coordinatorLayout,
            @NonNull V child, @NonNull View target, int dx, int dy, @NonNull int[] consumed,
            @NestedScrollType int type) {
        if (type == ViewCompat.TYPE_TOUCH) {
            onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed);
        }
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:36,代碼來源:CoordinatorLayout.java


注:本文中的android.support.v4.view.ViewCompat.TYPE_TOUCH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。