|
|
@ -29,7 +29,6 @@ import android.graphics.Color;
|
|
|
|
import android.graphics.PorterDuff;
|
|
|
|
import android.graphics.PorterDuff;
|
|
|
|
import android.graphics.PorterDuff.Mode;
|
|
|
|
import android.graphics.PorterDuff.Mode;
|
|
|
|
import android.graphics.drawable.ColorDrawable;
|
|
|
|
import android.graphics.drawable.ColorDrawable;
|
|
|
|
import android.graphics.Bitmap;
|
|
|
|
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.os.AsyncTask;
|
|
|
|
import android.os.AsyncTask;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
@ -55,7 +54,6 @@ import android.view.inputmethod.InputMethodManager;
|
|
|
|
import android.widget.Button;
|
|
|
|
import android.widget.Button;
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
import android.widget.ImageButton;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.TextView;
|
|
|
|
import android.widget.TextView.OnEditorActionListener;
|
|
|
|
|
|
|
|
import android.widget.Toast;
|
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
|
import com.afollestad.materialdialogs.AlertDialogWrapper;
|
|
|
|
import com.afollestad.materialdialogs.AlertDialogWrapper;
|
|
|
@ -247,7 +245,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
initializeSecurity();
|
|
|
|
initializeSecurity();
|
|
|
|
initializeEnabledCheck();
|
|
|
|
initializeEnabledCheck();
|
|
|
|
initializeMmsEnabledCheck();
|
|
|
|
initializeMmsEnabledCheck();
|
|
|
|
initializeIme();
|
|
|
|
composeText.setTransport(sendButton.getSelectedTransport());
|
|
|
|
|
|
|
|
|
|
|
|
titleView.setTitle(recipients);
|
|
|
|
titleView.setTitle(recipients);
|
|
|
|
setActionBarColor(recipients.getColor());
|
|
|
|
setActionBarColor(recipients.getColor());
|
|
|
@ -268,6 +266,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
|
|
|
|
|
|
|
|
@Override public void onConfigurationChanged(Configuration newConfig) {
|
|
|
|
@Override public void onConfigurationChanged(Configuration newConfig) {
|
|
|
|
super.onConfigurationChanged(newConfig);
|
|
|
|
super.onConfigurationChanged(newConfig);
|
|
|
|
|
|
|
|
composeText.setTransport(sendButton.getSelectedTransport());
|
|
|
|
quickAttachmentDrawer.onConfigurationChanged();
|
|
|
|
quickAttachmentDrawer.onConfigurationChanged();
|
|
|
|
hideEmojiDrawer(false);
|
|
|
|
hideEmojiDrawer(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -758,25 +757,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
}.execute();
|
|
|
|
}.execute();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeIme() {
|
|
|
|
|
|
|
|
if (TextSecurePreferences.isEnterSendsEnabled(this)) {
|
|
|
|
|
|
|
|
composeText.setInputType (composeText.getInputType() & ~InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
|
|
|
|
|
|
|
composeText.setImeOptions(composeText.getImeOptions() & ~EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
composeText.setInputType (composeText.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
|
|
|
|
|
|
|
composeText.setImeOptions(composeText.getImeOptions() | EditorInfo.IME_FLAG_NO_ENTER_ACTION);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
composeText.setOnEditorActionListener(new OnEditorActionListener() {
|
|
|
|
|
|
|
|
@Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
|
|
|
|
|
if (actionId == EditorInfo.IME_ACTION_SEND) {
|
|
|
|
|
|
|
|
sendMessage();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeViews() {
|
|
|
|
private void initializeViews() {
|
|
|
|
titleView = (ConversationTitleView) getSupportActionBar().getCustomView();
|
|
|
|
titleView = (ConversationTitleView) getSupportActionBar().getCustomView();
|
|
|
|
buttonToggle = (AnimatingToggle) findViewById(R.id.button_toggle);
|
|
|
|
buttonToggle = (AnimatingToggle) findViewById(R.id.button_toggle);
|
|
|
@ -816,6 +796,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
SendButtonListener sendButtonListener = new SendButtonListener();
|
|
|
|
SendButtonListener sendButtonListener = new SendButtonListener();
|
|
|
|
ComposeKeyPressedListener composeKeyPressedListener = new ComposeKeyPressedListener();
|
|
|
|
ComposeKeyPressedListener composeKeyPressedListener = new ComposeKeyPressedListener();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
composeText.setOnEditorActionListener(sendButtonListener);
|
|
|
|
attachButton.setOnClickListener(new AttachButtonListener());
|
|
|
|
attachButton.setOnClickListener(new AttachButtonListener());
|
|
|
|
sendButton.setOnClickListener(sendButtonListener);
|
|
|
|
sendButton.setOnClickListener(sendButtonListener);
|
|
|
|
sendButton.setEnabled(true);
|
|
|
|
sendButton.setEnabled(true);
|
|
|
@ -823,9 +804,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onChange(TransportOption newTransport) {
|
|
|
|
public void onChange(TransportOption newTransport) {
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
calculateCharactersRemaining();
|
|
|
|
composeText.setHint(newTransport.getComposeHint());
|
|
|
|
composeText.setTransport(newTransport);
|
|
|
|
composeText.setImeActionLabel(newTransport.getComposeHint(), EditorInfo.IME_ACTION_SEND);
|
|
|
|
|
|
|
|
composeText.setInputType(composeText.getInputType());
|
|
|
|
|
|
|
|
buttonToggle.getBackground().setColorFilter(newTransport.getBackgroundColor(), Mode.MULTIPLY);
|
|
|
|
buttonToggle.getBackground().setColorFilter(newTransport.getBackgroundColor(), Mode.MULTIPLY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|