|
4 | 4 | import android.content.res.AssetManager; |
5 | 5 | import android.os.Bundle; |
6 | 6 | import android.support.v4.app.Fragment; |
7 | | -import android.util.Log; |
8 | 7 | import android.view.LayoutInflater; |
9 | 8 | import android.view.View; |
10 | 9 | import android.view.ViewGroup; |
|
15 | 14 | import android.webkit.WebView; |
16 | 15 | import android.webkit.WebViewClient; |
17 | 16 |
|
| 17 | +import org.wordpress.android.util.AppLog; |
| 18 | +import org.wordpress.android.util.AppLog.T; |
| 19 | + |
18 | 20 | import java.io.BufferedReader; |
19 | 21 | import java.io.IOException; |
20 | 22 | import java.io.InputStream; |
@@ -63,32 +65,31 @@ public void onDetach() { |
63 | 65 | super.onDetach(); |
64 | 66 | } |
65 | 67 |
|
66 | | - // TODO: use AppLog instead of Log |
67 | 68 | @SuppressLint("SetJavaScriptEnabled") |
68 | 69 | private void initWebView() { |
69 | 70 | WebSettings webSettings = mWebView.getSettings(); |
70 | 71 | webSettings.setJavaScriptEnabled(true); |
71 | 72 | webSettings.setDefaultTextEncodingName("utf-8"); |
72 | 73 | mWebView.setWebViewClient(new WebViewClient() { |
73 | 74 | public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { |
74 | | - Log.e("WordPress-Editor", description); |
| 75 | + AppLog.e(T.EDITOR, description); |
75 | 76 | } |
76 | 77 | }); |
77 | 78 | mWebView.setWebChromeClient(new WebChromeClient() { |
78 | 79 | public boolean onConsoleMessage(ConsoleMessage cm) { |
79 | | - Log.e("WordPress-Editor", cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId()); |
| 80 | + AppLog.e(T.EDITOR, cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId()); |
80 | 81 | return true; |
81 | 82 | } |
82 | 83 |
|
83 | 84 | @Override |
84 | 85 | public boolean onJsAlert(WebView view, String url, String message, JsResult result) { |
85 | | - Log.e("WordPress-Editor", message); |
| 86 | + AppLog.e(T.EDITOR, message); |
86 | 87 | return true; |
87 | 88 | } |
88 | 89 |
|
89 | 90 | @Override |
90 | 91 | public void onConsoleMessage(String message, int lineNumber, String sourceId) { |
91 | | - Log.e("WordPress-Editor", message + " -- from line " + lineNumber + " of " + sourceId); |
| 92 | + AppLog.e(T.EDITOR, message + " -- from line " + lineNumber + " of " + sourceId); |
92 | 93 | } |
93 | 94 | }); |
94 | 95 | String htmlEditor = getHtmlEditor(); |
@@ -117,7 +118,7 @@ private String getHtmlEditor() { |
117 | 118 | try { |
118 | 119 | return getStringFromAsset("android-editor.html"); |
119 | 120 | } catch (IOException e) { |
120 | | - Log.e("WordPress-Editor", e.getMessage()); |
| 121 | + AppLog.e(T.EDITOR, e.getMessage()); |
121 | 122 | return null; |
122 | 123 | } |
123 | 124 | } |
|
0 commit comments