Improved labels when lists are empty
This commit is contained in:
parent
94f792c6e5
commit
93b26bfdaf
4 changed files with 98 additions and 84 deletions
|
@ -30,6 +30,7 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager;
|
import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
|
@ -63,8 +64,9 @@ public class ChatRoomsFragment extends Fragment implements ContactsUpdatedListen
|
||||||
private int mChatRoomDeletionPendingCount;
|
private int mChatRoomDeletionPendingCount;
|
||||||
private ChatRoomListenerStub mChatRoomListener;
|
private ChatRoomListenerStub mChatRoomListener;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
public List<ChatRoom> mRooms;
|
private List<ChatRoom> mRooms;
|
||||||
private SelectableHelper mSelectionHelper;
|
private SelectableHelper mSelectionHelper;
|
||||||
|
private TextView mNoChatHistory;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -80,6 +82,7 @@ public class ChatRoomsFragment extends Fragment implements ContactsUpdatedListen
|
||||||
mNewDiscussionButton = view.findViewById(R.id.new_discussion);
|
mNewDiscussionButton = view.findViewById(R.id.new_discussion);
|
||||||
mNewGroupDiscussionButton = view.findViewById(R.id.new_group_discussion);
|
mNewGroupDiscussionButton = view.findViewById(R.id.new_group_discussion);
|
||||||
mBackToCallButton = view.findViewById(R.id.back_in_call);
|
mBackToCallButton = view.findViewById(R.id.back_in_call);
|
||||||
|
mNoChatHistory = view.findViewById(R.id.noChatHistory);
|
||||||
|
|
||||||
mSelectionHelper = new SelectableHelper(view, this);
|
mSelectionHelper = new SelectableHelper(view, this);
|
||||||
mChatRoomsAdapter = new ChatRoomsAdapter(mContext, R.layout.chatlist_cell, mRooms, this, mSelectionHelper);
|
mChatRoomsAdapter = new ChatRoomsAdapter(mContext, R.layout.chatlist_cell, mRooms, this, mSelectionHelper);
|
||||||
|
@ -175,7 +178,7 @@ public class ChatRoomsFragment extends Fragment implements ContactsUpdatedListen
|
||||||
|
|
||||||
private void refreshChatRoomsList() {
|
private void refreshChatRoomsList() {
|
||||||
mChatRoomsAdapter.refresh();
|
mChatRoomsAdapter.refresh();
|
||||||
//mNoChatHistory.setVisibility(mChatRoomsAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
|
mNoChatHistory.setVisibility(mChatRoomsAdapter.getItemCount() == 0 ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayFirstChat() {
|
public void displayFirstChat() {
|
||||||
|
|
|
@ -130,6 +130,9 @@ public class HistoryListFragment extends Fragment implements OnClickListener, On
|
||||||
|
|
||||||
private void hideHistoryListAndDisplayMessageIfEmpty() {
|
private void hideHistoryListAndDisplayMessageIfEmpty() {
|
||||||
removeNotMissedCallsFromLogs();
|
removeNotMissedCallsFromLogs();
|
||||||
|
noCallHistory.setVisibility(View.GONE);
|
||||||
|
noMissedCallHistory.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (mLogs.isEmpty()) {
|
if (mLogs.isEmpty()) {
|
||||||
if (mOnlyDisplayMissedCalls) {
|
if (mOnlyDisplayMissedCalls) {
|
||||||
noMissedCallHistory.setVisibility(View.VISIBLE);
|
noMissedCallHistory.setVisibility(View.VISIBLE);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/colorH"
|
android:background="@color/colorH"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/top_bar"
|
android:id="@+id/top_bar"
|
||||||
|
@ -80,9 +80,9 @@
|
||||||
android:text="@string/no_chat_history"
|
android:text="@string/no_chat_history"
|
||||||
style="@style/font6"
|
style="@style/font6"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"/>
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
<include layout="@layout/wait_layout" android:id="@+id/waitScreen"/>
|
<include layout="@layout/wait_layout" android:id="@+id/waitScreen"/>
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/colorH">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/colorH"
|
android:background="@color/colorH"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/top_bar"
|
android:id="@+id/top_bar"
|
||||||
|
@ -72,6 +77,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="0.2"
|
android:layout_weight="0.2"
|
||||||
android:padding="15dp"/>
|
android:padding="15dp"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<include layout="@layout/edit_list"/>
|
<include layout="@layout/edit_list"/>
|
||||||
|
@ -84,22 +90,24 @@
|
||||||
android:cacheColorHint="@color/transparent"
|
android:cacheColorHint="@color/transparent"
|
||||||
android:dividerHeight="1dp" />
|
android:dividerHeight="1dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/no_call_history"
|
android:id="@+id/no_call_history"
|
||||||
android:text="@string/no_call_history"
|
android:text="@string/no_call_history"
|
||||||
style="@style/font6"
|
style="@style/font6"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"/>
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/no_missed_call_history"
|
android:id="@+id/no_missed_call_history"
|
||||||
android:text="@string/no_missed_call_history"
|
android:text="@string/no_missed_call_history"
|
||||||
style="@style/font6"
|
style="@style/font6"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"/>
|
android:layout_centerInParent="true"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
Loading…
Reference in a new issue