android.widget.HorizontalScrollView.canScrollHorizontally()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中android.widget.HorizontalScrollView.canScrollHorizontally()方法的一些代码示例,展示了HorizontalScrollView.canScrollHorizontally()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HorizontalScrollView.canScrollHorizontally()方法的具体详情如下:
包路径:android.widget.HorizontalScrollView
类名称:HorizontalScrollView
方法名:canScrollHorizontally

HorizontalScrollView.canScrollHorizontally介绍

暂无

代码示例

代码示例来源:origin: EverythingMe/overscroll-decor

@Override
  public boolean isInAbsoluteEnd() {
    return !mView.canScrollHorizontally(1);
  }
}

代码示例来源:origin: EverythingMe/overscroll-decor

@Override
public boolean isInAbsoluteStart() {
  return !mView.canScrollHorizontally(-1);
}

代码示例来源:origin: XanderWang/elasticity

@Override
  public boolean isInAbsoluteEnd() {
    return !mView.canScrollHorizontally(1);
  }
}

代码示例来源:origin: XanderWang/elasticity

@Override
public boolean isInAbsoluteStart() {
  return !mView.canScrollHorizontally(-1);
}

代码示例来源:origin: Catrobat/Paintroid

@Test
public void testToolSelectionToolButtonCheckPosition() {
  int toolCount = toolsLayout.getChildCount() - getNumberOfNotVisibleTools();
  View toolButton = toolsLayout.getChildAt(toolCount / 2);
  ToolType toolInMiddle = getToolTypeByButtonId(toolButton.getId());
  if (toolsLayout.getWidth() > scrollView.getWidth() + toolsLayout.getChildAt(0).getWidth()) {
    onToolBarView().performSelectTool(toolInMiddle);
    int[] screenLocation = new int[2];
    toolButton.getLocationOnScreen(screenLocation);
    assertEquals("Tool button should be centered", activityHelper.getDisplayWidth() / 2, screenLocation[0] + toolButton.getWidth() / 2);
  }
  int scrollRight = 1;
  int scrollLeft = -1;
  onToolBarView().performSelectTool(ToolType.BRUSH);
  assertFalse("Tool button should be most left", scrollView.canScrollHorizontally(scrollLeft));
  onToolBarView().performSelectTool(ToolType.TRANSFORM);
  assertFalse("Tool button should be most right", scrollView.canScrollHorizontally(scrollRight));
}

相关文章

HorizontalScrollView类方法