本文整理匯總了Java中android.webkit.WebView.getScrollY方法的典型用法代碼示例。如果您正苦於以下問題:Java WebView.getScrollY方法的具體用法?Java WebView.getScrollY怎麽用?Java WebView.getScrollY使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.webkit.WebView
的用法示例。
在下文中一共展示了WebView.getScrollY方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: canChildPullUp
import android.webkit.WebView; //導入方法依賴的package包/類
public boolean canChildPullUp() {
if (child instanceof AbsListView) {
AbsListView absListView = (AbsListView) child;
return canScrollVertically(child, 1)
|| absListView.getLastVisiblePosition() != mTotalItemCount - 1;
} else if (child instanceof WebView) {
WebView webview = (WebView) child;
if (webview instanceof XWebView) {
return !((XWebView) webview).isBottom();
} else {
float left = webview.getContentHeight() * webview.getScale();
int right = webview.getHeight() + webview.getScrollY();
return left != right;
}
} else if (child instanceof ScrollView) {
ScrollView scrollView = (ScrollView) child;
View childView = scrollView.getChildAt(0);
if (childView != null) {
return canScrollVertically(child, 1)
|| scrollView.getScrollY() < childView.getHeight() - scrollView.getHeight();
}
} else {
return canScrollVertically(child, 1);
}
return true;
}
示例2: invalidateDividersForWebView
import android.webkit.WebView; //導入方法依賴的package包/類
private void invalidateDividersForWebView(WebView view, final boolean setForTop, boolean setForBottom, boolean hasButtons) {
if (setForTop) {
drawTopDivider = titleBar != null &&
titleBar.getVisibility() != View.GONE &&
//Not scrolled to the top.
view.getScrollY() + view.getPaddingTop() > 0;
}
if (setForBottom) {
//noinspection deprecation
drawBottomDivider = hasButtons &&
view.getScrollY() + view.getMeasuredHeight() - view.getPaddingBottom() < view.getContentHeight() * view.getScale();
}
}
示例3: isWebViewToBottom
import android.webkit.WebView; //導入方法依賴的package包/類
public static boolean isWebViewToBottom(WebView webView) {
return webView != null && webView.getContentHeight() * webView.getScale() == (webView.getScrollY() + webView.getMeasuredHeight());
}
示例4: isWebViewToBottom
import android.webkit.WebView; //導入方法依賴的package包/類
public static boolean isWebViewToBottom(WebView webview, int mTouchSlop) {
return webview != null && ((webview.getContentHeight() * webview.getScale() - (webview.getHeight() + webview.getScrollY())) <= 2 * mTouchSlop);
}