Merge pull request #1233 from mcginty/send-icons
new send icons, fix logic for disabling/enabling the button
BIN
artwork/ic_send.psd
Normal file
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 884 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 875 B |
BIN
res/drawable-hdpi/ic_send_push.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
res/drawable-hdpi/ic_send_sms_insecure.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable-hdpi/ic_send_sms_insecure_dark.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
res/drawable-hdpi/ic_send_sms_secure.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 550 B |
BIN
res/drawable-mdpi/ic_send_push.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
res/drawable-mdpi/ic_send_sms_insecure.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
res/drawable-mdpi/ic_send_sms_insecure_dark.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
res/drawable-mdpi/ic_send_sms_secure.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.0 KiB |
BIN
res/drawable-xhdpi/ic_send_push.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
res/drawable-xhdpi/ic_send_sms_insecure.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
res/drawable-xhdpi/ic_send_sms_insecure_dark.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
res/drawable-xhdpi/ic_send_sms_secure.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable-xxhdpi/ic_send_push.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
res/drawable-xxhdpi/ic_send_sms_insecure.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
res/drawable-xxhdpi/ic_send_sms_insecure_dark.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
res/drawable-xxhdpi/ic_send_sms_secure.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
@ -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" />
|
||||
|
||||
|
@ -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"/>
|
||||
|
@ -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>
|
||||
|
@ -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) {}
|
||||
|