本文整理了Java中android.widget.ScrollView.getPaddingTop()
方法的一些代码示例,展示了ScrollView.getPaddingTop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollView.getPaddingTop()
方法的具体详情如下:
包路径:android.widget.ScrollView
类名称:ScrollView
方法名:getPaddingTop
暂无
代码示例来源:origin: florent37/MaterialViewPager
static boolean canScroll(View view) {
if (view instanceof ScrollView) {
ScrollView scrollView = (ScrollView) view;
View child = scrollView.getChildAt(0);
if (child != null) {
int childHeight = child.getHeight();
return scrollView.getHeight() < childHeight + scrollView.getPaddingTop() + scrollView.getPaddingBottom();
}
return false;
} else if (view instanceof RecyclerView) {
RecyclerView recyclerView = (RecyclerView) view;
int yOffset = recyclerView.computeVerticalScrollOffset();
return yOffset != 0;
}
return true;
}
代码示例来源:origin: chaychan/TouTiao
public static boolean isScrollViewToBottom(ScrollView scrollView) {
if (scrollView != null) {
int scrollContentHeight = scrollView.getScrollY() + scrollView.getMeasuredHeight() - scrollView.getPaddingTop() - scrollView.getPaddingBottom();
int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
if (scrollContentHeight == realContentHeight) {
return true;
}
}
return false;
}
代码示例来源:origin: stackoverflow.com
ScrollView scrollView = (ScrollView) findViewById(R.id.scrollView);
int childHeight = ((LinearLayout)findViewById(R.id.scrollContent)).getHeight();
boolean isScrollable = scrollView.getHeight() < childHeight + scrollView.getPaddingTop() + scrollView.getPaddingBottom();
代码示例来源:origin: Justson/AgentWebX5
public static boolean isScrollViewToBottom(ScrollView scrollView) {
if (scrollView != null) {
int scrollContentHeight = scrollView.getScrollY() + scrollView.getMeasuredHeight() - scrollView.getPaddingTop() - scrollView.getPaddingBottom();
int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
if (scrollContentHeight == realContentHeight) {
return true;
}
}
return false;
}
代码示例来源:origin: openmrs/openmrs-contrib-android-client
@Override
public void scrollToTop() {
ScrollView scrollView = (ScrollView) this.getActivity().findViewById(R.id.scrollView);
scrollView.smoothScrollTo(0, scrollView.getPaddingTop());
}
代码示例来源:origin: vihuela/RAD
public static boolean isScrollViewToBottom(ScrollView scrollView) {
if (scrollView != null) {
int scrollContentHeight = scrollView.getScrollY() + scrollView.getMeasuredHeight() - scrollView.getPaddingTop() - scrollView.getPaddingBottom();
int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
if (scrollContentHeight == realContentHeight) {
return true;
}
}
return false;
}
代码示例来源:origin: wujingchao/MultiCardMenu
/**
* Copy From ScrollView (API Level >= 14)
* <p>The scroll range of a scroll view is the overall height of all of its
* children.</p>
*/
private int computeVerticalScrollRange(ScrollView scrollView) {
final int count = scrollView.getChildCount();
final int contentHeight = scrollView.getHeight() - scrollView.getPaddingBottom() - scrollView.getPaddingTop();
if (count == 0) {
return contentHeight;
}
int scrollRange = scrollView.getChildAt(0).getBottom();
final int scrollY = scrollView.getScrollY();
final int overScrollBottom = Math.max(0, scrollRange - contentHeight);
if (scrollY < 0) {
scrollRange -= scrollY;
} else if (scrollY > overScrollBottom) {
scrollRange += scrollY - overScrollBottom;
}
return scrollRange;
}
代码示例来源:origin: stackoverflow.com
private boolean canScroll(HorizontalScrollView horizontalScrollView) {
View child = (View) horizontalScrollView.getChildAt(0);
if (child != null) {
int childWidth = (child).getWidth();
return horizontalScrollView.getWidth() < childWidth + horizontalScrollView.getPaddingLeft() + horizontalScrollView.getPaddingRight();
}
return false;
}
private boolean canScroll(ScrollView scrollView) {
View child = (View) scrollView.getChildAt(0);
if (child != null) {
int childHeight = (child).getHeight();
return scrollView.getHeight() < childHeight + scrollView.getPaddingTop() + scrollView.getPaddingBottom();
}
return false;
}
代码示例来源:origin: fengmaolian/AnalyzeRecyclerViewWithBGARefreshLayout
int scrollContentHeight = mScrollView.getScrollY() + mScrollView.getMeasuredHeight() - mScrollView.getPaddingTop() - mScrollView.getPaddingBottom();
int realContentHeight = mScrollView.getChildAt(0).getMeasuredHeight();
if (scrollContentHeight == realContentHeight) {
内容来源于网络,如有侵权,请联系作者删除!