|
|
@@ -9,13 +9,14 @@ import android.support.annotation.Nullable;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
+import android.webkit.WebSettings;
|
|
|
+import android.webkit.WebView;
|
|
|
+import android.webkit.WebViewClient;
|
|
|
import android.widget.FrameLayout;
|
|
|
-import android.widget.TextView;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.helper.NavigationBar;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
-import kr.co.zumo.app.lifeplus.util.StringUtil;
|
|
|
|
|
|
/**
|
|
|
* WebDialog
|
|
|
@@ -69,7 +70,49 @@ public class PolicyDialog extends TextDialog<ICustomDialogListener<PolicyDialog>
|
|
|
.getView()
|
|
|
);
|
|
|
|
|
|
- TextView textView = root.findViewById(R.id.text_view);
|
|
|
- textView.setText(StringUtil.fromHtml(text));
|
|
|
+// TextView textView = root.findViewById(R.id.text_view);
|
|
|
+// textView.setText(StringUtil.fromHtml(text));
|
|
|
+
|
|
|
+ WebView webView = root.findViewById(R.id.web_view);
|
|
|
+ init(webView);
|
|
|
+ webView.setWebViewClient(new WebViewClient() {
|
|
|
+ @Override
|
|
|
+ public void onPageFinished(WebView view, String url) {
|
|
|
+// webView.loadUrl("javascript:document.body.style.margin=\"5%\"; void 0");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ text = "<style>\n" +
|
|
|
+ "body {\n" +
|
|
|
+ " padding-top: 5%;\n" +
|
|
|
+ " padding-left: 5%;\n" +
|
|
|
+ " padding-right: 5%;\n" +
|
|
|
+ "}\n" +
|
|
|
+ "</style>" + text;
|
|
|
+ webView.loadData(text, "text/html", "UTF-8");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void init(WebView webView) {
|
|
|
+ WebSettings settings = webView.getSettings();
|
|
|
+ // Javascript 사용하기
|
|
|
+ settings.setJavaScriptEnabled(true);
|
|
|
+ // WebView 내장 줌 사용여부
|
|
|
+ settings.setBuiltInZoomControls(false);
|
|
|
+ // 화면에 맞게 WebView 사이즈를 정의
|
|
|
+ settings.setLoadWithOverviewMode(false);
|
|
|
+ // ViewPort meta tag를 활성화 여부
|
|
|
+ settings.setUseWideViewPort(false);
|
|
|
+ // 줌 컨트롤 사용 여부
|
|
|
+ settings.setDisplayZoomControls(false);
|
|
|
+ // 사용자 제스처를 통한 줌 기능 활성화 여부
|
|
|
+ settings.setSupportZoom(false);
|
|
|
+ // TextEncoding 이름 정의
|
|
|
+ settings.setDefaultTextEncodingName("UTF-8");
|
|
|
+
|
|
|
+ // Setting Local Storage
|
|
|
+ settings.setDatabaseEnabled(true);
|
|
|
+ settings.setDomStorageEnabled(true);
|
|
|
+
|
|
|
+ // 캐쉬 사용 방법을 정의
|
|
|
+ settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
|
|
|
}
|
|
|
}
|