better help screen

This commit is contained in:
Dominik
2012-10-31 18:58:10 +01:00
parent 586358599e
commit 182524bb96
8 changed files with 117 additions and 73 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -51,7 +51,7 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView <net.nightwhistler.htmlspanner.JellyBeanSpanFixTextView
android:id="@+id/help_about_text" android:id="@+id/help_about_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@@ -6,15 +6,26 @@ And don't add newlines before or after p tags because of transifex -->
</head> </head>
<body> <body>
<p><a href="https://github.com/dschuermann/apg">https://github.com/dschuermann/apg</a></p> <p><a href="https://github.com/dschuermann/apg">https://github.com/dschuermann/apg</a></p>
<p>Android Privacy Guard (APG) is a OpenPGP implementation for Android.</p> <p>Android Privacy Guard (APG) is an OpenPGP implementation for Android.</p>
<p>License: Apache License v2</p> <p>License: Apache License v2</p>
<p>Developer: Thialfihar (Main developer v1.x), Senecaso (QRCode, sign key, upload key), Markus Doits (AIDL), Oliver Runge, Dominik Schürmann (Developer v2.x)</p>
<h2>Developer</h2>
<ul>
<li>Thialfihar (Main developer v1.x)</li>
<li>Senecaso (QRCode, sign key, upload key)</li>
<li>Markus Doits (AIDL)</li>
<li>Oliver Runge</li>
<li>Dominik Schürmann (Developer v2.x)</li>
</ul>
<h2>Libraries</h2> <h2>Libraries</h2>
<p><a href="http://actionbarsherlock.com/">ActionBarSherlock</a> (Apache License v2) <ul>
<br/><a href="http://code.google.com/p/zxing/">ZXing QRCode Integration</a> (Apache License v2) <li><a href="http://actionbarsherlock.com">ActionBarSherlock</a> (Apache License v2)</li>
<br/><a href="https://github.com/rtyley/spongycastle">SpongyCastle</a> (MIT X11 License) <li><a href="http://code.google.com/p/zxing/">ZXing QRCode Integration</a> (Apache License v2)</li>
<br/>• Icons from <a href="http://rrze-icon-set.berlios.de/">RRZE Icon Set</a> (Creative Commons Attribution Share-Alike licence 3.0) <li><a href="http://rtyley.github.com/spongycastle/">SpongyCastle</a> (MIT X11 License)</li>
<br/>• Icons from <a href="http://tango.freedesktop.org/">Tango Icon Set</a> (Public Domain)</p> <li><a href="https://github.com/dschuermann/HtmlSpanner">HtmlSpanner Fork</a> (Apache License v2)</li>
<li>Icons from <a href="http://rrze-icon-set.berlios.de/">RRZE Icon Set</a> (Creative Commons Attribution Share-Alike licence 3.0)</li>
<li>Icons from <a href="http://tango.freedesktop.org/">Tango Icon Set</a> (Public Domain)</li>
</ul>
</body> </body>
</html> </html>

View File

