Fix a crash

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-06-06 15:59:20 +02:00
parent ff69f79196
commit ef6aad5093
2 changed files with 8 additions and 10 deletions

View file

@ -129,11 +129,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
@Inject
Cache cache;
@BindView(R.id.nc_message_input)
MessageInput messageInput;
@BindView(R.id.messagesList)
MessagesList messagesList;
@BindView(R.id.popupBubble)
@BindView(R.id.nc_message_input)
MessageInput messageInput;
@BindView(R.id.nc_popup_bubble)
PopupBubble popupBubble;
private List<Disposable> disposableList = new ArrayList<>();
private String conversationName;
@ -564,13 +564,11 @@ public class ChatController extends BaseController implements MessagesListAdapte
myFirstMessage = message;
}
getActivity().runOnUiThread(() -> {
if (popupBubble.isShown()) {
popupBubble.hide();
}
if (popupBubble != null && popupBubble.isShown()) {
popupBubble.hide();
}
messagesList.smoothScrollToPosition(0);
});
messagesList.smoothScrollToPosition(0);
} else {
sendMessage(message, attempt + 1);
}

View file

@ -47,7 +47,7 @@
app:textAutoLink="all"/>
<com.webianks.library.PopupBubble
android:id="@+id/popupBubble"
android:id="@+id/nc_popup_bubble"
android:layout_margin="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"