aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java
diff options
context:
space:
mode:
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java34
1 files changed, 6 insertions, 28 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java
index c4bab5734..ce932fd70 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/HelpFragmentHtml.java
@@ -17,20 +17,10 @@
package org.sufficientlysecure.keychain.ui;
-import java.io.IOException;
-import java.io.InputStream;
-
-import net.nightwhistler.htmlspanner.HtmlSpanner;
-import net.nightwhistler.htmlspanner.JellyBeanSpanFixTextView;
-
-import org.sufficientlysecure.keychain.Constants;
-import org.sufficientlysecure.keychain.helper.OtherHelper;
-import org.sufficientlysecure.keychain.util.Log;
-import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.htmltextview.HtmlTextView;
import android.app.Activity;
import android.os.Bundle;
-import android.text.method.LinkMovementMethod;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
@@ -73,15 +63,12 @@ public class HelpFragmentHtml extends SherlockFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- htmlFile = getArguments().getInt(ARG_HTML_FILE);
-
- // load html from html file from /res/raw
- InputStream inputStreamText = getResources().openRawResource(htmlFile);
-
mActivity = getActivity();
+
+ htmlFile = getArguments().getInt(ARG_HTML_FILE);
ScrollView scroller = new ScrollView(mActivity);
- JellyBeanSpanFixTextView text = new JellyBeanSpanFixTextView(mActivity);
+ HtmlTextView text = new HtmlTextView(mActivity);
// padding
int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mActivity
@@ -90,17 +77,8 @@ public class HelpFragmentHtml extends SherlockFragment {
scroller.addView(text);
- // load html into textview
- HtmlSpanner htmlSpanner = new HtmlSpanner();
- htmlSpanner.setStripExtraWhiteSpace(true);
- try {
- text.setText(htmlSpanner.fromHtml(inputStreamText));
- } catch (IOException e) {
- Log.e(Constants.TAG, "Error while reading raw resources as stream", e);
- }
-
- // make links work
- text.setMovementMethod(LinkMovementMethod.getInstance());
+ // load html from raw resource (Parsing handled by HtmlTextView library)
+ text.setHtmlFromRawResource(getActivity(), htmlFile);
// no flickering when clicking textview for Android < 4
text.setTextColor(getResources().getColor(android.R.color.black));