当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD属性代码示例

本文整理汇总了Java中android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD属性的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD属性的具体用法?Java AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD怎么用?Java AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v4.view.accessibility.AccessibilityNodeInfoCompat的用法示例。


在下文中一共展示了AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD属性的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_BACKWARD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。