本文整理匯總了Java中android.widget.ScrollView.getPaddingBottom方法的典型用法代碼示例。如果您正苦於以下問題:Java ScrollView.getPaddingBottom方法的具體用法?Java ScrollView.getPaddingBottom怎麽用?Java ScrollView.getPaddingBottom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.ScrollView
的用法示例。
在下文中一共展示了ScrollView.getPaddingBottom方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canScroll
import android.widget.ScrollView; //導入方法依賴的package包/類
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;
}
示例2: computeVerticalScrollRange
import android.widget.ScrollView; //導入方法依賴的package包/類
/**
* 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;
}
示例3: isScrollViewToBottom
import android.widget.ScrollView; //導入方法依賴的package包/類
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;
}
示例4: canScrollViewScroll
import android.widget.ScrollView; //導入方法依賴的package包/類
private static boolean canScrollViewScroll(ScrollView sv) {
if (sv.getChildCount() == 0)
return false;
final int childHeight = sv.getChildAt(0).getMeasuredHeight();
return sv.getMeasuredHeight() - sv.getPaddingTop() - sv.getPaddingBottom() < childHeight;
}