switch conversations fragment to data binder
This commit is contained in:
parent
5e7d1f7bcc
commit
e9e616ebc7
|
@ -666,7 +666,7 @@ public class ConversationActivity extends XmppActivity
|
||||||
reInitLatestConversation();
|
reInitLatestConversation();
|
||||||
} else {
|
} else {
|
||||||
this.mConversationFragment.messageListAdapter.updatePreferences();
|
this.mConversationFragment.messageListAdapter.updatePreferences();
|
||||||
this.mConversationFragment.messagesView.invalidateViews();
|
//this.mConversationFragment.messagesView.invalidateViews();
|
||||||
this.mConversationFragment.setupIme();
|
this.mConversationFragment.setupIme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package eu.siacs.conversations.ui;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.databinding.DataBindingUtil;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
|
@ -67,6 +68,7 @@ import eu.siacs.conversations.Config;
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
import eu.siacs.conversations.crypto.axolotl.AxolotlService;
|
||||||
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
|
import eu.siacs.conversations.crypto.axolotl.FingerprintStatus;
|
||||||
|
import eu.siacs.conversations.databinding.FragmentConversationBinding;
|
||||||
import eu.siacs.conversations.entities.Account;
|
import eu.siacs.conversations.entities.Account;
|
||||||
import eu.siacs.conversations.entities.Blockable;
|
import eu.siacs.conversations.entities.Blockable;
|
||||||
import eu.siacs.conversations.entities.Contact;
|
import eu.siacs.conversations.entities.Contact;
|
||||||
|
@ -128,13 +130,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
|
|
||||||
final protected List<Message> messageList = new ArrayList<>();
|
final protected List<Message> messageList = new ArrayList<>();
|
||||||
protected Conversation conversation;
|
protected Conversation conversation;
|
||||||
protected ListView messagesView;
|
|
||||||
|
private FragmentConversationBinding binding;
|
||||||
|
|
||||||
protected MessageAdapter messageListAdapter;
|
protected MessageAdapter messageListAdapter;
|
||||||
private EditMessage mEditMessage;
|
|
||||||
private ImageButton mSendButton;
|
|
||||||
private RelativeLayout snackbar;
|
|
||||||
private TextView snackbarMessage;
|
|
||||||
private TextView snackbarAction;
|
|
||||||
private Toast messageLoaderToast;
|
private Toast messageLoaderToast;
|
||||||
|
|
||||||
private ActivityResult postponedActivityResult = null;
|
private ActivityResult postponedActivityResult = null;
|
||||||
|
@ -207,7 +206,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
getActivity().runOnUiThread(() -> {
|
getActivity().runOnUiThread(() -> {
|
||||||
final int oldPosition = messagesView.getFirstVisiblePosition();
|
final int oldPosition = binding.messagesView.getFirstVisiblePosition();
|
||||||
Message message = null;
|
Message message = null;
|
||||||
int childPos;
|
int childPos;
|
||||||
for (childPos = 0; childPos + oldPosition < messageList.size(); ++childPos) {
|
for (childPos = 0; childPos + oldPosition < messageList.size(); ++childPos) {
|
||||||
|
@ -217,7 +216,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final String uuid = message != null ? message.getUuid() : null;
|
final String uuid = message != null ? message.getUuid() : null;
|
||||||
View v = messagesView.getChildAt(childPos);
|
View v = binding.messagesView.getChildAt(childPos);
|
||||||
final int pxOffset = (v == null) ? 0 : v.getTop();
|
final int pxOffset = (v == null) ? 0 : v.getTop();
|
||||||
ConversationFragment.this.conversation.populateWithMessages(ConversationFragment.this.messageList);
|
ConversationFragment.this.conversation.populateWithMessages(ConversationFragment.this.messageList);
|
||||||
try {
|
try {
|
||||||
|
@ -227,7 +226,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
messageListAdapter.notifyDataSetChanged();
|
messageListAdapter.notifyDataSetChanged();
|
||||||
int pos = Math.max(getIndexOf(uuid, messageList), 0);
|
int pos = Math.max(getIndexOf(uuid, messageList), 0);
|
||||||
messagesView.setSelectionFromTop(pos, pxOffset);
|
binding.messagesView.setSelectionFromTop(pos, pxOffset);
|
||||||
if (messageLoaderToast != null) {
|
if (messageLoaderToast != null) {
|
||||||
messageLoaderToast.cancel();
|
messageLoaderToast.cancel();
|
||||||
}
|
}
|
||||||
|
@ -380,8 +379,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
case CANCEL:
|
case CANCEL:
|
||||||
if (conversation != null) {
|
if (conversation != null) {
|
||||||
if (conversation.setCorrectingMessage(null)) {
|
if (conversation.setCorrectingMessage(null)) {
|
||||||
mEditMessage.setText("");
|
binding.textinput.setText("");
|
||||||
mEditMessage.append(conversation.getDraftMessage());
|
binding.textinput.append(conversation.getDraftMessage());
|
||||||
conversation.setDraftMessage(null);
|
conversation.setDraftMessage(null);
|
||||||
} else if (conversation.getMode() == Conversation.MODE_MULTI) {
|
} else if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||||
conversation.setNextCounterpart(null);
|
conversation.setNextCounterpart(null);
|
||||||
|
@ -428,12 +427,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pair<Integer, Integer> getScrollPosition() {
|
public Pair<Integer, Integer> getScrollPosition() {
|
||||||
if (this.messagesView.getCount() == 0 ||
|
if (this.binding.messagesView.getCount() == 0 ||
|
||||||
this.messagesView.getLastVisiblePosition() == this.messagesView.getCount() - 1) {
|
this.binding.messagesView.getLastVisiblePosition() == this.binding.messagesView.getCount() - 1) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
final int pos = messagesView.getFirstVisiblePosition();
|
final int pos = this.binding.messagesView.getFirstVisiblePosition();
|
||||||
final View view = messagesView.getChildAt(0);
|
final View view = this.binding.messagesView.getChildAt(0);
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
@ -444,7 +443,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
|
|
||||||
public void setScrollPosition(Pair<Integer, Integer> scrollPosition) {
|
public void setScrollPosition(Pair<Integer, Integer> scrollPosition) {
|
||||||
if (scrollPosition != null) {
|
if (scrollPosition != null) {
|
||||||
this.messagesView.setSelectionFromTop(scrollPosition.first, scrollPosition.second);
|
this.binding.messagesView.setSelectionFromTop(scrollPosition.first, scrollPosition.second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +546,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendMessage() {
|
private void sendMessage() {
|
||||||
final String body = mEditMessage.getText().toString();
|
final String body = this.binding.textinput.getText().toString();
|
||||||
final Conversation conversation = this.conversation;
|
final Conversation conversation = this.conversation;
|
||||||
if (body.length() == 0 || conversation == null) {
|
if (body.length() == 0 || conversation == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -616,32 +615,21 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
public void updateChatMsgHint() {
|
public void updateChatMsgHint() {
|
||||||
final boolean multi = conversation.getMode() == Conversation.MODE_MULTI;
|
final boolean multi = conversation.getMode() == Conversation.MODE_MULTI;
|
||||||
if (conversation.getCorrectingMessage() != null) {
|
if (conversation.getCorrectingMessage() != null) {
|
||||||
this.mEditMessage.setHint(R.string.send_corrected_message);
|
this.binding.textinput.setHint(R.string.send_corrected_message);
|
||||||
} else if (multi && conversation.getNextCounterpart() != null) {
|
} else if (multi && conversation.getNextCounterpart() != null) {
|
||||||
this.mEditMessage.setHint(getString(
|
this.binding.textinput.setHint(getString(
|
||||||
R.string.send_private_message_to,
|
R.string.send_private_message_to,
|
||||||
conversation.getNextCounterpart().getResourcepart()));
|
conversation.getNextCounterpart().getResourcepart()));
|
||||||
} else if (multi && !conversation.getMucOptions().participating()) {
|
} else if (multi && !conversation.getMucOptions().participating()) {
|
||||||
this.mEditMessage.setHint(R.string.you_are_not_participating);
|
this.binding.textinput.setHint(R.string.you_are_not_participating);
|
||||||
} else {
|
} else {
|
||||||
this.mEditMessage.setHint(UIHelper.getMessageHint(getActivity(), conversation));
|
this.binding.textinput.setHint(UIHelper.getMessageHint(getActivity(), conversation));
|
||||||
getActivity().invalidateOptionsMenu();
|
getActivity().invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupIme() {;
|
public void setupIme() {
|
||||||
if (activity != null) {
|
this.binding.textinput.refreshIme();
|
||||||
if (activity.usingEnterKey() && activity.enterIsSend()) {
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
|
|
||||||
} else if (activity.usingEnterKey()) {
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
|
|
||||||
} else {
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
|
||||||
mEditMessage.setInputType(mEditMessage.getInputType() | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleActivityResult(ActivityResult activityResult) {
|
private void handleActivityResult(ActivityResult activityResult) {
|
||||||
|
@ -658,7 +646,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
conversation.getAccount().getPgpDecryptionService().continueDecryption(data);
|
conversation.getAccount().getPgpDecryptionService().continueDecryption(data);
|
||||||
break;
|
break;
|
||||||
case REQUEST_TRUST_KEYS_TEXT:
|
case REQUEST_TRUST_KEYS_TEXT:
|
||||||
final String body = mEditMessage.getText().toString();
|
final String body = this.binding.textinput.getText().toString();
|
||||||
Message message = new Message(conversation, body, conversation.getNextEncryption());
|
Message message = new Message(conversation, body, conversation.getNextEncryption());
|
||||||
sendAxolotlMessage(message);
|
sendAxolotlMessage(message);
|
||||||
break;
|
break;
|
||||||
|
@ -784,31 +772,18 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
final View view = inflater.inflate(R.layout.fragment_conversation, container, false);
|
this.binding = DataBindingUtil.inflate(inflater,R.layout.fragment_conversation,container,false);
|
||||||
view.setOnClickListener(null);
|
binding.getRoot().setOnClickListener(null); //TODO why the fuck did we do this?
|
||||||
|
|
||||||
mEditMessage = (EditMessage) view.findViewById(R.id.textinput);
|
binding.textinput.addTextChangedListener(new StylingHelper.MessageEditorStyler(binding.textinput));
|
||||||
mEditMessage.setOnClickListener(v -> {
|
|
||||||
if (activity != null) {
|
|
||||||
activity.hideConversationsOverview();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mEditMessage.addTextChangedListener(new StylingHelper.MessageEditorStyler(mEditMessage));
|
binding.textinput.setOnEditorActionListener(mEditorActionListener);
|
||||||
|
binding.textinput.setRichContentListener(new String[]{"image/*"}, mEditorContentListener);
|
||||||
|
|
||||||
mEditMessage.setOnEditorActionListener(mEditorActionListener);
|
binding.textSendButton.setOnClickListener(this.mSendButtonListener);
|
||||||
mEditMessage.setRichContentListener(new String[]{"image/*"}, mEditorContentListener);
|
|
||||||
|
|
||||||
mSendButton = (ImageButton) view.findViewById(R.id.textSendButton);
|
binding.messagesView.setOnScrollListener(mOnScrollListener);
|
||||||
mSendButton.setOnClickListener(this.mSendButtonListener);
|
binding.messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
|
||||||
|
|
||||||
snackbar = (RelativeLayout) view.findViewById(R.id.snackbar);
|
|
||||||
snackbarMessage = (TextView) view.findViewById(R.id.snackbar_message);
|
|
||||||
snackbarAction = (TextView) view.findViewById(R.id.snackbar_action);
|
|
||||||
|
|
||||||
messagesView = (ListView) view.findViewById(R.id.messages_view);
|
|
||||||
messagesView.setOnScrollListener(mOnScrollListener);
|
|
||||||
messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
|
|
||||||
messageListAdapter = new MessageAdapter((ConversationActivity) getActivity(), this.messageList);
|
messageListAdapter = new MessageAdapter((ConversationActivity) getActivity(), this.messageList);
|
||||||
messageListAdapter.setOnContactPictureClicked(message -> {
|
messageListAdapter.setOnContactPictureClicked(message -> {
|
||||||
final boolean received = message.getStatus() <= Message.STATUS_RECEIVED;
|
final boolean received = message.getStatus() <= Message.STATUS_RECEIVED;
|
||||||
|
@ -877,18 +852,18 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
messageListAdapter.setOnQuoteListener(this::quoteText);
|
messageListAdapter.setOnQuoteListener(this::quoteText);
|
||||||
messagesView.setAdapter(messageListAdapter);
|
binding.messagesView.setAdapter(messageListAdapter);
|
||||||
|
|
||||||
registerForContextMenu(messagesView);
|
registerForContextMenu(binding.messagesView);
|
||||||
|
|
||||||
return view;
|
return binding.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void quoteText(String text) {
|
private void quoteText(String text) {
|
||||||
if (mEditMessage.isEnabled()) {
|
if (binding.textinput.isEnabled()) {
|
||||||
text = text.replaceAll("(\n *){2,}", "\n").replaceAll("(^|\n)", "$1> ").replaceAll("\n$", "");
|
text = text.replaceAll("(\n *){2,}", "\n").replaceAll("(^|\n)", "$1> ").replaceAll("\n$", "");
|
||||||
Editable editable = mEditMessage.getEditableText();
|
Editable editable = binding.textinput.getEditableText();
|
||||||
int position = mEditMessage.getSelectionEnd();
|
int position = binding.textinput.getSelectionEnd();
|
||||||
if (position == -1) position = editable.length();
|
if (position == -1) position = editable.length();
|
||||||
if (position > 0 && editable.charAt(position - 1) != '\n') {
|
if (position > 0 && editable.charAt(position - 1) != '\n') {
|
||||||
editable.insert(position++, "\n");
|
editable.insert(position++, "\n");
|
||||||
|
@ -899,12 +874,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
if (position < editable.length() && editable.charAt(position) != '\n') {
|
if (position < editable.length() && editable.charAt(position) != '\n') {
|
||||||
editable.insert(position, "\n");
|
editable.insert(position, "\n");
|
||||||
}
|
}
|
||||||
mEditMessage.setSelection(position);
|
binding.textinput.setSelection(position);
|
||||||
mEditMessage.requestFocus();
|
binding.textinput.requestFocus();
|
||||||
InputMethodManager inputMethodManager = (InputMethodManager) getActivity()
|
InputMethodManager inputMethodManager = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
||||||
if (inputMethodManager != null) {
|
if (inputMethodManager != null) {
|
||||||
inputMethodManager.showSoftInput(mEditMessage, InputMethodManager.SHOW_IMPLICIT);
|
inputMethodManager.showSoftInput(binding.textinput, InputMethodManager.SHOW_IMPLICIT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1507,7 +1481,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
if (conversation.setOutgoingChatState(Config.DEFAULT_CHATSTATE)) {
|
if (conversation.setOutgoingChatState(Config.DEFAULT_CHATSTATE)) {
|
||||||
activity.xmppConnectionService.sendChatState(conversation);
|
activity.xmppConnectionService.sendChatState(conversation);
|
||||||
}
|
}
|
||||||
this.mEditMessage.setText("");
|
this.binding.textinput.setText("");
|
||||||
this.conversation.setNextCounterpart(counterpart);
|
this.conversation.setNextCounterpart(counterpart);
|
||||||
updateChatMsgHint();
|
updateChatMsgHint();
|
||||||
updateSendButton();
|
updateSendButton();
|
||||||
|
@ -1519,17 +1493,17 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
message = message.next();
|
message = message.next();
|
||||||
}
|
}
|
||||||
this.conversation.setCorrectingMessage(message);
|
this.conversation.setCorrectingMessage(message);
|
||||||
final Editable editable = mEditMessage.getText();
|
final Editable editable = binding.textinput.getText();
|
||||||
this.conversation.setDraftMessage(editable.toString());
|
this.conversation.setDraftMessage(editable.toString());
|
||||||
this.mEditMessage.setText("");
|
this.binding.textinput.setText("");
|
||||||
this.mEditMessage.append(message.getBody());
|
this.binding.textinput.append(message.getBody());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void highlightInConference(String nick) {
|
protected void highlightInConference(String nick) {
|
||||||
final Editable editable = mEditMessage.getText();
|
final Editable editable = this.binding.textinput.getText();
|
||||||
String oldString = editable.toString().trim();
|
String oldString = editable.toString().trim();
|
||||||
final int pos = mEditMessage.getSelectionStart();
|
final int pos = this.binding.textinput.getSelectionStart();
|
||||||
if (oldString.isEmpty() || pos == 0) {
|
if (oldString.isEmpty() || pos == 0) {
|
||||||
editable.insert(0, nick + ": ");
|
editable.insert(0, nick + ": ");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1546,7 +1520,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
editable.insert(pos, (Character.isWhitespace(before) ? "" : " ") + nick + (Character.isWhitespace(after) ? "" : " "));
|
editable.insert(pos, (Character.isWhitespace(before) ? "" : " ") + nick + (Character.isWhitespace(after) ? "" : " "));
|
||||||
if (Character.isWhitespace(after)) {
|
if (Character.isWhitespace(after)) {
|
||||||
mEditMessage.setSelection(mEditMessage.getSelectionStart() + 1);
|
this.binding.textinput.setSelection(this.binding.textinput.getSelectionStart() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1560,7 +1534,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
messageListAdapter.stopAudioPlayer();
|
messageListAdapter.stopAudioPlayer();
|
||||||
}
|
}
|
||||||
if (this.conversation != null) {
|
if (this.conversation != null) {
|
||||||
final String msg = mEditMessage.getText().toString();
|
final String msg = this.binding.textinput.getText().toString();
|
||||||
if (this.conversation.setNextMessage(msg)) {
|
if (this.conversation.setNextMessage(msg)) {
|
||||||
this.activity.xmppConnectionService.updateConversation(this.conversation);
|
this.activity.xmppConnectionService.updateConversation(this.conversation);
|
||||||
}
|
}
|
||||||
|
@ -1582,7 +1556,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
setupIme();
|
setupIme();
|
||||||
if (this.conversation != null) {
|
if (this.conversation != null) {
|
||||||
final String msg = mEditMessage.getText().toString();
|
final String msg = this.binding.textinput.getText().toString();
|
||||||
if (this.conversation.setNextMessage(msg)) {
|
if (this.conversation.setNextMessage(msg)) {
|
||||||
activity.xmppConnectionService.updateConversation(conversation);
|
activity.xmppConnectionService.updateConversation(conversation);
|
||||||
}
|
}
|
||||||
|
@ -1595,16 +1569,16 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
this.mSendButton.setContentDescription(activity.getString(R.string.send_message_to_x, conversation.getName()));
|
this.binding.textSendButton.setContentDescription(activity.getString(R.string.send_message_to_x, conversation.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.conversation = conversation;
|
this.conversation = conversation;
|
||||||
this.mEditMessage.setKeyboardListener(null);
|
this.binding.textinput.setKeyboardListener(null);
|
||||||
this.mEditMessage.setText("");
|
this.binding.textinput.setText("");
|
||||||
this.mEditMessage.append(this.conversation.getNextMessage());
|
this.binding.textinput.append(this.conversation.getNextMessage());
|
||||||
this.mEditMessage.setKeyboardListener(this);
|
this.binding.textinput.setKeyboardListener(this);
|
||||||
messageListAdapter.updatePreferences();
|
messageListAdapter.updatePreferences();
|
||||||
this.messagesView.setAdapter(messageListAdapter);
|
this.binding.messagesView.setAdapter(messageListAdapter);
|
||||||
updateMessages();
|
updateMessages();
|
||||||
this.conversation.messagesLoaded.set(true);
|
this.conversation.messagesLoaded.set(true);
|
||||||
synchronized (this.messageList) {
|
synchronized (this.messageList) {
|
||||||
|
@ -1617,7 +1591,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
int i = getIndexOf(first.getUuid(), this.messageList);
|
int i = getIndexOf(first.getUuid(), this.messageList);
|
||||||
pos = i < 0 ? bottom : i;
|
pos = i < 0 ? bottom : i;
|
||||||
}
|
}
|
||||||
messagesView.setSelection(pos);
|
this.binding.messagesView.setSelection(pos);
|
||||||
return pos == bottom;
|
return pos == bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1736,26 +1710,23 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
|
|
||||||
protected void messageSent() {
|
protected void messageSent() {
|
||||||
mSendingPgpMessage.set(false);
|
mSendingPgpMessage.set(false);
|
||||||
mEditMessage.setText("");
|
this.binding.textinput.setText("");
|
||||||
if (conversation.setCorrectingMessage(null)) {
|
if (conversation.setCorrectingMessage(null)) {
|
||||||
mEditMessage.append(conversation.getDraftMessage());
|
this.binding.textinput.append(conversation.getDraftMessage());
|
||||||
conversation.setDraftMessage(null);
|
conversation.setDraftMessage(null);
|
||||||
}
|
}
|
||||||
if (conversation.setNextMessage(mEditMessage.getText().toString())) {
|
if (conversation.setNextMessage(this.binding.textinput.getText().toString())) {
|
||||||
activity.xmppConnectionService.updateConversation(conversation);
|
activity.xmppConnectionService.updateConversation(conversation);
|
||||||
}
|
}
|
||||||
updateChatMsgHint();
|
updateChatMsgHint();
|
||||||
new Handler().post(new Runnable() {
|
new Handler().post(() -> {
|
||||||
@Override
|
int size = messageList.size();
|
||||||
public void run() {
|
this.binding.messagesView.setSelection(size - 1);
|
||||||
int size = messageList.size();
|
|
||||||
messagesView.setSelection(size - 1);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFocusOnInputField() {
|
public void setFocusOnInputField() {
|
||||||
mEditMessage.requestFocus();
|
this.binding.textinput.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doneSendingPgpMessage() {
|
public void doneSendingPgpMessage() {
|
||||||
|
@ -1765,16 +1736,16 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
|
|
||||||
private void updateEditablity() {
|
private void updateEditablity() {
|
||||||
boolean canWrite = this.conversation.getMode() == Conversation.MODE_SINGLE || this.conversation.getMucOptions().participating() || this.conversation.getNextCounterpart() != null;
|
boolean canWrite = this.conversation.getMode() == Conversation.MODE_SINGLE || this.conversation.getMucOptions().participating() || this.conversation.getNextCounterpart() != null;
|
||||||
this.mEditMessage.setFocusable(canWrite);
|
this.binding.textinput.setFocusable(canWrite);
|
||||||
this.mEditMessage.setFocusableInTouchMode(canWrite);
|
this.binding.textinput.setFocusableInTouchMode(canWrite);
|
||||||
this.mSendButton.setEnabled(canWrite);
|
this.binding.textSendButton.setEnabled(canWrite);
|
||||||
this.mEditMessage.setCursorVisible(canWrite);
|
this.binding.textinput.setCursorVisible(canWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateSendButton() {
|
public void updateSendButton() {
|
||||||
final Conversation c = this.conversation;
|
final Conversation c = this.conversation;
|
||||||
final Presence.Status status;
|
final Presence.Status status;
|
||||||
final String text = this.mEditMessage == null ? "" : this.mEditMessage.getText().toString();
|
final String text = this.binding.textinput == null ? "" : this.binding.textinput.getText().toString();
|
||||||
final SendButtonAction action = SendButtonTool.getAction(getActivity(),c,text);
|
final SendButtonAction action = SendButtonTool.getAction(getActivity(),c,text);
|
||||||
if (activity.useSendButtonToIndicateStatus() && c.getAccount().getStatus() == Account.State.ONLINE) {
|
if (activity.useSendButtonToIndicateStatus() && c.getAccount().getStatus() == Account.State.ONLINE) {
|
||||||
if (activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) {
|
if (activity.xmppConnectionService != null && activity.xmppConnectionService.getMessageArchiveService().isCatchingUp(c)) {
|
||||||
|
@ -1787,8 +1758,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
} else {
|
} else {
|
||||||
status = Presence.Status.OFFLINE;
|
status = Presence.Status.OFFLINE;
|
||||||
}
|
}
|
||||||
this.mSendButton.setTag(action);
|
this.binding.textSendButton.setTag(action);
|
||||||
this.mSendButton.setImageResource(SendButtonTool.getSendButtonImageResource(getActivity(), action, status));
|
this.binding.textSendButton.setImageResource(SendButtonTool.getSendButtonImageResource(getActivity(), action, status));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateDateSeparators() {
|
protected void updateDateSeparators() {
|
||||||
|
@ -1902,7 +1873,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
public void stopScrolling() {
|
public void stopScrolling() {
|
||||||
long now = SystemClock.uptimeMillis();
|
long now = SystemClock.uptimeMillis();
|
||||||
MotionEvent cancel = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0, 0, 0);
|
MotionEvent cancel = MotionEvent.obtain(now, now, MotionEvent.ACTION_CANCEL, 0, 0, 0);
|
||||||
messagesView.dispatchTouchEvent(cancel);
|
binding.messagesView.dispatchTouchEvent(cancel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean showLoadMoreMessages(final Conversation c) {
|
private boolean showLoadMoreMessages(final Conversation c) {
|
||||||
|
@ -1925,20 +1896,20 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showSnackbar(final int message, final int action, final OnClickListener clickListener, final View.OnLongClickListener longClickListener) {
|
protected void showSnackbar(final int message, final int action, final OnClickListener clickListener, final View.OnLongClickListener longClickListener) {
|
||||||
snackbar.setVisibility(View.VISIBLE);
|
this.binding.snackbar.setVisibility(View.VISIBLE);
|
||||||
snackbar.setOnClickListener(null);
|
this.binding.snackbar.setOnClickListener(null);
|
||||||
snackbarMessage.setText(message);
|
this.binding.snackbarMessage.setText(message);
|
||||||
snackbarMessage.setOnClickListener(null);
|
this.binding.snackbarMessage.setOnClickListener(null);
|
||||||
snackbarAction.setVisibility(clickListener == null ? View.GONE : View.VISIBLE);
|
this.binding.snackbarAction.setVisibility(clickListener == null ? View.GONE : View.VISIBLE);
|
||||||
if (action != 0) {
|
if (action != 0) {
|
||||||
snackbarAction.setText(action);
|
this.binding.snackbarAction.setText(action);
|
||||||
}
|
}
|
||||||
snackbarAction.setOnClickListener(clickListener);
|
this.binding.snackbarAction.setOnClickListener(clickListener);
|
||||||
snackbarAction.setOnLongClickListener(longClickListener);
|
this.binding.snackbarAction.setOnLongClickListener(longClickListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void hideSnackbar() {
|
protected void hideSnackbar() {
|
||||||
snackbar.setVisibility(View.GONE);
|
this.binding.snackbar.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void sendPlainTextMessage(Message message) {
|
protected void sendPlainTextMessage(Message message) {
|
||||||
|
@ -2072,11 +2043,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
if (text == null) {
|
if (text == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String previous = this.mEditMessage.getText().toString();
|
String previous = this.binding.textinput.getText().toString();
|
||||||
if (previous.length() != 0 && !previous.endsWith(" ")) {
|
if (previous.length() != 0 && !previous.endsWith(" ")) {
|
||||||
text = " " + text;
|
text = " " + text;
|
||||||
}
|
}
|
||||||
this.mEditMessage.append(text);
|
this.binding.textinput.append(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2133,8 +2104,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
} else {
|
} else {
|
||||||
lastCompletionLength = 0;
|
lastCompletionLength = 0;
|
||||||
completionIndex = 0;
|
completionIndex = 0;
|
||||||
final String content = mEditMessage.getText().toString();
|
final String content = this.binding.textinput.getText().toString();
|
||||||
lastCompletionCursor = mEditMessage.getSelectionEnd();
|
lastCompletionCursor = this.binding.textinput.getSelectionEnd();
|
||||||
int start = lastCompletionCursor > 0 ? content.lastIndexOf(" ", lastCompletionCursor - 1) + 1 : 0;
|
int start = lastCompletionCursor > 0 ? content.lastIndexOf(" ", lastCompletionCursor - 1) + 1 : 0;
|
||||||
firstWord = start == 0;
|
firstWord = start == 0;
|
||||||
incomplete = content.substring(start, lastCompletionCursor);
|
incomplete = content.substring(start, lastCompletionCursor);
|
||||||
|
@ -2149,12 +2120,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
Collections.sort(completions);
|
Collections.sort(completions);
|
||||||
if (completions.size() > completionIndex) {
|
if (completions.size() > completionIndex) {
|
||||||
String completion = completions.get(completionIndex).substring(incomplete.length());
|
String completion = completions.get(completionIndex).substring(incomplete.length());
|
||||||
mEditMessage.getEditableText().delete(lastCompletionCursor, lastCompletionCursor + lastCompletionLength);
|
this.binding.textinput.getEditableText().delete(lastCompletionCursor, lastCompletionCursor + lastCompletionLength);
|
||||||
mEditMessage.getEditableText().insert(lastCompletionCursor, completion);
|
this.binding.textinput.getEditableText().insert(lastCompletionCursor, completion);
|
||||||
lastCompletionLength = completion.length();
|
lastCompletionLength = completion.length();
|
||||||
} else {
|
} else {
|
||||||
completionIndex = -1;
|
completionIndex = -1;
|
||||||
mEditMessage.getEditableText().delete(lastCompletionCursor, lastCompletionCursor + lastCompletionLength);
|
this.binding.textinput.getEditableText().delete(lastCompletionCursor, lastCompletionCursor + lastCompletionLength);
|
||||||
lastCompletionLength = 0;
|
lastCompletionLength = 0;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -482,8 +482,7 @@ public abstract class XmppActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SharedPreferences getPreferences() {
|
protected SharedPreferences getPreferences() {
|
||||||
return PreferenceManager
|
return PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
.getDefaultSharedPreferences(getApplicationContext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useSubjectToIdentifyConference() {
|
public boolean useSubjectToIdentifyConference() {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package eu.siacs.conversations.ui.widget;
|
package eu.siacs.conversations.ui.widget;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.text.emoji.widget.EmojiAppCompatEditText;
|
import android.support.text.emoji.widget.EmojiAppCompatEditText;
|
||||||
import android.support.v13.view.inputmethod.EditorInfoCompat;
|
import android.support.v13.view.inputmethod.EditorInfoCompat;
|
||||||
import android.support.v13.view.inputmethod.InputConnectionCompat;
|
import android.support.v13.view.inputmethod.InputConnectionCompat;
|
||||||
|
@ -11,6 +13,7 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.InputFilter;
|
import android.text.InputFilter;
|
||||||
|
import android.text.InputType;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
@ -18,6 +21,7 @@ import android.view.inputmethod.EditorInfo;
|
||||||
import android.view.inputmethod.InputConnection;
|
import android.view.inputmethod.InputConnection;
|
||||||
|
|
||||||
import eu.siacs.conversations.Config;
|
import eu.siacs.conversations.Config;
|
||||||
|
import eu.siacs.conversations.R;
|
||||||
|
|
||||||
public class EditMessage extends EmojiAppCompatEditText {
|
public class EditMessage extends EmojiAppCompatEditText {
|
||||||
|
|
||||||
|
@ -142,6 +146,23 @@ public class EditMessage extends EmojiAppCompatEditText {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refreshIme() {
|
||||||
|
SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||||
|
final boolean usingEnterKey = p.getBoolean("display_enter_key", getResources().getBoolean(R.bool.display_enter_key));
|
||||||
|
final boolean enterIsSend = p.getBoolean("enter_is_send", getResources().getBoolean(R.bool.enter_is_send));
|
||||||
|
|
||||||
|
if (usingEnterKey && enterIsSend) {
|
||||||
|
setInputType(getInputType() & (~InputType.TYPE_TEXT_FLAG_MULTI_LINE));
|
||||||
|
setInputType(getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
|
||||||
|
} else if (usingEnterKey) {
|
||||||
|
setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||||
|
setInputType(getInputType() & (~InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE));
|
||||||
|
} else {
|
||||||
|
setInputType(getInputType() | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
|
||||||
|
setInputType(getInputType() | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public interface OnCommitContentListener {
|
public interface OnCommitContentListener {
|
||||||
boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts, String[] mimeTypes);
|
boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts, String[] mimeTypes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,104 +1,107 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?attr/color_background_secondary">
|
|
||||||
|
|
||||||
<ListView
|
|
||||||
android:id="@+id/messages_view"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_above="@+id/snackbar"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:background="?attr/color_background_secondary"
|
|
||||||
android:divider="@null"
|
|
||||||
android:dividerHeight="0dp"
|
|
||||||
android:listSelector="@android:color/transparent"
|
|
||||||
android:stackFromBottom="true"
|
|
||||||
android:transcriptMode="normal"
|
|
||||||
tools:listitem="@layout/message_sent">
|
|
||||||
</ListView>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/textsend"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:background="?attr/color_background_secondary">
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:background="?attr/color_background_primary" >
|
|
||||||
|
|
||||||
<eu.siacs.conversations.ui.widget.EditMessage
|
<ListView
|
||||||
android:id="@+id/textinput"
|
android:id="@+id/messages_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/snackbar"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_toLeftOf="@+id/textSendButton"
|
android:layout_alignParentTop="true"
|
||||||
android:background="?attr/color_background_primary"
|
android:background="?attr/color_background_secondary"
|
||||||
android:ems="10"
|
android:divider="@null"
|
||||||
android:imeOptions="flagNoExtractUi|actionSend"
|
android:dividerHeight="0dp"
|
||||||
android:inputType="textShortMessage|textMultiLine|textCapSentences"
|
android:listSelector="@android:color/transparent"
|
||||||
|
android:stackFromBottom="true"
|
||||||
|
android:transcriptMode="normal"
|
||||||
|
tools:listitem="@layout/message_sent">
|
||||||
|
</ListView>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/textsend"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:background="?attr/color_background_primary">
|
||||||
|
|
||||||
|
<eu.siacs.conversations.ui.widget.EditMessage
|
||||||
|
android:id="@+id/textinput"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_toLeftOf="@+id/textSendButton"
|
||||||
|
android:background="?attr/color_background_primary"
|
||||||
|
android:ems="10"
|
||||||
|
android:imeOptions="flagNoExtractUi|actionSend"
|
||||||
|
android:inputType="textShortMessage|textMultiLine|textCapSentences"
|
||||||
|
android:maxLines="8"
|
||||||
|
android:minHeight="48dp"
|
||||||
|
android:minLines="1"
|
||||||
|
android:paddingBottom="12dp"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:paddingTop="12dp"
|
||||||
|
android:textColor="?attr/color_text_primary">
|
||||||
|
|
||||||
|
<requestFocus/>
|
||||||
|
</eu.siacs.conversations.ui.widget.EditMessage>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/textSendButton"
|
||||||
|
android:layout_width="48dp"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:background="?attr/color_background_primary"
|
||||||
|
android:contentDescription="@string/send_message"
|
||||||
|
android:src="?attr/ic_send_text_offline"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/snackbar"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/textsend"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:background="@drawable/snackbar"
|
||||||
android:minHeight="48dp"
|
android:minHeight="48dp"
|
||||||
android:minLines="1"
|
android:visibility="gone">
|
||||||
android:maxLines="8"
|
|
||||||
android:paddingBottom="12dp"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:paddingRight="8dp"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:textColor="?attr/color_text_primary" >
|
|
||||||
|
|
||||||
<requestFocus />
|
<TextView
|
||||||
</eu.siacs.conversations.ui.widget.EditMessage>
|
android:id="@+id/snackbar_message"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_toLeftOf="@+id/snackbar_action"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="?attr/TextSizeBody"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/snackbar_action"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
|
android:paddingTop="16dp"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="?attr/TextSizeBody"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/textSendButton"
|
|
||||||
android:layout_width="48dp"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:background="?attr/color_background_primary"
|
|
||||||
android:src="?attr/ic_send_text_offline"
|
|
||||||
android:contentDescription="@string/send_message"/>
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/snackbar"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_above="@+id/textsend"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:background="@drawable/snackbar"
|
|
||||||
android:minHeight="48dp"
|
|
||||||
android:visibility="gone" >
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/snackbar_message"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_toLeftOf="@+id/snackbar_action"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="?attr/TextSizeBody" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/snackbar_action"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:paddingBottom="16dp"
|
|
||||||
android:paddingLeft="24dp"
|
|
||||||
android:paddingRight="24dp"
|
|
||||||
android:paddingTop="16dp"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="?attr/TextSizeBody"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
Loading…
Reference in a new issue