mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-20 03:37:41 +00:00
new send icons, fix logic for disabling/enabling
// FREEBIE
This commit is contained in:
@@ -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) {}
|
||||
|
Reference in New Issue
Block a user