Skip to content

Commit

Permalink
Make compose box behave similarly on all modes.
Browse files Browse the repository at this point in the history
Fixes nodejs#178.
  • Loading branch information
reachme-ankita authored and timabbott committed Oct 9, 2016
1 parent 18e839f commit 7799e30
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,35 @@ public void muteTopic(Message message) {

@Override
public void recyclerViewScrolled() {
if (chatBox.getVisibility() == View.VISIBLE && !isTextFieldFocused) {
/* in this method we check if the messageEt is empty or not
if messageEt is not empty, it means that the user has typed something in the chatBox and that the chatBox should be open
in spite of scrolling */
if(chatBox.getVisibility()== View.VISIBLE && !isCurrentModeStream()){
//if messageEt is empty in private msg mode, then the chatBox can disappear on scrolling else it will stay
if(messageEt.getText().toString().equals(""))
{
displayChatBox(false);
displayFAB(true);

}
}

else if(chatBox.getVisibility()==View.VISIBLE && isCurrentModeStream()){
//check if messageEt is empty in stream msg mode, then the chatBox can disappear on scrolling else it will disappear
if(messageEt.getText().toString().equals("") && topicActv.getText().toString().equals(""))
{
displayChatBox(false);
displayFAB(true);

}
}
/*check if stream edittext, topic edittext and messageEt edittext is empty in a general msg mode(i.e. when the floating
button is pressed by user). If all fields are empty, then on scrolling the chatBox will disappear else not */
else if (chatBox.getVisibility() == View.VISIBLE && streamActv.getText().toString().equals("") && topicActv.getText().toString().equals("") && messageEt.getText().toString().equals("")) {
displayChatBox(false);
displayFAB(true);
}

}

public RefreshableCursorAdapter getPeopleAdapter() {
Expand Down

0 comments on commit 7799e30

Please sign in to comment.