當前位置: 首頁>>代碼示例>>Java>>正文


Java ScrollView.getPaddingBottom方法代碼示例

本文整理匯總了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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:Utils.java

示例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;
}
 
開發者ID:stytooldex,項目名稱:pius1,代碼行數:24,代碼來源:SlideBottomPanel.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:ScrollingUtil.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:7,代碼來源:MDRootLayout.java


注:本文中的android.widget.ScrollView.getPaddingBottom方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。