From df54ee75b4802107ed28019f2284154459b0e6f5 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 21 Oct 2014 22:53:30 -0400 Subject: [PATCH 1/7] Add about dialog with license info --- .../siacs/conversations/ui/AboutDialog.java | 33 +++++++++++++++++ src/main/res/values/strings.xml | 37 +++++++++++++++++++ src/main/res/xml/preferences.xml | 7 ++++ 3 files changed, 77 insertions(+) create mode 100644 src/eu/siacs/conversations/ui/AboutDialog.java diff --git a/src/eu/siacs/conversations/ui/AboutDialog.java b/src/eu/siacs/conversations/ui/AboutDialog.java new file mode 100644 index 000000000..994d1bd92 --- /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 0dbb49adb..640447747 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -254,6 +254,43 @@ Enables SSLv3 support for legacy servers. Warning: SSLv3 is considered insecure. Expert options Please be careful with these + About Conversations + Build and licensing information + + 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. + Increase font size Use larger font sizes across the entire app Send button indicates status diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index 06ab7560e..adcde7462 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" /> + + From 8bf40308c87ca62ef4b450c69c80202f09c3f80c Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Mon, 3 Nov 2014 08:44:19 -0500 Subject: [PATCH 2/7] Move AboutDialog to correct path --- src/{ => main/java}/eu/siacs/conversations/ui/AboutDialog.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{ => main/java}/eu/siacs/conversations/ui/AboutDialog.java (100%) diff --git a/src/eu/siacs/conversations/ui/AboutDialog.java b/src/main/java/eu/siacs/conversations/ui/AboutDialog.java similarity index 100% rename from src/eu/siacs/conversations/ui/AboutDialog.java rename to src/main/java/eu/siacs/conversations/ui/AboutDialog.java From 97b4b012d0128232f16988d7b8742ac5c50d3e48 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Mon, 3 Nov 2014 08:49:05 -0500 Subject: [PATCH 3/7] =?UTF-8?q?Use=20real=20copyright=20symbol=20=C2=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/res/values/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 640447747..92918f1ed 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -268,9 +268,9 @@ \n http://www.apache.org/licenses/LICENSE-2.0\n \n - Minidns (c) 2014 Rene Treffer and is provided under the WTFPL\n + Minidns © 2014 Rene Treffer and is provided under the WTFPL\n \n - MemorizingTrustManager Copyright (c) 2010 Georg Lukas\n + MemorizingTrustManager Copyright © 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 @@ -322,4 +322,4 @@ Scan QR code Show QR code Account details - \ No newline at end of file + From f10dd428bab50a05883a9f7f3d65db085e2e5359 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 4 Nov 2014 12:08:30 -0500 Subject: [PATCH 4/7] Convert about dialog to activity --- src/main/AndroidManifest.xml | 56 +++++++++++-------- .../siacs/conversations/ui/AboutActivity.java | 15 +++++ ...{AboutDialog.java => AboutPreference.java} | 20 +++++-- src/main/res/layout/activity_about.xml | 16 ++++++ src/main/res/values-w820dp/dimens.xml | 7 +++ src/main/res/values/dimens.xml | 5 ++ src/main/res/values/strings.xml | 22 ++++---- src/main/res/xml/preferences.xml | 8 +-- 8 files changed, 102 insertions(+), 47 deletions(-) create mode 100644 src/main/java/eu/siacs/conversations/ui/AboutActivity.java rename src/main/java/eu/siacs/conversations/ui/{AboutDialog.java => AboutPreference.java} (52%) create mode 100644 src/main/res/layout/activity_about.xml create mode 100644 src/main/res/values-w820dp/dimens.xml create mode 100644 src/main/res/values/dimens.xml diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 95663a872..225091f9d 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -19,10 +19,10 @@ android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/ConversationsTheme" - tools:replace="android:label"> - + tools:replace="android:label" > + - + @@ -31,10 +31,10 @@ + android:windowSoftInputMode="stateHidden" > @@ -42,9 +42,9 @@ + android:label="@string/title_activity_start_conversation" > @@ -63,38 +63,40 @@ + + + android:name=".ui.SettingsActivity" + android:label="@string/title_activity_settings" /> + android:name=".ui.ChooseContactActivity" + android:label="@string/title_activity_choose_contact" /> + android:label="@string/title_activity_manage_accounts" /> + android:name=".ui.EditAccountActivity" + android:windowSoftInputMode="stateHidden|adjustResize" /> + android:windowSoftInputMode="stateHidden" /> + android:windowSoftInputMode="stateHidden" /> + android:windowSoftInputMode="stateHidden" /> + android:name=".ui.ShareWithActivity" + android:label="@string/title_activity_conversations" > @@ -111,6 +113,14 @@ + + + diff --git a/src/main/java/eu/siacs/conversations/ui/AboutActivity.java b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java new file mode 100644 index 000000000..a61b872ae --- /dev/null +++ b/src/main/java/eu/siacs/conversations/ui/AboutActivity.java @@ -0,0 +1,15 @@ +package eu.siacs.conversations.ui; + +import android.app.Activity; +import android.os.Bundle; + +import eu.siacs.conversations.R; + +public class AboutActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + } +} diff --git a/src/main/java/eu/siacs/conversations/ui/AboutDialog.java b/src/main/java/eu/siacs/conversations/ui/AboutPreference.java similarity index 52% rename from src/main/java/eu/siacs/conversations/ui/AboutDialog.java rename to src/main/java/eu/siacs/conversations/ui/AboutPreference.java index 994d1bd92..804b4e230 100644 --- a/src/main/java/eu/siacs/conversations/ui/AboutDialog.java +++ b/src/main/java/eu/siacs/conversations/ui/AboutPreference.java @@ -1,23 +1,31 @@ package eu.siacs.conversations.ui; import android.content.Context; +import android.content.Intent; import android.content.pm.PackageManager; -import android.preference.DialogPreference; +import android.preference.Preference; import android.util.AttributeSet; -public class AboutDialog extends DialogPreference { - public AboutDialog(final Context context, final AttributeSet attrs, final int defStyle) { +public class AboutPreference extends Preference { + public AboutPreference(final Context context, final AttributeSet attrs, final int defStyle) { super(context, attrs, defStyle); setSummary(); } - public AboutDialog(final Context context, final AttributeSet attrs) { + public AboutPreference(final Context context, final AttributeSet attrs) { super(context, attrs); setSummary(); } - private void setSummary() { - if (getContext() != null &&getContext().getPackageManager() != null) { + @Override + protected void onClick() { + super.onClick(); + final Intent intent = new Intent(getContext(), AboutActivity.class); + getContext().startActivity(intent); + } + + private void setSummary() { + if (getContext() != null && getContext().getPackageManager() != null) { final String packageName = getContext().getPackageName(); final String versionName; try { diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml new file mode 100644 index 000000000..c1315b5ac --- /dev/null +++ b/src/main/res/layout/activity_about.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/src/main/res/values-w820dp/dimens.xml b/src/main/res/values-w820dp/dimens.xml new file mode 100644 index 000000000..3aeac9e75 --- /dev/null +++ b/src/main/res/values-w820dp/dimens.xml @@ -0,0 +1,7 @@ + + + 64dp + diff --git a/src/main/res/values/dimens.xml b/src/main/res/values/dimens.xml new file mode 100644 index 000000000..47c822467 --- /dev/null +++ b/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 92918f1ed..18863dffa 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -25,8 +25,8 @@ 1 min ago %d mins ago unread Conversations - sending… - Decrypting message. Please wait… + sending… + Decrypting message. Please wait… Nickname is already in use Admin Owner @@ -58,7 +58,7 @@ Add contact delivery failed rejected - Receiving image file. Please wait… + Receiving image file. Please wait… Preparing image for transmission Clear history Clear Conversation History @@ -78,8 +78,8 @@ Conversations utilizes a third party app called OpenKeychain to encrypt and decrypt messages and to manage your public keys.\n\nOpenKeychain is licensed under GPLv3 and available on F-Droid and Google Play.\n\n(Please restart Conversations afterwards.) Restart Install - offering… - waiting… + offering… + waiting… No OpenPGP Key found Conversations is unable to encrypt your messages because your contact is not announcing his or hers public key.\n\nPlease ask your contact to setup OpenPGP. No OpenPGP Keys found @@ -91,7 +91,7 @@ XMPP resource The name this client identifies itself with Accept files - Automatically accept files smaller than… + Automatically accept files smaller than… Notification Settings Notifications Notify when a new message arrives @@ -217,7 +217,7 @@ Publish Touch avatar to select picture from gallery Please note: Everyone subscribed to your presence updates will be allowed to see this picture. - Publishing… + Publishing… The server rejected your publication Something went wrong while converting your picture Could not save avatar to disk @@ -254,10 +254,9 @@ Enables SSLv3 support for legacy servers. Warning: SSLv3 is considered insecure. Expert options Please be careful with these - About Conversations + About Conversations Build and licensing information - - This program is free software; you can redistribute it and/or modify it + 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 @@ -289,8 +288,7 @@ 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. - + USE OR OTHER DEALINGS IN THE SOFTWARE. Increase font size Use larger font sizes across the entire app Send button indicates status diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index adcde7462..15a61e879 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -110,12 +110,8 @@ android:summary="@string/pref_never_send_crash_summary" android:title="@string/pref_never_send_crash" /> - - + android:title="@string/title_activity_about" /> From 55c81eaf15c4b950e71f553894efd1a54a434d49 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 4 Nov 2014 13:09:56 -0500 Subject: [PATCH 5/7] Make links clickable in about text --- src/main/res/layout/activity_about.xml | 4 +++- src/main/res/values/strings.xml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml index c1315b5ac..6e6799c6a 100644 --- a/src/main/res/layout/activity_about.xml +++ b/src/main/res/layout/activity_about.xml @@ -10,7 +10,9 @@ + android:layout_height="wrap_content" + android:linksClickable="true" /> diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 18863dffa..0f5a58992 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -256,16 +256,17 @@ Please be careful with these About Conversations Build and licensing information - This program is free software; you can redistribute it and/or modify it + + 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 + https://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 + https://www.apache.org/licenses/LICENSE-2.0\n \n Minidns © 2014 Rene Treffer and is provided under the WTFPL\n \n From 7b67f1a19cd99403b1215c577b5ed5e378df32fe Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 4 Nov 2014 13:17:15 -0500 Subject: [PATCH 6/7] Use normal text size and color --- src/main/res/layout/activity_about.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml index 6e6799c6a..fb9959f74 100644 --- a/src/main/res/layout/activity_about.xml +++ b/src/main/res/layout/activity_about.xml @@ -1,6 +1,7 @@ + android:linksClickable="true" + android:textColor="@color/primarytext" + android:textSize="?attr/TextSizeBody" /> From df786cbf0114d49974f46433740e5ac89a00d63a Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 4 Nov 2014 13:26:48 -0500 Subject: [PATCH 7/7] Shorten license text and fix height of scrollview --- src/main/res/layout/activity_about.xml | 4 ++-- src/main/res/values/strings.xml | 23 +++++------------------ 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/src/main/res/layout/activity_about.xml b/src/main/res/layout/activity_about.xml index fb9959f74..06a4992a1 100644 --- a/src/main/res/layout/activity_about.xml +++ b/src/main/res/layout/activity_about.xml @@ -6,8 +6,8 @@ android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" - android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_width="fill_parent" + android:layout_height="fill_parent"> + http://opensource.org/licenses/MIT\n + Increase font size Use larger font sizes across the entire app Send button indicates status