Commit 28e69ee3 authored by Grigory Fedorov's avatar Grigory Fedorov

Chat messages scrolled to bottom after update.

parent 87ee4a6e
......@@ -80,6 +80,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
private ChatViewerFragmentListener listener;
private Animation shakeAnimation = null;
private int contextMenuItemPosition;
private RecyclerView recyclerView;
public static ChatViewerFragment newInstance(String account, String user) {
ChatViewerFragment fragment = new ChatViewerFragment();
......@@ -158,7 +159,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
chatMessageAdapter = new ChatMessageAdapter(getActivity(), account, user, this);
RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.chat_messages_recycler_view);
recyclerView = (RecyclerView) view.findViewById(R.id.chat_messages_recycler_view);
recyclerView.setAdapter(chatMessageAdapter);
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
......@@ -414,6 +415,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
public void updateChat() {
chatMessageAdapter.onChange();
recyclerView.scrollToPosition(chatMessageAdapter.getItemCount() - 1);
setUpOptionsMenu(toolbar.getMenu());
updateSecurityButton();
......
......@@ -44,8 +44,6 @@
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:transcriptMode="normal"
android:smoothScrollbar="false"
android:divider="@null"
android:dividerHeight="0dp"
android:layout_above="@+id/input_layout"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment