@@ -124,7 +124,7 @@ public class ZulipActivity extends AppCompatActivity implements
124
124
private LinearLayout chatBox ;
125
125
public FloatingActionButton fab ;
126
126
private CountDownTimer fabHidder ;
127
- private boolean hideFABBlocked = false ;
127
+ private boolean isTextFieldFocused = false ;
128
128
private static final int HIDE_FAB_AFTER_SEC = 5 ;
129
129
130
130
private HashMap <String , Bitmap > gravatars = new HashMap <>();
@@ -238,8 +238,9 @@ public void muteTopic(Message message) {
238
238
239
239
@ Override
240
240
public void recyclerViewScrolled () {
241
- if (chatBox .getVisibility () == View .VISIBLE && hideFABBlocked ) {
241
+ if (chatBox .getVisibility () == View .VISIBLE && ! isTextFieldFocused ) {
242
242
displayChatBox (false );
243
+ displayFAB (true );
243
244
}
244
245
}
245
246
@@ -416,7 +417,7 @@ public void onClick(View v) {
416
417
View .OnFocusChangeListener focusChangeListener = new View .OnFocusChangeListener () {
417
418
@ Override
418
419
public void onFocusChange (View view , boolean focus ) {
419
- hideFABBlocked = focus ;
420
+ isTextFieldFocused = focus ;
420
421
}
421
422
};
422
423
messageEt .setOnFocusChangeListener (focusChangeListener );
@@ -528,13 +529,14 @@ private Cursor makePeopleNameCursor(CharSequence name) throws SQLException {
528
529
529
530
private void setupFab () {
530
531
fab = (FloatingActionButton ) findViewById (R .id .fab );
531
- chatBox = (LinearLayout ) findViewById (R .id .messageBoxContainer );
532
+ chatBox = (SwipeRemoveLinearLayout ) findViewById (R .id .messageBoxContainer );
533
+ chatBox .registerToSwipeEvents (this );
532
534
fabHidder = new CountDownTimer (HIDE_FAB_AFTER_SEC * 1000 , HIDE_FAB_AFTER_SEC * 1000 ) {
533
535
public void onTick (long millisUntilFinished ) {
534
536
}
535
537
536
538
public void onFinish () {
537
- if (!hideFABBlocked ) {
539
+ if (!isTextFieldFocused ) {
538
540
displayFAB (true );
539
541
displayChatBox (false );
540
542
} else {
@@ -545,6 +547,7 @@ public void onFinish() {
545
547
fab .setOnClickListener (new View .OnClickListener () {
546
548
@ Override
547
549
public void onClick (View view ) {
550
+ currentList .stopRecyclerViewScroll ();
548
551
displayChatBox (true );
549
552
displayFAB (false );
550
553
fabHidder .start ();
0 commit comments