本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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 "";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}