public WebViewAssert hasContentHeight(int height) { isNotNull(); int actualHeight = actual.getContentHeight(); assertThat(actualHeight) // .overridingErrorMessage("Expected content height <%s> but was <%s>.", height, actualHeight) // .isEqualTo(height); return this; }
@Override @SuppressWarnings("deprecation") public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (scrollPosition > 0 && ABOUT_HTML.equals(url) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { view.setScrollY((int) (view.getContentHeight() * view.getScale() * scrollPosition)); } } });
@Override @SuppressWarnings("deprecation") public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); final float position = webView.getScrollY() / (webView.getContentHeight() * webView.getScale()); outState.putFloat(SCROLL_POSITION, position); } }
@Override protected boolean isReadyForPullEnd() { double exactContentHeight = Math.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
private int getScrollRange() { return (int) Math.max(0, Math.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()) - (getHeight() - getPaddingBottom() - getPaddingTop())); } }
public static boolean isWebViewToBottom(WebView webView) { return webView != null && webView.getContentHeight() * webView.getScale() == (webView.getScrollY() + webView.getMeasuredHeight()); }
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; }
web.setPictureListener(new WebView.PictureListener() { public void onNewPicture(WebView view, Picture picture) { float temp = (float) view.getHeight(); height = view.getContentHeight() * a; } });
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = (float) Math.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override public boolean canOverEnd() { if (webView.getScrollY() >= webView.getContentHeight() * webView.getScale() - webView.getMeasuredHeight()) return true; else return false; }
private int getScrollRange() { return (int) Math.max(0, FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()) - (getHeight() - getPaddingBottom() - getPaddingTop())); } }
private int getScrollRange() { return (int) Math.max(0, FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()) - (getHeight() - getPaddingBottom() - getPaddingTop())); } }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override protected boolean isReadyForPullEnd() { float exactContentHeight = FloatMath.floor(mRefreshableView.getContentHeight() * mRefreshableView.getScale()); return mRefreshableView.getScrollY() >= (exactContentHeight - mRefreshableView.getHeight()); }
@Override public void scrollAViewBy(int dp) { float maxScrollY = webView.getContentHeight() * webView.getScale() - webView.getMeasuredHeight(); if (webView.getScrollY() + dp >= maxScrollY) { webView.scrollTo(0, (int) maxScrollY); } else { webView.scrollBy(0, dp); } } }