From f10dd428bab50a05883a9f7f3d65db085e2e5359 Mon Sep 17 00:00:00 2001 From: Sam Whited Date: Tue, 4 Nov 2014 12:08:30 -0500 Subject: [PATCH] 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 95663a87..225091f9 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 00000000..a61b872a --- /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 994d1bd9..804b4e23 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 00000000..c1315b5a --- /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 00000000..3aeac9e7 --- /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 00000000..47c82246 --- /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 92918f1e..18863dff 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 adcde746..15a61e87 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" />