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

View File

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