Commit d3bcc71d authored by wangxuewei's avatar wangxuewei

Merge remote-tracking branch 'origin/develop_luckyfarm_1.0.1' into develop_luckyfarm_1.0.1

parents 3008cb15 2af46c8d
...@@ -47,20 +47,14 @@ public class WebViewActivity extends BaseActivity { ...@@ -47,20 +47,14 @@ public class WebViewActivity extends BaseActivity {
} else { } else {
rl.setVisibility(View.GONE); rl.setVisibility(View.GONE);
} }
webView = findViewById(R.id.activity_webview_layout);
layout = findViewById(R.id.activity_webview_layout);
initWebView();
initTitle(); initTitle();
initWebView();
} }
private void initWebView() { private void initWebView() {
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
webView = new WebView(this);
webView.setBackgroundColor(getResources().getColor(R.color.color_FEDA83)); webView.setBackgroundColor(getResources().getColor(R.color.color_FEDA83));
//设置WebView的宽高 //设置WebView的宽高
webView.setLayoutParams(layoutParams);
//把webView添加到容器中
layout.addView(webView);
webView.getSettings().setUseWideViewPort(true); webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setLoadWithOverviewMode(true);
// webView.getSettings().setDefaultFontSize(56); // webView.getSettings().setDefaultFontSize(56);
...@@ -106,7 +100,7 @@ public class WebViewActivity extends BaseActivity { ...@@ -106,7 +100,7 @@ public class WebViewActivity extends BaseActivity {
finish(); finish();
} }
}); });
TextView tv_title = findViewById(R.id.tv_user_toolbar_title); TextView tv_title = findViewById(R.id.tv_user_title);
tv_title.setText(title); tv_title.setText(title);
} }
...@@ -135,11 +129,7 @@ public class WebViewActivity extends BaseActivity { ...@@ -135,11 +129,7 @@ public class WebViewActivity extends BaseActivity {
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
if (webView != null) { if (webView != null) {
webView.clearView();
webView.removeAllViews();
webView.destroy(); webView.destroy();
webView = null;
layout.removeView(webView);
} }
} }
......
...@@ -9,35 +9,33 @@ ...@@ -9,35 +9,33 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="90dp" android:layout_height="90dp"
android:background="#994B00"> android:background="#994B00">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_alignParentBottom="true"> android:layout_alignParentBottom="true">
<ImageView <ImageView
android:id="@+id/id_iv_back" android:id="@+id/id_iv_back"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/icon_webview_back" android:layout_centerVertical="true"
android:layout_marginLeft="14dp" android:layout_marginLeft="14dp"
android:layout_centerVertical="true"/> android:src="@drawable/icon_webview_back" />
<TextView <TextView
android:id="@+id/tv_user_toolbar_title" android:id="@+id/tv_user_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#ffffffff" android:textColor="#ffffffff"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold" />
android:layout_centerInParent="true"/>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout <WebView
android:id="@+id/activity_webview_layout" android:id="@+id/activity_webview_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:orientation="horizontal" >
</LinearLayout>
</LinearLayout> </LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment