diff --git a/artwork/ic_send.psd b/artwork/ic_send.psd new file mode 100644 index 0000000000..09dc6f47ef Binary files /dev/null and b/artwork/ic_send.psd differ diff --git a/res/drawable-hdpi/ic_send_encrypted_holo_light.png b/res/drawable-hdpi/ic_send_encrypted_holo_light.png deleted file mode 100644 index 9bd318868f..0000000000 Binary files a/res/drawable-hdpi/ic_send_encrypted_holo_light.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_send_holo_dark.png b/res/drawable-hdpi/ic_send_holo_dark.png deleted file mode 100644 index 9f78ca3fb8..0000000000 Binary files a/res/drawable-hdpi/ic_send_holo_dark.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_send_holo_dark_encrypted.png b/res/drawable-hdpi/ic_send_holo_dark_encrypted.png deleted file mode 100644 index 92e142105d..0000000000 Binary files a/res/drawable-hdpi/ic_send_holo_dark_encrypted.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_send_holo_light.png b/res/drawable-hdpi/ic_send_holo_light.png deleted file mode 100644 index 56bc9987a7..0000000000 Binary files a/res/drawable-hdpi/ic_send_holo_light.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_send_push.png b/res/drawable-hdpi/ic_send_push.png new file mode 100644 index 0000000000..ae53056bec Binary files /dev/null and b/res/drawable-hdpi/ic_send_push.png differ diff --git a/res/drawable-hdpi/ic_send_sms_insecure.png b/res/drawable-hdpi/ic_send_sms_insecure.png new file mode 100644 index 0000000000..d3165508e9 Binary files /dev/null and b/res/drawable-hdpi/ic_send_sms_insecure.png differ diff --git a/res/drawable-hdpi/ic_send_sms_insecure_dark.png b/res/drawable-hdpi/ic_send_sms_insecure_dark.png new file mode 100644 index 0000000000..0e7fb1184a Binary files /dev/null and b/res/drawable-hdpi/ic_send_sms_insecure_dark.png differ diff --git a/res/drawable-hdpi/ic_send_sms_secure.png b/res/drawable-hdpi/ic_send_sms_secure.png new file mode 100644 index 0000000000..8237b27bd2 Binary files /dev/null and b/res/drawable-hdpi/ic_send_sms_secure.png differ diff --git a/res/drawable-mdpi/ic_send_encrypted_holo_light.png b/res/drawable-mdpi/ic_send_encrypted_holo_light.png deleted file mode 100644 index f5bea488c8..0000000000 Binary files a/res/drawable-mdpi/ic_send_encrypted_holo_light.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_send_holo_dark.png b/res/drawable-mdpi/ic_send_holo_dark.png deleted file mode 100644 index e44bc78f3c..0000000000 Binary files a/res/drawable-mdpi/ic_send_holo_dark.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_send_holo_dark_encrypted.png b/res/drawable-mdpi/ic_send_holo_dark_encrypted.png deleted file mode 100644 index 78729f5ef5..0000000000 Binary files a/res/drawable-mdpi/ic_send_holo_dark_encrypted.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_send_holo_light.png b/res/drawable-mdpi/ic_send_holo_light.png deleted file mode 100644 index a761fe40d1..0000000000 Binary files a/res/drawable-mdpi/ic_send_holo_light.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_send_push.png b/res/drawable-mdpi/ic_send_push.png new file mode 100644 index 0000000000..2066dd929b Binary files /dev/null and b/res/drawable-mdpi/ic_send_push.png differ diff --git a/res/drawable-mdpi/ic_send_sms_insecure.png b/res/drawable-mdpi/ic_send_sms_insecure.png new file mode 100644 index 0000000000..a13794c779 Binary files /dev/null and b/res/drawable-mdpi/ic_send_sms_insecure.png differ diff --git a/res/drawable-mdpi/ic_send_sms_insecure_dark.png b/res/drawable-mdpi/ic_send_sms_insecure_dark.png new file mode 100644 index 0000000000..d9a8c20356 Binary files /dev/null and b/res/drawable-mdpi/ic_send_sms_insecure_dark.png differ diff --git a/res/drawable-mdpi/ic_send_sms_secure.png b/res/drawable-mdpi/ic_send_sms_secure.png new file mode 100644 index 0000000000..63f3cfd918 Binary files /dev/null and b/res/drawable-mdpi/ic_send_sms_secure.png differ diff --git a/res/drawable-xhdpi/ic_send_encrypted_holo_light.png b/res/drawable-xhdpi/ic_send_encrypted_holo_light.png deleted file mode 100644 index efd9f5239b..0000000000 Binary files a/res/drawable-xhdpi/ic_send_encrypted_holo_light.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_send_holo_dark.png b/res/drawable-xhdpi/ic_send_holo_dark.png deleted file mode 100644 index 077e0b026e..0000000000 Binary files a/res/drawable-xhdpi/ic_send_holo_dark.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_send_holo_dark_encrypted.png b/res/drawable-xhdpi/ic_send_holo_dark_encrypted.png deleted file mode 100644 index aa12709118..0000000000 Binary files a/res/drawable-xhdpi/ic_send_holo_dark_encrypted.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_send_holo_light.png b/res/drawable-xhdpi/ic_send_holo_light.png deleted file mode 100644 index 6b9ea91380..0000000000 Binary files a/res/drawable-xhdpi/ic_send_holo_light.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_send_push.png b/res/drawable-xhdpi/ic_send_push.png new file mode 100644 index 0000000000..89cfd5719c Binary files /dev/null and b/res/drawable-xhdpi/ic_send_push.png differ diff --git a/res/drawable-xhdpi/ic_send_sms_insecure.png b/res/drawable-xhdpi/ic_send_sms_insecure.png new file mode 100644 index 0000000000..3b4fcd20c6 Binary files /dev/null and b/res/drawable-xhdpi/ic_send_sms_insecure.png differ diff --git a/res/drawable-xhdpi/ic_send_sms_insecure_dark.png b/res/drawable-xhdpi/ic_send_sms_insecure_dark.png new file mode 100644 index 0000000000..ae2c31f88f Binary files /dev/null and b/res/drawable-xhdpi/ic_send_sms_insecure_dark.png differ diff --git a/res/drawable-xhdpi/ic_send_sms_secure.png b/res/drawable-xhdpi/ic_send_sms_secure.png new file mode 100644 index 0000000000..b278bbd76f Binary files /dev/null and b/res/drawable-xhdpi/ic_send_sms_secure.png differ diff --git a/res/drawable-xxhdpi/ic_send_push.png b/res/drawable-xxhdpi/ic_send_push.png new file mode 100644 index 0000000000..d007be72bb Binary files /dev/null and b/res/drawable-xxhdpi/ic_send_push.png differ diff --git a/res/drawable-xxhdpi/ic_send_sms_insecure.png b/res/drawable-xxhdpi/ic_send_sms_insecure.png new file mode 100644 index 0000000000..44845e6e8a Binary files /dev/null and b/res/drawable-xxhdpi/ic_send_sms_insecure.png differ diff --git a/res/drawable-xxhdpi/ic_send_sms_insecure_dark.png b/res/drawable-xxhdpi/ic_send_sms_insecure_dark.png new file mode 100644 index 0000000000..e0b2078748 Binary files /dev/null and b/res/drawable-xxhdpi/ic_send_sms_insecure_dark.png differ diff --git a/res/drawable-xxhdpi/ic_send_sms_secure.png b/res/drawable-xxhdpi/ic_send_sms_secure.png new file mode 100644 index 0000000000..4bcbfd5df1 Binary files /dev/null and b/res/drawable-xxhdpi/ic_send_sms_secure.png differ diff --git a/res/layout/conversation_activity.xml b/res/layout/conversation_activity.xml index 8c83acbd0b..95d339b634 100644 --- a/res/layout/conversation_activity.xml +++ b/res/layout/conversation_activity.xml @@ -111,7 +111,7 @@ android:contentDescription="@string/conversation_activity__send" android:nextFocusLeft="@+id/embedded_text_editor" android:padding="12dp" - android:src="?conversation_send_button" + android:src="?conversation_send_button_sms_insecure" android:clickable="false" android:enabled="false" /> diff --git a/res/values/attrs.xml b/res/values/attrs.xml index f751fe3ea9..4379a43aae 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -23,8 +23,9 @@ - - + + + diff --git a/res/values/themes.xml b/res/values/themes.xml index 5d56fa1aef..2dbc94b835 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -30,8 +30,9 @@ #ffdddddd @drawable/textlines #ff111111 - @drawable/ic_send_holo_light - @drawable/ic_send_encrypted_holo_light + @drawable/ic_send_push + @drawable/ic_send_sms_secure + @drawable/ic_send_sms_insecure @drawable/ic_sms_mms_delivered_light @drawable/ic_emoji_dark @drawable/ic_ime_dark @@ -116,8 +117,9 @@ @color/black @drawable/textlines_dark #ffeeeeee - @drawable/ic_send_holo_dark - @drawable/ic_send_holo_dark_encrypted + @drawable/ic_send_push + @drawable/ic_send_sms_secure + @drawable/ic_send_sms_insecure_dark @drawable/ic_sms_mms_delivered_dark @drawable/ic_emoji_light @drawable/ic_ime_light diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index dbe81be711..3cfd374555 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -148,6 +148,10 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi private static final int PICK_CONTACT_INFO = 5; private static final int GROUP_EDIT = 6; + private static final int SEND_ATTRIBUTES[] = new int[]{R.attr.conversation_send_button_push, + R.attr.conversation_send_button_sms_secure, + R.attr.conversation_send_button_sms_insecure}; + private MasterSecret masterSecret; private RecipientsPanel recipientsPanel; private EditText composeText; @@ -673,26 +677,31 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi } private void initializeSecurity() { - int attributes[] = new int[]{R.attr.conversation_send_button, - R.attr.conversation_send_secure_button}; - TypedArray drawables = obtainStyledAttributes(attributes); - if (isPushDestination() || (getRecipients() != null && getRecipients().isGroupRecipient()) || + TypedArray drawables = obtainStyledAttributes(SEND_ATTRIBUTES); + if ((getRecipients() != null && getRecipients().isGroupRecipient()) || (isSingleConversation() && Session.hasSession(this, masterSecret, getRecipients().getPrimaryRecipient()))) { - sendButton.setImageDrawable(drawables.getDrawable(1)); this.isEncryptedConversation = true; this.isAuthenticatedConversation = Session.hasRemoteIdentityKey(this, masterSecret, getRecipients().getPrimaryRecipient()); this.characterCalculator = new EncryptedCharacterCalculator(); } else { - sendButton.setImageDrawable(drawables.getDrawable(0)); this.isEncryptedConversation = false; this.isAuthenticatedConversation = false; this.characterCalculator = new CharacterCalculator(); } - calculateCharactersRemaining(); + if (isPushDestination()) { + sendButton.setImageDrawable(drawables.getDrawable(0)); + } else if (isEncryptedConversation) { + sendButton.setImageDrawable(drawables.getDrawable(1)); + } else { + sendButton.setImageDrawable(drawables.getDrawable(2)); + } + drawables.recycle(); + + calculateCharactersRemaining(); } private void initializeMmsEnabledCheck() { @@ -769,6 +778,7 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi composeText.setText(getString(R.string.ConversationActivity_forward_message_prefix) + ": " + getIntent().getStringExtra("forwarded_message")); } + } private void initializeRecipientsInput() { @@ -1200,7 +1210,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi } } } - return false; } @@ -1214,15 +1223,6 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi @Override public void afterTextChanged(Editable s) { calculateCharactersRemaining(); -// if (s == null || s.length() == 0) { -// sendButton.setClickable(false); -// sendButton.setEnabled(false); -// sendButton.setColorFilter(0x66FFFFFF); -// } else { -// sendButton.setClickable(true); -// sendButton.setEnabled(true); -// sendButton.setColorFilter(null); -// } } @Override public void beforeTextChanged(CharSequence s, int start, int count,int after) {}