Merge pull request #1233 from mcginty/send-icons

new send icons, fix logic for disabling/enabling the button
This commit is contained in:
Moxie Marlinspike 2014-04-03 09:58:10 -07:00
commit c43ef8bce0
33 changed files with 27 additions and 24 deletions

BIN
artwork/ic_send.psd Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -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" />

View File

@ -23,8 +23,9 @@
<attr name="conversation_background" format="reference|color"/>
<attr name="conversation_editor_background" format="reference"/>
<attr name="conversation_editor_text_color" format="reference|color"/>
<attr name="conversation_send_button" format="reference"/>
<attr name="conversation_send_secure_button" format="reference"/>
<attr name="conversation_send_button_push" format="reference"/>
<attr name="conversation_send_button_sms_secure" format="reference"/>
<attr name="conversation_send_button_sms_insecure" format="reference"/>
<attr name="conversation_delivered_indicator" format="reference"/>
<attr name="conversation_emoji_toggle" format="reference"/>
<attr name="conversation_keyboard_toggle" format="reference"/>

View File

@ -30,8 +30,9 @@
<item name="conversation_background">#ffdddddd</item>
<item name="conversation_editor_background">@drawable/textlines</item>
<item name="conversation_editor_text_color">#ff111111</item>
<item name="conversation_send_button">@drawable/ic_send_holo_light</item>
<item name="conversation_send_secure_button">@drawable/ic_send_encrypted_holo_light</item>
<item name="conversation_send_button_push">@drawable/ic_send_push</item>
<item name="conversation_send_button_sms_secure">@drawable/ic_send_sms_secure</item>
<item name="conversation_send_button_sms_insecure">@drawable/ic_send_sms_insecure</item>
<item name="conversation_delivered_indicator">@drawable/ic_sms_mms_delivered_light</item>
<item name="conversation_emoji_toggle">@drawable/ic_emoji_dark</item>
<item name="conversation_keyboard_toggle">@drawable/ic_ime_dark</item>
@ -116,8 +117,9 @@
<item name="conversation_background">@color/black</item>
<item name="conversation_editor_background">@drawable/textlines_dark</item>
<item name="conversation_editor_text_color">#ffeeeeee</item>
<item name="conversation_send_button">@drawable/ic_send_holo_dark</item>
<item name="conversation_send_secure_button">@drawable/ic_send_holo_dark_encrypted</item>
<item name="conversation_send_button_push">@drawable/ic_send_push</item>
<item name="conversation_send_button_sms_secure">@drawable/ic_send_sms_secure</item>
<item name="conversation_send_button_sms_insecure">@drawable/ic_send_sms_insecure_dark</item>
<item name="conversation_delivered_indicator">@drawable/ic_sms_mms_delivered_dark</item>
<item name="conversation_emoji_toggle">@drawable/ic_emoji_light</item>
<item name="conversation_keyboard_toggle">@drawable/ic_ime_light</item>

View File

@ -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) {}