This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
app/src/main/java/com/zulip/android/activities Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -259,10 +259,35 @@ public void muteTopic(Message message) {
259
259
260
260
@ Override
261
261
public void recyclerViewScrolled () {
262
- if (chatBox .getVisibility () == View .VISIBLE && !isTextFieldFocused ) {
262
+ /* in this method we check if the messageEt is empty or not
263
+ if messageEt is not empty, it means that the user has typed something in the chatBox and that the chatBox should be open
264
+ in spite of scrolling */
265
+ if (chatBox .getVisibility ()== View .VISIBLE && !isCurrentModeStream ()){
266
+ //if messageEt is empty in private msg mode, then the chatBox can disappear on scrolling else it will stay
267
+ if (messageEt .getText ().toString ().equals ("" ))
268
+ {
269
+ displayChatBox (false );
270
+ displayFAB (true );
271
+
272
+ }
273
+ }
274
+
275
+ else if (chatBox .getVisibility ()==View .VISIBLE && isCurrentModeStream ()){
276
+ //check if messageEt is empty in stream msg mode, then the chatBox can disappear on scrolling else it will disappear
277
+ if (messageEt .getText ().toString ().equals ("" ) && topicActv .getText ().toString ().equals ("" ))
278
+ {
279
+ displayChatBox (false );
280
+ displayFAB (true );
281
+
282
+ }
283
+ }
284
+ /*check if stream edittext, topic edittext and messageEt edittext is empty in a general msg mode(i.e. when the floating
285
+ button is pressed by user). If all fields are empty, then on scrolling the chatBox will disappear else not */
286
+ else if (chatBox .getVisibility () == View .VISIBLE && streamActv .getText ().toString ().equals ("" ) && topicActv .getText ().toString ().equals ("" ) && messageEt .getText ().toString ().equals ("" )) {
263
287
displayChatBox (false );
264
288
displayFAB (true );
265
289
}
290
+
266
291
}
267
292
268
293
public RefreshableCursorAdapter getPeopleAdapter () {
You can’t perform that action at this time.
0 commit comments