aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-10-21 22:53:30 -0400
committerSam Whited <sam@samwhited.com>2014-11-04 12:47:58 -0500
commitdf54ee75b4802107ed28019f2284154459b0e6f5 (patch)
tree94cab8e2a809c8523b45c20adc0ac682ca0a6e88
parentff10b094a0a210bb1c7745bd0e0f92e9a7e3ec2d (diff)
Add about dialog with license info
-rw-r--r--src/eu/siacs/conversations/ui/AboutDialog.java33
-rw-r--r--src/main/res/values/strings.xml37
-rw-r--r--src/main/res/xml/preferences.xml7
3 files changed, 77 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/AboutDialog.java b/src/eu/siacs/conversations/ui/AboutDialog.java
new file mode 100644
index 00000000..994d1bd9
--- /dev/null
+++ b/src/eu/siacs/conversations/ui/AboutDialog.java
@@ -0,0 +1,33 @@
+package eu.siacs.conversations.ui;
+
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.preference.DialogPreference;
+import android.util.AttributeSet;
+
+public class AboutDialog extends DialogPreference {
+ public AboutDialog(final Context context, final AttributeSet attrs, final int defStyle) {
+ super(context, attrs, defStyle);
+ setSummary();
+ }
+
+ public AboutDialog(final Context context, final AttributeSet attrs) {
+ super(context, attrs);
+ setSummary();
+ }
+
+ private void setSummary() {
+ if (getContext() != null &&getContext().getPackageManager() != null) {
+ final String packageName = getContext().getPackageName();
+ final String versionName;
+ try {
+ versionName = getContext().getPackageManager().getPackageInfo(packageName, 0).versionName;
+ setSummary("Conversations " + versionName);
+ } catch (final PackageManager.NameNotFoundException e) {
+ // Using try/catch as part of the logic is sort of like this:
+ // https://xkcd.com/292/
+ }
+ }
+ }
+}
+
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 0dbb49ad..64044774 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -254,6 +254,43 @@
<string name="pref_enable_legacy_ssl_summary">Enables SSLv3 support for legacy servers. Warning: SSLv3 is considered insecure.</string>
<string name="pref_expert_options">Expert options</string>
<string name="pref_expert_options_summary">Please be careful with these</string>
+ <string name="pref_about_conversations">About Conversations</string>
+ <string name="pref_about_conversations_summary">Build and licensing information</string>
+ <string name="pref_about_message">
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License version 3 as published
+ by the Free Software Foundation.\n
+ \n
+ Link: http://www.gnu.org/licenses/gpl-3.0.html\n
+ \n
+ OpenPGP API is licensed under the Apache License, Version 2.0; You may
+ obtain a copy of the License at:\n
+ \n
+ http://www.apache.org/licenses/LICENSE-2.0\n
+ \n
+ Minidns (c) 2014 Rene Treffer and is provided under the WTFPL\n
+ \n
+ MemorizingTrustManager Copyright (c) 2010 Georg Lukas\n
+ \n
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to permit
+ persons to whom the Software is furnished to do so, subject to the
+ following conditions:\n
+ \n
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.\n
+ \n
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+ NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
+ </string>
<string name="pref_use_larger_font">Increase font size</string>
<string name="pref_use_larger_font_summary">Use larger font sizes across the entire app</string>
<string name="pref_use_send_button_to_indicate_status">Send button indicates status</string>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index 06ab7560..adcde746 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -110,5 +110,12 @@
android:summary="@string/pref_never_send_crash_summary"
android:title="@string/pref_never_send_crash" />
</PreferenceCategory>
+ <eu.siacs.conversations.ui.AboutDialog
+ android:summary="@string/pref_about_conversations_summary"
+ android:title="@string/pref_about_conversations"
+ android:dialogIcon="@drawable/ic_activity"
+ android:negativeButtonText="@null"
+ android:dialogMessage="@string/pref_about_message">
+ </eu.siacs.conversations.ui.AboutDialog>
</PreferenceScreen>