aboutsummaryrefslogtreecommitdiffstats
path: root/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2013-09-09 13:16:54 +0200
committerDominik Schürmann <dominik@dominikschuermann.de>2013-09-09 13:16:54 +0200
commit5b6880d2e34f4c8a4bfba87b5ce53d3c6727b744 (patch)
tree0e9c9f0c3b9cd9f0a7d5a15512a70b36001a87de /OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java
parent5dc693c64c14000a3a03903736d000a45795bcee (diff)
downloadopen-keychain-5b6880d2e34f4c8a4bfba87b5ce53d3c6727b744.tar.gz
open-keychain-5b6880d2e34f4c8a4bfba87b5ce53d3c6727b744.tar.bz2
open-keychain-5b6880d2e34f4c8a4bfba87b5ce53d3c6727b744.zip
Switch from HtmlSpanner to HtmlTextView
Diffstat (limited to 'OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java')
-rw-r--r--OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java29
1 files changed, 5 insertions, 24 deletions
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java
index 10adcc4ab..474e0a9e4 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/ShareNfcBeamActivity.java
@@ -17,12 +17,7 @@
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.htmltextview.HtmlTextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
@@ -42,8 +37,6 @@ import android.os.Handler;
import android.os.Message;
import android.os.Parcelable;
import android.provider.Settings;
-import android.text.method.LinkMovementMethod;
-import android.util.Log;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockFragmentActivity;
@@ -131,27 +124,15 @@ public class ShareNfcBeamActivity extends SherlockFragmentActivity implements
}
private void buildView() {
- // load html from html file from /res/raw
- InputStream inputStreamText = getResources().openRawResource(R.raw.nfc_beam_share);
-
setContentView(R.layout.share_nfc_beam);
- JellyBeanSpanFixTextView text = (JellyBeanSpanFixTextView) findViewById(R.id.nfc_beam_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);
- }
+ HtmlTextView aboutTextView = (HtmlTextView) findViewById(R.id.nfc_beam_text);
- // make links work
- text.setMovementMethod(LinkMovementMethod.getInstance());
+ // load html from raw resource (Parsing handled by HtmlTextView library)
+ aboutTextView.setHtmlFromRawResource(this, R.raw.nfc_beam_share);
// no flickering when clicking textview for Android < 4
- text.setTextColor(getResources().getColor(android.R.color.black));
+ aboutTextView.setTextColor(getResources().getColor(android.R.color.black));
// set actionbar without home button if called from another app
ActionBarHelper.setBackButton(this);