@@ -6,61 +6,81 @@ And don't add newlines before or after p tags because of transifex -->
</head> </head>
<body> <body>
<h2>2.0</h2> <h2>2.0</h2>
<p>* Complete redesign <ul>
<br/>* Integration of different branches: <li>Complete redesign</li>
<br/>* Share public keys via qr codes <li>Integration of different branches:</li>
<br/>* Sign keys <li>Share public keys via qr codes</li>
<br/>* Upload keys to server</p> <li>Sign keys</li>
<li>Upload keys to server</li>
</ul>
<h2><h2>1.08</h2> <h2><h2>1.08</h2>
<p>* basic key server support <ul>
<br/>* app2sd (untested, let me know if there are problems) <li>basic key server support</li>
<br/>* more choices for pass phrase cache: 1, 2, 4, 8, hours <li>app2sd (untested, let me know if there are problems)</li>
<br/>* translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick) <li>more choices for pass phrase cache: 1, 2, 4, 8, hours</li>
<br/>* bugfixes <li>translations: Norwegian (thanks, Sander Danielsen), Chinese (thanks, Zhang Fredrick)</li>
<br/>* optimizations</p> <li>bugfixes</li>
<li>optimizations</li>
</ul>
<h2>1.0.7</h2> <h2>1.0.7</h2>
<p>* clear sign problem with lacking trailing newline fixed <ul>
<br/>* more options for pass phrase cache time to live (20, 40, 60 mins)</p> <li>clear sign problem with lacking trailing newline fixed</li>
<li>more options for pass phrase cache time to live (20, 40, 60 mins)</li>
</ul>
<h2>1.0.6</h2> <h2>1.0.6</h2>
<p>* account adding crash on Froyo fixed <ul>
<br/>* secure file deletion <li>account adding crash on Froyo fixed</li>
<br/>* option to delete key file after import <li>secure file deletion</li>
<br/>* stream encryption/decryption (gallery, etc.) <li>option to delete key file after import</li>
<br/>* new options (language, force v3 signatures) <li>stream encryption/decryption (gallery, etc.)</li>
<br/>* interface changes <li>new options (language, force v3 signatures)</li>
<br/>* bugfixes</p> <li>interface changes</li>
<li>bugfixes</li>
</ul>
<h2>1.0.5</h2> <h2>1.0.5</h2>
<p>* German and Italian translation <ul>
<br/>* much smaller package, due to reduced BC sources <li>German and Italian translation</li>
<br/>* new preferences GUI <li>much smaller package, due to reduced BC sources</li>
<br/>* layout adjustment for localization <li>new preferences GUI</li>
<br/>* signature bugfix</p> <li>layout adjustment for localization</li>
<li>signature bugfix</li>
</ul>
<h2>1.0.4</h2> <h2>1.0.4</h2>
<p>* fixed another crash caused by some SDK bug with query builder</p> <ul>
<li>fixed another crash caused by some SDK bug with query builder</li>
</ul>
<h2>1.0.3</h2> <h2>1.0.3</h2>
<p>* fixed crashes during encryption/signing and possibly key export</p> <ul>
<li>fixed crashes during encryption/signing and possibly key export</li>
</ul>
<h2>1.0.2</h2> <h2>1.0.2</h2>
<p>* filterable key lists <ul>
<br/>* smarter preselection of encryption keys <li>filterable key lists</li>
<br/>* new Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers <li>smarter preselection of encryption keys</li>
<br/>* fixes and additional features (key preselection) for k9, new beta build available</p> <li>new Intent handling for VIEW and SEND, allows files to be encrypted/decrypted out of file managers</li>
<li>fixes and additional features (key preselection) for k9, new beta build available</li>
</ul>
<h2>1.0.1</h2> <h2>1.0.1</h2>
<p>* GMail account listing was broken in 1.0.0, fixed again</p> <ul>
<li>GMail account listing was broken in 1.0.0, fixed again</li>
</ul>
<h2>1.0.0</h2> <h2>1.0.0</h2>
<p>* k9mail integration, APG supporting beta build of k9mail <ul>
<br/>* support of more file managers (including ASTRO) <li>k9mail integration, APG supporting beta build of k9mail</li>
<br/>* Slovenian translation <li>support of more file managers (including ASTRO)</li>
<br/>* new database, much faster, less memory usage <li>Slovenian translation</li>
<br/>* defined Intents and content provider for other apps <li>new database, much faster, less memory usage</li>
<br/>* bugfixes</p> <li>defined Intents and content provider for other apps</li>
<li>bugfixes</li>
</ul>
</body> </body>
</html> </html>

View File

