diff --git a/artwork/ic_send.psd b/artwork/ic_send.psd new file mode 100644 index 000000000..09dc6f47e 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 9bd318868..000000000 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 9f78ca3fb..000000000 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 92e142105..000000000 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 56bc9987a..000000000 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 000000000..ae53056be 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 000000000..d3165508e 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 000000000..0e7fb1184 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 000000000..8237b27bd 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 f5bea488c..000000000 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 e44bc78f3..000000000 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 78729f5ef..000000000 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 a761fe40d..000000000 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 000000000..2066dd929 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 000000000..a13794c77 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 000000000..d9a8c2035 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 000000000..63f3cfd91 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 efd9f5239..000000000 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 077e0b026..000000000 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 aa1270911..000000000 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 6b9ea9138..000000000 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 000000000..89cfd5719 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 000000000..3b4fcd20c 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 000000000..ae2c31f88 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 000000000..b278bbd76 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 000000000..d007be72b 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 000000000..44845e6e8 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 000000000..e0b207874 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 000000000..4bcbfd5df 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 8c83acbd0..95d339b63 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 f751fe3ea..4379a43aa 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 5d56fa1ae..2dbc94b83 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 dbe81be71..3cfd37455 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) {}