aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-05-03 21:04:18 +0200
committerChristian Schneppe <christian@pix-art.de>2019-05-03 21:04:18 +0200
commit1cf16eaf259f813a1b3a71cfebb563a6906ea4cc (patch)
tree46192a314379dacf3975da23a5d0ad1a771adda8
parent0f52124ef5d008c75e4908e67bf9256e160e6967 (diff)
put PM hint above edittext
-rw-r--r--gradle/wrapper/gradle-wrapper.properties4
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java7
-rw-r--r--src/main/res/layout/fragment_conversation.xml62
4 files changed, 51 insertions, 24 deletions
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index c3999dd58..ad100288c 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Jan 26 14:05:53 CET 2019
+#Fri Apr 26 22:25:54 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index 121e9ed06..65dfba12d 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -486,11 +486,13 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
setAttribute(ATTRIBUTE_CRYPTO_TARGETS, acceptedTargets);
}
+ //TODO store uuid in attribute
public boolean setCorrectingMessage(Message correctingMessage) {
this.correctingMessage = correctingMessage;
return correctingMessage == null && draftMessage != null;
}
+ //TODO: dynamically find by uuid
public Message getCorrectingMessage() {
return this.correctingMessage;
}
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index b0a4570fd..780b43209 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -930,19 +930,24 @@ 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.textinput.setHint(R.string.send_corrected_message);
hideMessageHint();
} else if (multi && conversation.getNextCounterpart() != null) {
- this.binding.textinput.setHint(getString(
+ this.binding.textinput.setHint(R.string.send_unencrypted_message);
+ 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();
diff --git a/src/main/res/layout/fragment_conversation.xml b/src/main/res/layout/fragment_conversation.xml
index 25ab8fbef..5603ca974 100644
--- a/src/main/res/layout/fragment_conversation.xml
+++ b/src/main/res/layout/fragment_conversation.xml
@@ -102,32 +102,52 @@
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
tools:listitem="@layout/media_preview" />
- <de.pixart.messenger.ui.widget.EditMessage
- android:id="@+id/textinput"
- style="@style/Widget.Conversations.EditText"
- android:layout_width="match_parent"
+ <LinearLayout
+ android:layout_width="wrap_content"
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:ems="10"
- android:imeOptions="flagNoExtractUi|actionSend"
- android:inputType="textShortMessage|textMultiLine|textCapSentences"
- android:maxLines="6"
- android:minHeight="48dp"
- android:minLines="1"
- android:paddingStart="8dp"
- android:paddingLeft="8dp"
- android:paddingTop="12dp"
- android:paddingEnd="8dp"
- android:paddingRight="8dp"
- android:paddingBottom="12dp"
- android:singleLine="false"
- android:textColor="?attr/text_Color_Main">
-
- </de.pixart.messenger.ui.widget.EditMessage>
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/text_input_hint"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:maxLines="1"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="@style/TextAppearance.Conversations.Caption.Highlight"
+ android:visibility="gone" />
+
+ <de.pixart.messenger.ui.widget.EditMessage
+ android:id="@+id/textinput"
+ 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"
+ android:maxLines="6"
+ android:minHeight="48dp"
+ android:minLines="1"
+ android:paddingStart="8dp"
+ android:paddingLeft="8dp"
+ android:paddingTop="12dp"
+ android:paddingEnd="8dp"
+ android:paddingRight="8dp"
+ android:paddingBottom="12dp"
+ android:singleLine="false"
+ android:textColor="?attr/text_Color_Main">
+
+ <requestFocus />
+ </de.pixart.messenger.ui.widget.EditMessage>
+ </LinearLayout>
<ImageButton
android:id="@+id/textSendButton"