@@ -36,30 +36,17 @@ import android.os.Bundle;
public class OtherHelper { public class OtherHelper {
/** /**
* Reads html files from /res/raw/example.html to output them as string. See * Gets input stream of raw resource
* http://www.monocube.com/2011/02/08/android-tutorial-html-file-in-webview/
* *
* @param context * @param context
* current context * current context
* @param resourceID * @param resourceID
* of html file to read * of html file to read
* @return content of html file with formatting * @return input stream of resource
*/ */
public static String readContentFromResource(Context context, int resourceID) { public static InputStream getInputStreamFromResource(Context context, int resourceID) {
InputStream raw = context.getResources().openRawResource(resourceID); InputStream raw = context.getResources().openRawResource(resourceID);
ByteArrayOutputStream stream = new ByteArrayOutputStream(); return raw;
int i;
try {
i = raw.read();
while (i != -1) {
stream.write(i);
i = raw.read();
}
raw.close();
} catch (IOException e) {
e.printStackTrace();
}
return stream.toString();
} }
/** /**
@@ -147,7 +134,7 @@ public class OtherHelper {
output[1] = "<" + chunks[1]; output[1] = "<" + chunks[1];
} }
output[0] = userId; output[0] = userId;
return output; return output;
} }

View File

@@ -16,6 +16,12 @@
package org.thialfihar.android.apg.ui; package org.thialfihar.android.apg.ui;
import java.io.IOException;
import java.io.InputStream;
import net.nightwhistler.htmlspanner.HtmlSpanner;
import net.nightwhistler.htmlspanner.JellyBeanSpanFixTextView;
import org.thialfihar.android.apg.Constants; import org.thialfihar.android.apg.Constants;
import org.thialfihar.android.apg.R; import org.thialfihar.android.apg.R;
import org.thialfihar.android.apg.helper.OtherHelper; import org.thialfihar.android.apg.helper.OtherHelper;
@@ -24,7 +30,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle; import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import org.thialfihar.android.apg.util.Log; import org.thialfihar.android.apg.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@@ -52,15 +57,23 @@ public class HelpFragmentAbout extends SherlockFragment {
View view = inflater.inflate(R.layout.help_fragment_about, container, false); View view = inflater.inflate(R.layout.help_fragment_about, container, false);
// load html from html file from /res/raw // load html from html file from /res/raw
String aboutText = OtherHelper.readContentFromResource(this.getActivity(), R.raw.help_about); InputStream inputStreamText = OtherHelper.getInputStreamFromResource(this.getActivity(),
R.raw.help_about);
TextView versionText = (TextView) view.findViewById(R.id.help_about_version); TextView versionText = (TextView) view.findViewById(R.id.help_about_version);
versionText.setText(getString(R.string.help_about_version) + " " + getVersion()); versionText.setText(getString(R.string.help_about_version) + " " + getVersion());
TextView aboutTextView = (TextView) view.findViewById(R.id.help_about_text); JellyBeanSpanFixTextView aboutTextView = (JellyBeanSpanFixTextView) view
.findViewById(R.id.help_about_text);
// load html into textview // load html into textview
aboutTextView.setText(Html.fromHtml(aboutText)); HtmlSpanner htmlSpanner = new HtmlSpanner();
htmlSpanner.setStripExtraWhiteSpace(true);
try {
aboutTextView.setText(htmlSpanner.fromHtml(inputStreamText));
} catch (IOException e) {
Log.e(Constants.TAG, "Error while reading raw resources as stream", e);
}
// make links work // make links work
aboutTextView.setMovementMethod(LinkMovementMethod.getInstance()); aboutTextView.setMovementMethod(LinkMovementMethod.getInstance());

View File

@@ -16,18 +16,24 @@
package org.thialfihar.android.apg.ui; package org.thialfihar.android.apg.ui;
import java.io.IOException;
import java.io.InputStream;
import net.nightwhistler.htmlspanner.HtmlSpanner;
import net.nightwhistler.htmlspanner.JellyBeanSpanFixTextView;
import org.thialfihar.android.apg.Constants;
import org.thialfihar.android.apg.helper.OtherHelper; import org.thialfihar.android.apg.helper.OtherHelper;
import org.thialfihar.android.apg.util.Log;
import android.app.Activity; import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.app.SherlockFragment;
@@ -68,12 +74,13 @@ public class HelpFragmentHtml extends SherlockFragment {
htmlFile = getArguments().getInt(ARG_HTML_FILE); htmlFile = getArguments().getInt(ARG_HTML_FILE);
// load html from html file from /res/raw // load html from html file from /res/raw
String helpText = OtherHelper.readContentFromResource(this.getActivity(), htmlFile); InputStream inputStreamText = OtherHelper.getInputStreamFromResource(this.getActivity(),
htmlFile);
mActivity = getActivity(); mActivity = getActivity();
ScrollView scroller = new ScrollView(mActivity); ScrollView scroller = new ScrollView(mActivity);
TextView text = new TextView(mActivity); JellyBeanSpanFixTextView text = new JellyBeanSpanFixTextView(mActivity);
// padding // padding
int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mActivity int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, mActivity
@@ -83,7 +90,13 @@ public class HelpFragmentHtml extends SherlockFragment {
scroller.addView(text); scroller.addView(text);
// load html into textview // load html into textview
text.setText(Html.fromHtml(helpText)); 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 // make links work
text.setMovementMethod(LinkMovementMethod.getInstance()); text.setMovementMethod(LinkMovementMethod.getInstance());