本文整理汇总了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);
}