fixed message hint

This commit is contained in:
iNPUTmice 2014-08-25 15:43:50 +02:00
parent 4e791c8a01
commit 07b422d4c8

View file

@ -159,7 +159,6 @@ public class ConversationFragment extends Fragment {
private ConversationActivity activity; private ConversationActivity activity;
private void sendMessage() { private void sendMessage() {
if (mEditMessage.getText().length() < 1) { if (mEditMessage.getText().length() < 1) {
if (this.conversation.getMode() == Conversation.MODE_MULTI) { if (this.conversation.getMode() == Conversation.MODE_MULTI) {
@ -187,12 +186,16 @@ public class ConversationFragment extends Fragment {
} }
public void updateChatMsgHint() { public void updateChatMsgHint() {
if (conversation.getNextPresence() != null) { if (conversation.getMode() == Conversation.MODE_MULTI
this.mEditMessage.setHint(getString(R.string.send_private_message_to,conversation.getNextPresence())); && conversation.getNextPresence() != null) {
this.mEditMessage.setHint(getString(
R.string.send_private_message_to,
conversation.getNextPresence()));
} else { } else {
switch (conversation.getNextEncryption()) { switch (conversation.getNextEncryption()) {
case Message.ENCRYPTION_NONE: case Message.ENCRYPTION_NONE:
mEditMessage.setHint(getString(R.string.send_plain_text_message)); mEditMessage
.setHint(getString(R.string.send_plain_text_message));
break; break;
case Message.ENCRYPTION_OTR: case Message.ENCRYPTION_OTR:
mEditMessage.setHint(getString(R.string.send_otr_message)); mEditMessage.setHint(getString(R.string.send_otr_message));
@ -241,8 +244,10 @@ public class ConversationFragment extends Fragment {
messagesView = (ListView) view.findViewById(R.id.messages_view); messagesView = (ListView) view.findViewById(R.id.messages_view);
messagesView.setOnScrollListener(mOnScrollListener); messagesView.setOnScrollListener(mOnScrollListener);
messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL); messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
messageListAdapter = new MessageAdapter((ConversationActivity) getActivity(), this.messageList); messageListAdapter = new MessageAdapter(
messageListAdapter.setOnContactPictureClicked(new OnContactPictureClicked() { (ConversationActivity) getActivity(), this.messageList);
messageListAdapter
.setOnContactPictureClicked(new OnContactPictureClicked() {
@Override @Override
public void onContactPictureClicked(Message message) { public void onContactPictureClicked(Message message) {
@ -255,7 +260,8 @@ public class ConversationFragment extends Fragment {
} }
} }
}); });
messageListAdapter.setOnContactPictureLongClicked(new OnContactPictureLongClicked() { messageListAdapter
.setOnContactPictureLongClicked(new OnContactPictureLongClicked() {
@Override @Override
public void onContactPictureLongClicked(Message message) { public void onContactPictureLongClicked(Message message) {
@ -384,12 +390,16 @@ public class ConversationFragment extends Fragment {
final ConversationActivity activity = (ConversationActivity) getActivity(); final ConversationActivity activity = (ConversationActivity) getActivity();
if (this.conversation != null) { if (this.conversation != null) {
final Contact contact = this.conversation.getContact(); final Contact contact = this.conversation.getContact();
if (!contact.showInRoster() && contact.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { if (!contact.showInRoster()
showSnackbar(R.string.contact_added_you, R.string.add_back, new OnClickListener() { && contact
.getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) {
showSnackbar(R.string.contact_added_you, R.string.add_back,
new OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
activity.xmppConnectionService.createContact(contact); activity.xmppConnectionService
.createContact(contact);
activity.switchToContactDetails(contact); activity.switchToContactDetails(contact);
} }
}); });