From d827ab1b366b73d72c5785c6238b200b6ae2f6e7 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Sat, 1 Mar 2014 14:17:55 -0800 Subject: [PATCH] more precise sms controls // FREEBIE --- ...rsation_item_sent_indicator_text_shape.xml | 18 ++++ ...on_item_sent_indicator_text_shape_dark.xml | 18 ++++ res/layout/conversation_item_sent.xml | 31 ++++++- res/layout/outgoing_sms_preference.xml | 44 ++++++++++ res/values-v11/styles.xml | 8 ++ res/values/attrs.xml | 1 + res/values/colors.xml | 2 +- res/values/strings.xml | 20 +++-- res/values/styles.xml | 9 ++ res/values/themes.xml | 3 +- res/xml/preferences.xml | 21 ++--- .../ApplicationPreferencesActivity.java | 86 ++++++++++--------- .../securesms/ConversationItem.java | 70 +++++++++++++-- .../PushContactSelectionListFragment.java | 2 +- .../components/OutgoingSmsPreference.java | 54 ++++++++++++ .../securesms/database/MmsDatabase.java | 9 ++ .../securesms/database/MmsSmsColumns.java | 28 ++++-- .../securesms/database/SmsDatabase.java | 8 ++ .../database/model/MessageRecord.java | 8 ++ .../securesms/service/MmsSender.java | 8 +- .../securesms/service/SendReceiveService.java | 4 +- .../securesms/service/SmsSender.java | 7 ++ .../securesms/transport/SmsTransport.java | 4 +- .../transport/UniversalTransport.java | 54 +++++++++--- .../UserInterventionRequiredException.java | 7 ++ .../securesms/util/ActionBarUtil.java | 4 +- .../securesms/util/TextSecurePreferences.java | 25 +++++- 27 files changed, 458 insertions(+), 95 deletions(-) create mode 100644 res/drawable/conversation_item_sent_indicator_text_shape.xml create mode 100644 res/drawable/conversation_item_sent_indicator_text_shape_dark.xml create mode 100644 res/layout/outgoing_sms_preference.xml create mode 100644 src/org/thoughtcrime/securesms/components/OutgoingSmsPreference.java create mode 100644 src/org/thoughtcrime/securesms/transport/UserInterventionRequiredException.java diff --git a/res/drawable/conversation_item_sent_indicator_text_shape.xml b/res/drawable/conversation_item_sent_indicator_text_shape.xml new file mode 100644 index 0000000000..48de08ba1e --- /dev/null +++ b/res/drawable/conversation_item_sent_indicator_text_shape.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/res/drawable/conversation_item_sent_indicator_text_shape_dark.xml b/res/drawable/conversation_item_sent_indicator_text_shape_dark.xml new file mode 100644 index 0000000000..9d1445bada --- /dev/null +++ b/res/drawable/conversation_item_sent_indicator_text_shape_dark.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/res/layout/conversation_item_sent.xml b/res/layout/conversation_item_sent.xml index 300a32cf3f..c47b194d74 100644 --- a/res/layout/conversation_item_sent.xml +++ b/res/layout/conversation_item_sent.xml @@ -18,9 +18,10 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:orientation="vertical" - android:gravity="right" + android:gravity="left|center_vertical" android:layout_marginLeft="6dp" - android:layout_alignParentLeft="true"> + android:layout_alignParentLeft="true" + android:layout_centerVertical="true"> + + + + diff --git a/res/layout/outgoing_sms_preference.xml b/res/layout/outgoing_sms_preference.xml new file mode 100644 index 0000000000..e5b8b3225e --- /dev/null +++ b/res/layout/outgoing_sms_preference.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml index e5a9a0dffe..e9557fb533 100644 --- a/res/values-v11/styles.xml +++ b/res/values-v11/styles.xml @@ -4,4 +4,12 @@ + + + + \ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index aae29431d1..3acaa308ad 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -37,6 +37,7 @@ + diff --git a/res/values/colors.xml b/res/values/colors.xml index 66eb21559a..99278ea4c3 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -30,4 +30,4 @@ #ff333333 #ffd5d5d5 #ff222222 - \ No newline at end of file + diff --git a/res/values/strings.xml b/res/values/strings.xml index 3fd10cf600..6f2418b7ab 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -32,9 +32,9 @@ You are not registered with the push service... Updating directory Updating push directory... - SMS Enabled + Incoming SMS Enabled Touch to change your default SMS app - SMS Disabled + Incoming SMS Disabled Touch to make TextSecure your default SMS app @@ -63,6 +63,8 @@ %1$s has left the group. %1$s have joined the group. %1$s has updated the group. + Tap for SMS fallback + Fallback to SMS? Initiate Secure Session? @@ -642,8 +644,9 @@ General - Use for all SMS - Use for all MMS + Push and SMS + Receive all SMS + Receive all MMS Use TextSecure for viewing and storing all incoming text messages Use TextSecure for viewing and storing all incoming multimedia messages Enable Enter key @@ -726,11 +729,16 @@ Increase privacy and avoid SMS fees by using the data channel for communication with other TextSecure users - SMS Fallback + Allow outgoing SMS to TextSecure is currently your default SMS app. Please set another default SMS app first to change this preference. - Send and receive SMS messages when push is not available Refresh Push Directory Submit debug log + TextSecure users + (ask first) + Send secure SMS if data connectivity is lost + Ask before sending SMS + Non-TextSecure users + Nobody diff --git a/res/values/styles.xml b/res/values/styles.xml index c4be38e5e1..a1732cd08d 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -107,4 +107,13 @@ + + + + + diff --git a/res/values/themes.xml b/res/values/themes.xml index 218a1ca000..dce9bbae41 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -39,6 +39,7 @@ @drawable/conversation_item_sent_triangle_shape @drawable/conversation_item_sent_push_shape @drawable/conversation_item_sent_push_triangle_shape + @drawable/conversation_item_sent_indicator_text_shape @drawable/ic_dialog_info_light @drawable/ic_dialog_alert_light @drawable/conversation_item_sent_pending_shape @@ -59,7 +60,6 @@ @drawable/ic_menu_split_holo_light @drawable/ic_menu_accept_holo_light @drawable/ic_menu_refresh_holo_light -