Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议把FrameLayout 用一个自定义FrameLayout 来实现, 可以让使用方继承 #38

Open
budaowengd opened this issue Dec 25, 2021 · 2 comments

Comments

@budaowengd
Copy link

` private ByWebView(Builder builder) {
this.activity = builder.mActivity;
this.mErrorTitle = builder.mErrorTitle;
this.mErrorLayoutId = builder.mErrorLayoutId;

    FrameLayout parentLayout = new FrameLayout(activity);
    // 设置WebView
    setWebView(builder.mCustomWebView);
    parentLayout.addView(mWebView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    // 进度条布局
    handleWebProgress(builder, parentLayout);
    if (builder.mIndex != -1) {
        builder.mWebContainer.addView(parentLayout, builder.mIndex, builder.mLayoutParams);
    } else {
        builder.mWebContainer.addView(parentLayout, builder.mLayoutParams);
    }`
@youlookwhat
Copy link
Owner

private ByWebView(Builder builder) {
	this.activity = builder.mActivity;
	this.mErrorTitle = builder.mErrorTitle;
	this.mErrorLayoutId = builder.mErrorLayoutId;
	FrameLayout parentLayout = new FrameLayout(activity);
	// 设置WebView
	setWebView(builder.mCustomWebView);
	parentLayout.addView(mWebView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
	// 进度条布局
	handleWebProgress(builder, parentLayout);
	if (builder.mIndex != -1) {
		builder.mWebContainer.addView(parentLayout, builder.mIndex, builder.mLayoutParams);
	} else {
		builder.mWebContainer.addView(parentLayout, builder.mLayoutParams);
	}
}

你具体是有什么需求呢,我可以调整一下,可以给个场景我做个示例啥的

@NanyangTaiji
Copy link

他要求你将ByWebView 做成AdvancedWebView 那样是个webView, 可以在Layout 里面直接调用,也可以进一步继承。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants