aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java26
-rw-r--r--src/main/res/layout/fragment_conversation.xml37
2 files changed, 9 insertions, 54 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 67b7392a6..910d907a7 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -487,7 +487,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
} else {
binding.textinput.setText("");
}
- updateChatMsgHint();
updateSendButton();
updateEditablity();
}
@@ -917,26 +916,21 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
public void updateChatMsgHint() {
final boolean multi = conversation.getMode() == Conversation.MODE_MULTI;
if (conversation.getCorrectingMessage() != null) {
- this.binding.textInputHint.setVisibility(View.GONE);
+ this.binding.textInputHint.setVisibility(View.VISIBLE);
+ this.binding.textInputHint.setText(R.string.send_corrected_message);
this.binding.textinput.setHint(R.string.send_corrected_message);
- hideMessageHint();
} else if (multi && conversation.getNextCounterpart() != null) {
this.binding.textinput.setHint(R.string.send_unencrypted_message);
- this.binding.textInputHint.setVisibility(View.GONE);
+ this.binding.textInputHint.setVisibility(View.VISIBLE);
this.binding.textInputHint.setText(getString(
R.string.send_private_message_to,
conversation.getNextCounterpart().getResource()));
- showMessageHint(getString(
- R.string.send_private_message_to,
- conversation.getNextCounterpart().getResource()));
} else if (multi && !conversation.getMucOptions().participating()) {
this.binding.textInputHint.setVisibility(View.GONE);
this.binding.textinput.setHint(R.string.you_are_not_participating);
- hideMessageHint();
} else {
this.binding.textInputHint.setVisibility(View.GONE);
this.binding.textinput.setHint(UIHelper.getMessageHint(getActivity(), conversation));
- hideMessageHint();
getActivity().invalidateOptionsMenu();
}
}
@@ -1153,7 +1147,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
binding.textinput.addTextChangedListener(new StylingHelper.MessageEditorStyler(binding.textinput));
binding.textinput.setOnEditorActionListener(mEditorActionListener);
binding.textinput.setRichContentListener(new String[]{"image/*"}, mEditorContentListener);
- binding.textinput.setBackgroundResource(messageInputBubble());
+ binding.messageInputBox.setBackgroundResource(messageInputBubble());
binding.textSendButton.setOnClickListener(this.mSendButtonListener);
binding.textSendButton.setOnLongClickListener(this.mSendButtonLongListener);
@@ -1164,7 +1158,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
binding.messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
mediaPreviewAdapter = new MediaPreviewAdapter(this);
binding.mediaPreview.setAdapter(mediaPreviewAdapter);
- binding.mediaPreview.setBackgroundResource(messageInputBubble());
messageListAdapter = new MessageAdapter((XmppActivity) getActivity(), this.messageList);
messageListAdapter.setOnContactPictureClicked(this);
messageListAdapter.setOnContactPictureLongClicked(this);
@@ -1980,7 +1973,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
this.binding.textinput.setText("");
this.conversation.setNextCounterpart(counterpart);
- updateChatMsgHint();
updateSendButton();
updateEditablity();
}
@@ -2538,6 +2530,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
}
public void updateSendButton() {
+ updateChatMsgHint();
boolean hasAttachments = mediaPreviewAdapter != null && mediaPreviewAdapter.hasAttachments();
boolean useSendButtonToIndicateStatus = PreferenceManager.getDefaultSharedPreferences(getActivity()).getBoolean("send_button_status", getResources().getBoolean(R.bool.send_button_status));
final Conversation c = this.conversation;
@@ -2671,15 +2664,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
this.binding.snackbar.setVisibility(View.GONE);
}
- protected void showMessageHint(final String message) {
- this.binding.messagehint.setVisibility(View.VISIBLE);
- this.binding.messagehintMessage.setText(message);
- }
-
- protected void hideMessageHint() {
- this.binding.messagehint.setVisibility(View.GONE);
- }
-
protected void sendMessage(Message message) {
activity.xmppConnectionService.sendMessage(message);
messageSent();
diff --git a/src/main/res/layout/fragment_conversation.xml b/src/main/res/layout/fragment_conversation.xml
index 1da8a5b25..c3f42855d 100644
--- a/src/main/res/layout/fragment_conversation.xml
+++ b/src/main/res/layout/fragment_conversation.xml
@@ -62,8 +62,7 @@
<RelativeLayout
android:id="@+id/textsend"
-
- android:layout_width="fill_parent"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
@@ -87,14 +86,14 @@
android:visibility="gone" />
<LinearLayout
- android:layout_width="wrap_content"
+ android:id="@+id/message_input_box"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
android:layout_toStartOf="@+id/textSendButton"
android:layout_toLeftOf="@+id/textSendButton"
android:layout_toEndOf="@+id/recordVoiceButton"
android:layout_toRightOf="@+id/recordVoiceButton"
+ android:background="@drawable/message_bubble_sent"
android:orientation="vertical">
<TextView
@@ -112,7 +111,6 @@
android:id="@+id/media_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/message_bubble_sent"
android:orientation="horizontal"
android:paddingTop="8dp"
android:requiresFadingEdge="horizontal"
@@ -125,7 +123,6 @@
style="@style/Widget.Conversations.EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/message_bubble_sent"
android:ems="10"
android:imeOptions="flagNoExtractUi|actionSend"
android:inputType="textShortMessage|textMultiLine|textCapSentences"
@@ -203,31 +200,5 @@
android:textStyle="bold" />
</RelativeLayout>
- <RelativeLayout
- android:id="@+id/messagehint"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
- android:layout_marginLeft="8dp"
- android:layout_marginTop="4dp"
- android:layout_marginEnd="8dp"
- android:layout_marginRight="8dp"
- android:background="@drawable/date_bubble"
- android:minHeight="48dp"
- android:visibility="gone">
-
- <TextView
- android:id="@+id/messagehint_message"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentStart="true"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:paddingStart="24dp"
- android:paddingLeft="24dp"
- android:textColor="@color/realblack"
- android:textSize="?attr/TextSizeBody" />
- </RelativeLayout>
-
</RelativeLayout>
</layout>