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

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

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

NestedScrollView.addView介绍

暂无

代码示例

代码示例来源: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: whyalwaysmea/BigBoom

@Override
public void addView(View child, int index) {
  super.addView(child, index);
  findStickyViews(child);
}

代码示例来源:origin: whyalwaysmea/BigBoom

@Override
public void addView(View child, int width, int height) {
  super.addView(child, width, height);
  findStickyViews(child);
}

代码示例来源:origin: whyalwaysmea/BigBoom

@Override
public void addView(View child) {
  super.addView(child);
  findStickyViews(child);
}

代码示例来源:origin: whyalwaysmea/BigBoom

@Override
public void addView(View child, int index, android.view.ViewGroup.LayoutParams params) {
  super.addView(child, index, params);
  findStickyViews(child);
}

代码示例来源:origin: whyalwaysmea/BigBoom

@Override
public void addView(View child, android.view.ViewGroup.LayoutParams params) {
  super.addView(child, params);
  findStickyViews(child);
}

代码示例来源:origin: wzmyyj/ZYMK

@Override
protected void initView() {
  view = mInflater.inflate(R.layout.panel_ns, null);
  mFrameLayout = view.findViewById(R.id.frameLayout);
  mNestedScrollView = view.findViewById(R.id.nestedScrollView);
  mRefreshLayout = view.findViewById(R.id.refreshLayout);
  mRefreshLayout.setHeaderHeight(100);
  mRefreshLayout.setFooterHeight(100);
  mRefreshLayout.setPrimaryColorsId(R.color.colorRefresh, R.color.colorWhite);
  contentView = mInflater.inflate(getContentViewId(), null);
  mNestedScrollView.addView(contentView);
}

代码示例来源:origin: SusionSuc/Boring

@Override
public void showEssayContent(String contentHtml) {
  if (mWbParent.getChildCount() > 0) {
    mWbParent.removeViewAt(0);
  }
  mWebView = new WebView(this);
  mWebView.loadDataWithBaseURL(null, contentHtml, "text/html", "utf-8", null);
  FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  mWbParent.addView(mWebView, layoutParams);
}

代码示例来源:origin: termux/termux-api

@Override
public void setupDialog(final Dialog dialog, int style) {
  LinearLayout layout = new LinearLayout(getContext());
  layout.setMinimumHeight(100);
  layout.setPadding(16, 16, 16, 16);
  layout.setOrientation(LinearLayout.VERTICAL);
  NestedScrollView scrollView = new NestedScrollView(getContext());
  final String[] values = getInputValues(Objects.requireNonNull(getActivity()).getIntent());
  for (int i = 0; i < values.length; ++i) {
    final int j = i;
    final TextView textView = new TextView(getContext());
    textView.setText(values[j]);
    textView.setTextSize(20);
    textView.setPadding(56, 56, 56, 56);
    textView.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        InputResult result = new InputResult();
        result.text = values[j];
        result.index = j;
        dialog.dismiss();
        resultListener.onResult(result);
      }
    });
    layout.addView(textView);
  }
  scrollView.addView(layout);
  dialog.setContentView(scrollView);
  hideKeyboard();
}

相关文章