From 460f0d5f3346d14ad11821d15cd4828d6cf91046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 3 Aug 2015 19:09:59 +0200 Subject: Update libs --- .../keychain/ui/HelpAboutFragment.java | 4 ++-- .../keychain/ui/HelpMarkdownFragment.java | 21 ++++++++------------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure') 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 ac4b94d64..acbb695df 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpAboutFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Dominik Schürmann + * Copyright (C) 2012-2015 Dominik Schürmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ public class HelpAboutFragment extends Fragment { try { String html = new Markdown4jProcessor().process( getActivity().getResources().openRawResource(R.raw.help_about)); - aboutTextView.setHtmlFromString(html, true); + aboutTextView.setHtmlFromString(html, new HtmlTextView.LocalImageGetter()); } catch (IOException e) { Log.e(Constants.TAG, "IOException", e); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpMarkdownFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpMarkdownFragment.java index 97d39feb1..73ce7e03e 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpMarkdownFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/HelpMarkdownFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2014 Dominik Schürmann + * Copyright (C) 2012-2015 Dominik Schürmann * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,6 @@ package org.sufficientlysecure.keychain.ui; -import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.TypedValue; @@ -34,9 +33,6 @@ import org.sufficientlysecure.keychain.util.Log; import java.io.IOException; public class HelpMarkdownFragment extends Fragment { - private Activity mActivity; - - private int mHtmlFile; public static final String ARG_MARKDOWN_RES = "htmlFile"; @@ -56,15 +52,13 @@ public class HelpMarkdownFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - mActivity = getActivity(); - - mHtmlFile = getArguments().getInt(ARG_MARKDOWN_RES); + int mHtmlFile = getArguments().getInt(ARG_MARKDOWN_RES); - ScrollView scroller = new ScrollView(mActivity); - HtmlTextView text = new HtmlTextView(mActivity); + ScrollView scroller = new ScrollView(getActivity()); + HtmlTextView text = new HtmlTextView(getActivity()); // padding - int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mActivity + int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, getActivity() .getResources().getDisplayMetrics()); text.setPadding(padding, padding, padding, 0); @@ -72,8 +66,9 @@ public class HelpMarkdownFragment extends Fragment { // load markdown from raw resource try { - String html = new Markdown4jProcessor().process(getActivity().getResources().openRawResource(mHtmlFile)); - text.setHtmlFromString(html, true); + String html = new Markdown4jProcessor().process( + getActivity().getResources().openRawResource(mHtmlFile)); + text.setHtmlFromString(html, new HtmlTextView.LocalImageGetter()); } catch (IOException e) { Log.e(Constants.TAG, "IOException", e); } -- cgit v1.2.3