From b3a599f214489ba9edce5b8c3f56b3f671499e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 23 Mar 2015 01:11:11 +0100 Subject: Use markdown for in-app help --- .../sufficientlysecure/keychain/ui/HelpAboutFragment.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java index 5909970af..912caf32f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java @@ -27,11 +27,14 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import org.markdown4j.Markdown4jProcessor; import org.sufficientlysecure.htmltextview.HtmlTextView; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.util.Log; +import java.io.IOException; + public class HelpAboutFragment extends Fragment { @@ -44,8 +47,14 @@ public class HelpAboutFragment extends Fragment { HtmlTextView aboutTextView = (HtmlTextView) view.findViewById(R.id.help_about_text); - // load html from raw resource (Parsing handled by HtmlTextView library) - aboutTextView.setHtmlFromRawResource(getActivity(), R.raw.help_about, true); + // load mardown from raw resource + try { + String html = new Markdown4jProcessor().process( + getActivity().getResources().openRawResource(R.raw.help_about)); + aboutTextView.setHtmlFromString(html, true); + } catch (IOException e) { + Log.e(Constants.TAG, "IOException", e); + } // no flickering when clicking textview for Android < 4 aboutTextView.setTextColor(getResources().getColor(android.R.color.black)); -- cgit v1.2.3