android.support.v4.widget.NestedScrollView.post()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中android.support.v4.widget.NestedScrollView.post()方法的一些代码示例,展示了NestedScrollView.post()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.post()方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称:NestedScrollView
方法名:post

NestedScrollView.post介绍

暂无

代码示例

代码示例来源:origin: florent37/MaterialViewPager

scrollView.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: hidroh/materialistic

@Synthetic
void setFullscreen(boolean isFullscreen) {
  if (getView() == null) {
    return;
  }
  mFullscreen = isFullscreen;
  mControls.setVisibility(isFullscreen ? VISIBLE : View.GONE);
  AppUtils.toggleWebViewZoom(mWebView.getSettings(), isFullscreen);
  ViewGroup.LayoutParams params = mWebView.getLayoutParams();
  if (isFullscreen) {
    mScrollView.removeView(mScrollViewContent);
    mWebView.scrollTo(mScrollView.getScrollX(), mScrollView.getScrollY());
    mFullscreenView.addView(mScrollViewContent);
    params.height = ViewGroup.LayoutParams.MATCH_PARENT;
  } else {
    reset();
    // We'll zoom out until it returns false, which means it has min zoom level.
    // It's quite dangerous piece of code - potentially could lead to infinite loop,
    // so let's add some reasonable limit just in case
    int i = 0;
    while (mWebView.zoomOut() && i < 30) {
     i++;
    }
    mFullscreenView.removeView(mScrollViewContent);
    mScrollView.addView(mScrollViewContent);
    mScrollView.post(() -> mScrollView.scrollTo(mWebView.getScrollX(), mWebView.getScrollY()));
    params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
  }
  mWebView.setLayoutParams(params);
}

代码示例来源:origin: ywwynm/EverythingDone

@Override
public void onKeyboardShow(int keyboardHeight) {
  if (mFlRoot.getPaddingBottom() == 0) {
    //set the padding of the contentView for the keyboard
    mFlRoot.setPadding(0, 0, 0, keyboardHeight);
    if (mRvCheckList == null || mRvCheckList.getVisibility() != View.VISIBLE) {
      int toScroll = DisplayUtil.getCursorY(mEtContent);
      toScroll += mEtTitle.getHeight();
      if (mRvImageAttachment != null && mRvImageAttachment.getVisibility() == View.VISIBLE) {
        toScroll += mRvImageAttachment.getHeight();
      }
      final int fToScroll = toScroll;
      mScrollView.post(new Runnable() {
        @Override
        public void run() {
          mScrollView.scrollTo(0, fToScroll - screenHeightDivide6);
        }
      });
    }
  }
}

代码示例来源:origin: AppLozic/Applozic-Android-SDK

mainListView.setNestedScrollingEnabled(true);
nestedScrollView.post(new Runnable() {
  @Override
  public void run() {

相关文章