Fixed No Chatroom label when chat room list is empty

This commit is contained in:
Sylvain Berfini 2018-02-14 17:34:08 +01:00
parent 3cbbf23eff
commit cb76369a9a
2 changed files with 11 additions and 9 deletions

View file

@ -63,17 +63,17 @@
android:cacheColorHint="@color/transparent" android:cacheColorHint="@color/transparent"
android:dividerHeight="1dp" /> android:dividerHeight="1dp" />
<TextView
android:id="@+id/noChatHistory"
android:text="@string/no_chat_history"
style="@style/font6"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/noChatHistory"
android:text="@string/no_chat_history"
style="@style/font6"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
<include layout="@layout/wait_layout" android:id="@+id/waitScreen"/> <include layout="@layout/wait_layout" android:id="@+id/waitScreen"/>
</RelativeLayout> </RelativeLayout>

View file

@ -78,6 +78,7 @@ public class ChatListFragment extends Fragment implements OnItemClickListener, C
mChatRoomsList.setOnItemClickListener(this); mChatRoomsList.setOnItemClickListener(this);
mNoChatHistory = view.findViewById(R.id.noChatHistory); mNoChatHistory = view.findViewById(R.id.noChatHistory);
mNoChatHistory.setVisibility(View.GONE);
mNewDiscussionButton = view.findViewById(R.id.new_discussion); mNewDiscussionButton = view.findViewById(R.id.new_discussion);
mNewDiscussionButton.setOnClickListener(new View.OnClickListener() { mNewDiscussionButton.setOnClickListener(new View.OnClickListener() {
@ -114,6 +115,7 @@ public class ChatListFragment extends Fragment implements OnItemClickListener, C
private void refreshChatRoomsList() { private void refreshChatRoomsList() {
mChatRoomsAdapter.refresh(); mChatRoomsAdapter.refresh();
mNoChatHistory.setVisibility(mChatRoomsAdapter.getCount() == 0 ? View.VISIBLE : View.GONE);
} }
@Override @Override