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


Java AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD屬性代碼示例

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


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

示例1: performAccessibilityAction

@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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:23,代碼來源:VerticalViewPager.java

示例2: performAccessibilityAction

@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;
}
 
開發者ID:ruiqiao2017,項目名稱:Renrentou,代碼行數:21,代碼來源:XCCycleViewPager.java

示例3: performAccessibilityAction

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;
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:22,代碼來源:YViewPager.java

示例4: performAccessibilityAction

@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;
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:23,代碼來源:YViewPagerNew.java

示例5: getAction

private String getAction() {
    switch (mAction) {
        case AccessibilityNodeInfoCompat.ACTION_CLICK:
            return "click()";
        case AccessibilityNodeInfoCompat.ACTION_LONG_CLICK:
            return "longClick()";

        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD:
            return "scrollBackward()";

        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD:
            return "scrollForward()";

        case AccessibilityNodeInfoCompat.ACTION_SET_TEXT:
            return "setText(\"\")";
    }
    return "";
}
 
開發者ID:hyb1996,項目名稱:Auto.js,代碼行數:18,代碼來源:CodeGenerator.java

示例6: performAccessibilityAction

@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;
}
 
開發者ID:simplezhli,項目名稱:ChangeTabLayout,代碼行數:21,代碼來源:VerticalViewPager.java

示例7: performAccessibilityAction

@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;
}
 
開發者ID:fengshihao,項目名稱:WebPager,代碼行數:23,代碼來源:CustomViewPager.java

示例8: performAccessibilityAction

@SuppressLint("NewApi")
@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;
      }
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:22,代碼來源:ViewPagerCompat.java

示例9: performAccessibilityAction

@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 (isHorizontalDirection()) {
                if (canScrollHorizontally(1)) {
                    setCurrentItem(mCurItem + 1);
                    return true;
                }
            } else if (isVerticalDirection()) {
                if (canScrollVertically(1)) {
                    setCurrentItem(mCurItem + 1);
                    return true;
                }
            }
        }
        return false;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD: {
            if (isHorizontalDirection()) {
                if (canScrollHorizontally(-1)) {
                    setCurrentItem(mCurItem - 1);
                    return true;
                }
            } else if (isVerticalDirection()) {
                if (canScrollVertically(-1)) {
                    setCurrentItem(mCurItem - 1);
                    return true;
                }
            }
        }
        return false;
    }
    return false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:37,代碼來源:BaseViewPager.java

示例10: performAccessibilityAction

/**
 * Called by AccessibilityDelegate when an action is requested from the RecyclerView.
 *
 * @param recycler  The Recycler that can be used to convert view positions into adapter
 *                  positions
 * @param state     The current state of RecyclerView
 * @param action    The action to perform
 * @param args      Optional action arguments
 * @see View#performAccessibilityAction(int, android.os.Bundle)
 */
public boolean performAccessibilityAction(Recycler recycler, State state, int action,
        Bundle args) {
    if (mRecyclerView == null) {
        return false;
    }
    int vScroll = 0, hScroll = 0;
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD:
            if (ViewCompat.canScrollVertically(mRecyclerView, -1)) {
                vScroll = -(getHeight() - getPaddingTop() - getPaddingBottom());
            }
            if (ViewCompat.canScrollHorizontally(mRecyclerView, -1)) {
                hScroll = -(getWidth() - getPaddingLeft() - getPaddingRight());
            }
            break;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD:
            if (ViewCompat.canScrollVertically(mRecyclerView, 1)) {
                vScroll = getHeight() - getPaddingTop() - getPaddingBottom();
            }
            if (ViewCompat.canScrollHorizontally(mRecyclerView, 1)) {
                hScroll = getWidth() - getPaddingLeft() - getPaddingRight();
            }
            break;
    }
    if (vScroll == 0 && hScroll == 0) {
        return false;
    }
    mRecyclerView.scrollBy(hScroll, vScroll);
    return true;
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:40,代碼來源:RecyclerView.java

示例11: performAccessibilityAction

/**
 * Called by AccessibilityDelegate when an action is requested from the RecyclerView.
 *
 * @param recycler  The Recycler that can be used to convert view positions into adapter
 *                  positions
 * @param state     The current state of RecyclerView
 * @param action    The action to perform
 * @param args      Optional action arguments
 * @see View#performAccessibilityAction(int, android.os.Bundle)
 */
public boolean performAccessibilityAction(Recycler recycler, State state, int action,
                                          Bundle args) {
    if (mRecyclerView == null) {
        return false;
    }
    int vScroll = 0, hScroll = 0;
    switch (action) {
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD:
            if (ViewCompat.canScrollVertically(mRecyclerView, -1)) {
                vScroll = -(getHeight() - getPaddingTop() - getPaddingBottom());
            }
            if (ViewCompat.canScrollHorizontally(mRecyclerView, -1)) {
                hScroll = -(getWidth() - getPaddingLeft() - getPaddingRight());
            }
            break;
        case AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD:
            if (ViewCompat.canScrollVertically(mRecyclerView, 1)) {
                vScroll = getHeight() - getPaddingTop() - getPaddingBottom();
            }
            if (ViewCompat.canScrollHorizontally(mRecyclerView, 1)) {
                hScroll = getWidth() - getPaddingLeft() - getPaddingRight();
            }
            break;
    }
    if (vScroll == 0 && hScroll == 0) {
        return false;
    }
    mRecyclerView.scrollBy(hScroll, vScroll);
    return true;
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:40,代碼來源:RecyclerView.java

示例12: performAccessibilityAction

@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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:43,代碼來源:DirectionalViewpager.java


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