|
|
@@ -22,7 +22,6 @@ import android.text.Html;
|
|
|
import android.text.TextUtils;
|
|
|
import android.text.method.ScrollingMovementMethod;
|
|
|
import android.util.DisplayMetrics;
|
|
|
-import android.util.TypedValue;
|
|
|
import android.view.Display;
|
|
|
import android.view.Gravity;
|
|
|
import android.view.LayoutInflater;
|
|
|
@@ -30,8 +29,7 @@ import android.view.View;
|
|
|
import android.view.Window;
|
|
|
import android.view.WindowManager;
|
|
|
|
|
|
-import com.tencent.smtt.sdk.WebView;
|
|
|
-
|
|
|
+import android.webkit.WebView;
|
|
|
import android.widget.CheckBox;
|
|
|
import android.widget.CompoundButton;
|
|
|
import android.widget.EditText;
|
|
|
@@ -591,7 +589,7 @@ public class ViewUtil {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public static void setH5Text(TextView textView, WebView webView, String content) {
|
|
|
+ public static void setH5Text(TextView textView, com.tencent.smtt.sdk.WebView webView, String content) {
|
|
|
if (textView == null || webView == null) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -626,9 +624,14 @@ public class ViewUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void loadDataWithBaseURL(com.tencent.smtt.sdk.WebView webView, String content) {
|
|
|
+ webView.loadDataWithBaseURL(null,
|
|
|
+ new StringBuilder("<html><head><meta name=\"viewport\" content=\"width=device-width,height=auto, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" /><style>img{max-width:100% !important;height:auto !important;}</style><style>body{max-width:100% !important;}</style></head><body>").append(content).append("</body></html>").toString()
|
|
|
+ , "text/html", "utf-8", null);
|
|
|
+ }
|
|
|
public static void loadDataWithBaseURL(WebView webView, String content) {
|
|
|
webView.loadDataWithBaseURL(null,
|
|
|
- new StringBuilder("<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" /><style>img{max-width:100% !important;height:auto !important;}</style><style>body{max-width:100% !important;}</style></head><body>").append(content).append("</body></html>").toString()
|
|
|
+ new StringBuilder("<html><head><meta name=\"viewport\" content=\"width=device-width,height=auto, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" /><style>img{max-width:100% !important;height:auto !important;}</style><style>body{max-width:100% !important;}</style></head><body>").append(content).append("</body></html>").toString()
|
|
|
, "text/html", "utf-8", null);
|
|
|
}
|
|
|
|
|
|
@@ -680,7 +683,7 @@ public class ViewUtil {
|
|
|
}
|
|
|
View dialog_close = dialog_parent.findViewById(R.id.dialog_close);
|
|
|
LinearLayout dialog_center_ll = dialog_parent.findViewById(R.id.dialog_center_ll);
|
|
|
- View view = LayoutInflater.from(mContext).inflate(dialogConfig.getLayoutId(), dialog_center_ll, true);
|
|
|
+ final View view = LayoutInflater.from(mContext).inflate(dialogConfig.getLayoutId(), dialog_center_ll, true);
|
|
|
if (!TextUtils.isEmpty(title))
|
|
|
dialog_title.setText(title);
|
|
|
|