Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 882a2ee

Browse files
kunall17niftynei
authored andcommitted
Clear chatBox on Navigation up
1 parent 6d9ebfd commit 882a2ee

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/src/main/java/com/zulip/android/activities/MessageListFragment.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void openCompose(final MessageType type, String stream, String topic,
6868
String pmRecipients);
6969
void addToList(Message message);
7070
void muteTopic(Message message);
71+
void clearChatBox();
7172
}
7273

7374
private static final String PARAM_FILTER = "filter";
@@ -260,6 +261,7 @@ public void onAttach(Activity activity) {
260261
@Override
261262
public void onDetach() {
262263
super.onDetach();
264+
mListener.clearChatBox();
263265
mListener = null;
264266
}
265267

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,15 @@ public void switchView() {
722722
}
723723
String tempStreamSave = null;
724724

725+
@Override
726+
public void clearChatBox() {
727+
if (messageEt != null) {
728+
if (TextUtils.isEmpty(messageEt.getText())) {
729+
topicActv.setText("");
730+
streamActv.setText("");
731+
}
732+
}
733+
}
725734
public void onBackPressed() {
726735
if (narrowedList != null) {
727736
narrowedList = null;

0 commit comments

Comments
 (0)