summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <anwlee@google.com>2014-06-11 10:26:49 -0700
committerAndrew Lee <anwlee@google.com>2014-06-11 10:26:49 -0700
commit8466615413eb7d0feb23ab33288caac104dfd41e (patch)
treecf5844135f19920c3e6611700e2b5c8d435df12c
parent2bd4f7a892e22d41f4055027c7f0b21b3b4db03b (diff)
parent0a4327e6bfeedc23ddefb4df9f6e8041ebc87b59 (diff)
resolved conflicts for merge of 0a4327e6 to master
Change-Id: I98b24e23d9d3283223f8db0c58930977b7a8fd35
-rw-r--r--res/drawable-hdpi/empty_call_log.pngbin0 -> 3538 bytes
-rw-r--r--res/drawable-hdpi/empty_contacts.pngbin0 -> 2461 bytes
-rw-r--r--res/drawable-hdpi/empty_speed_dial.pngbin0 -> 6041 bytes
-rw-r--r--res/drawable-hdpi/no_favorites_banner.pngbin7788 -> 0 bytes
-rw-r--r--res/drawable-mdpi/empty_call_log.pngbin0 -> 2463 bytes
-rw-r--r--res/drawable-mdpi/empty_contacts.pngbin0 -> 1778 bytes
-rw-r--r--res/drawable-mdpi/empty_speed_dial.pngbin0 -> 4119 bytes
-rw-r--r--res/drawable-mdpi/no_favorites_banner.pngbin5129 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/empty_call_log.pngbin0 -> 4860 bytes
-rw-r--r--res/drawable-xhdpi/empty_contacts.pngbin0 -> 3352 bytes
-rw-r--r--res/drawable-xhdpi/empty_speed_dial.pngbin0 -> 8689 bytes
-rw-r--r--res/drawable-xhdpi/no_favorites_banner.pngbin11886 -> 0 bytes
-rw-r--r--res/drawable-xxhdpi/empty_call_log.pngbin0 -> 6226 bytes
-rw-r--r--res/drawable-xxhdpi/empty_contacts.pngbin0 -> 3686 bytes
-rw-r--r--res/drawable-xxhdpi/empty_speed_dial.pngbin0 -> 11039 bytes
-rw-r--r--res/drawable-xxhdpi/no_favorites_banner.pngbin16342 -> 0 bytes
-rw-r--r--res/layout/call_log_fragment.xml14
-rw-r--r--res/layout/empty_list_view.xml (renamed from res/layout/phone_no_favorites.xml)25
-rw-r--r--res/layout/show_all_contacts_fragment.xml7
-rw-r--r--res/layout/speeddial_fragment.xml9
-rw-r--r--res/values/colors.xml3
-rw-r--r--res/values/dimens.xml10
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java17
-rw-r--r--src/com/android/dialer/list/AllContactsFragment.java9
-rw-r--r--src/com/android/dialer/list/SpeedDialFragment.java7
-rw-r--r--src/com/android/dialer/util/DialerUtils.java25
26 files changed, 85 insertions, 41 deletions
diff --git a/res/drawable-hdpi/empty_call_log.png b/res/drawable-hdpi/empty_call_log.png
new file mode 100644
index 000000000..d6f6daaab
--- /dev/null
+++ b/res/drawable-hdpi/empty_call_log.png
Binary files differ
diff --git a/res/drawable-hdpi/empty_contacts.png b/res/drawable-hdpi/empty_contacts.png
new file mode 100644
index 000000000..d3c0378f5
--- /dev/null
+++ b/res/drawable-hdpi/empty_contacts.png
Binary files differ
diff --git a/res/drawable-hdpi/empty_speed_dial.png b/res/drawable-hdpi/empty_speed_dial.png
new file mode 100644
index 000000000..3e9232fc9
--- /dev/null
+++ b/res/drawable-hdpi/empty_speed_dial.png
Binary files differ
diff --git a/res/drawable-hdpi/no_favorites_banner.png b/res/drawable-hdpi/no_favorites_banner.png
deleted file mode 100644
index a4b09c0a9..000000000
--- a/res/drawable-hdpi/no_favorites_banner.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/empty_call_log.png b/res/drawable-mdpi/empty_call_log.png
new file mode 100644
index 000000000..3cd59b35b
--- /dev/null
+++ b/res/drawable-mdpi/empty_call_log.png
Binary files differ
diff --git a/res/drawable-mdpi/empty_contacts.png b/res/drawable-mdpi/empty_contacts.png
new file mode 100644
index 000000000..2ce7eae37
--- /dev/null
+++ b/res/drawable-mdpi/empty_contacts.png
Binary files differ
diff --git a/res/drawable-mdpi/empty_speed_dial.png b/res/drawable-mdpi/empty_speed_dial.png
new file mode 100644
index 000000000..98152e0d3
--- /dev/null
+++ b/res/drawable-mdpi/empty_speed_dial.png
Binary files differ
diff --git a/res/drawable-mdpi/no_favorites_banner.png b/res/drawable-mdpi/no_favorites_banner.png
deleted file mode 100644
index ac080b9e1..000000000
--- a/res/drawable-mdpi/no_favorites_banner.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/empty_call_log.png b/res/drawable-xhdpi/empty_call_log.png
new file mode 100644
index 000000000..14ec04ba1
--- /dev/null
+++ b/res/drawable-xhdpi/empty_call_log.png
Binary files differ
diff --git a/res/drawable-xhdpi/empty_contacts.png b/res/drawable-xhdpi/empty_contacts.png
new file mode 100644
index 000000000..65b1de333
--- /dev/null
+++ b/res/drawable-xhdpi/empty_contacts.png
Binary files differ
diff --git a/res/drawable-xhdpi/empty_speed_dial.png b/res/drawable-xhdpi/empty_speed_dial.png
new file mode 100644
index 000000000..a3a76751b
--- /dev/null
+++ b/res/drawable-xhdpi/empty_speed_dial.png
Binary files differ
diff --git a/res/drawable-xhdpi/no_favorites_banner.png b/res/drawable-xhdpi/no_favorites_banner.png
deleted file mode 100644
index bae4e99b8..000000000
--- a/res/drawable-xhdpi/no_favorites_banner.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xxhdpi/empty_call_log.png b/res/drawable-xxhdpi/empty_call_log.png
new file mode 100644
index 000000000..501d7f1e2
--- /dev/null
+++ b/res/drawable-xxhdpi/empty_call_log.png
Binary files differ
diff --git a/res/drawable-xxhdpi/empty_contacts.png b/res/drawable-xxhdpi/empty_contacts.png
new file mode 100644
index 000000000..407d78c9c
--- /dev/null
+++ b/res/drawable-xxhdpi/empty_contacts.png
Binary files differ
diff --git a/res/drawable-xxhdpi/empty_speed_dial.png b/res/drawable-xxhdpi/empty_speed_dial.png
new file mode 100644
index 000000000..fb2ea5f15
--- /dev/null
+++ b/res/drawable-xxhdpi/empty_speed_dial.png
Binary files differ
diff --git a/res/drawable-xxhdpi/no_favorites_banner.png b/res/drawable-xxhdpi/no_favorites_banner.png
deleted file mode 100644
index 0e2a4fa3b..000000000
--- a/res/drawable-xxhdpi/no_favorites_banner.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/call_log_fragment.xml b/res/layout/call_log_fragment.xml
index fb7ed2a16..bb50730e8 100644
--- a/res/layout/call_log_fragment.xml
+++ b/res/layout/call_log_fragment.xml
@@ -72,14 +72,14 @@
android:divider="@null"
android:nestedScrollingEnabled="true"
/>
- <TextView android:id="@android:id/empty"
+
+ <include
+ android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:text="@string/recentCalls_empty"
- android:gravity="center"
- android:layout_marginTop="@dimen/empty_message_top_margin"
- android:textColor="?android:attr/textColorSecondary"
- android:textAppearance="?android:attr/textAppearanceLarge"
- />
+ layout="@layout/empty_list_view"
+ android:visibility="gone"/>
+
</FrameLayout>
+
</LinearLayout>
diff --git a/res/layout/phone_no_favorites.xml b/res/layout/empty_list_view.xml
index b95afd197..be4dbf5af 100644
--- a/res/layout/phone_no_favorites.xml
+++ b/res/layout/empty_list_view.xml
@@ -30,28 +30,27 @@
android:layout_alignParentStart="true"/>
<LinearLayout
- android:id="@+id/nofavorite_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:gravity="center"
- android:layout_centerInParent="true">
+ android:paddingBottom="@dimen/actionbar_and_tab_height"
+ android:layout_centerInParent="true" >
+
<ImageView
- android:id="@+id/nofavorite_image"
+ android:id="@+id/emptyListViewImage"
android:layout_height="wrap_content"
android:layout_width="match_parent"
- android:gravity="center_horizontal"
- android:src="@drawable/no_favorites_banner"
- android:layout_marginBottom="14dp"
- android:contentDescription="@string/no_favorites"/>
+ android:gravity="center_horizontal" />
+
<TextView
- android:id="@+id/title"
+ android:id="@+id/emptyListViewMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/no_favorites"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:textColor="@color/nofavorite_text_color"/>
+ android:minHeight="84dp"
+ android:gravity="center_horizontal|top"
+ android:textSize="@dimen/empty_list_message_text_size"
+ android:textColor="@color/empty_list_text_color" />
+
</LinearLayout>
</RelativeLayout>
diff --git a/res/layout/show_all_contacts_fragment.xml b/res/layout/show_all_contacts_fragment.xml
index 91fb3228c..fe188bddd 100644
--- a/res/layout/show_all_contacts_fragment.xml
+++ b/res/layout/show_all_contacts_fragment.xml
@@ -46,4 +46,11 @@
android:nestedScrollingEnabled="true" />
</FrameLayout>
+ <include
+ android:id="@+id/empty_list_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ layout="@layout/empty_list_view"
+ android:visibility="gone"/>
+
</LinearLayout>
diff --git a/res/layout/speeddial_fragment.xml b/res/layout/speeddial_fragment.xml
index f025e6179..58a7b2410 100644
--- a/res/layout/speeddial_fragment.xml
+++ b/res/layout/speeddial_fragment.xml
@@ -45,13 +45,10 @@
</FrameLayout>
<include
- android:id="@+id/phone_no_favorites_view"
+ android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_below="@id/contact_tile_frame"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- layout="@layout/phone_no_favorites"
+ layout="@layout/empty_list_view"
android:visibility="gone"/>
+
</RelativeLayout>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 05381a5ca..6624c2d80 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -62,8 +62,7 @@
<!-- Undo dialogue color -->
<color name="undo_dialogue_text_color">#4d4d4d</color>
- <!-- Text color for no favorites message -->
- <color name="nofavorite_text_color">#777777</color>
+ <color name="empty_list_text_color">#b2b2b2</color>
<color name="remove_text_color">#ffffff</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 004dc40e6..c6a8e9b5a 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -96,6 +96,10 @@
<!-- Height of the actionBar - this is 8dps bigger than the platform standard to give more
room to the search box-->
<dimen name="action_bar_height">64dp</dimen>
+ <dimen name="tab_height">43dp</dimen>
+ <dimen name="tab_elevation">2dp</dimen>
+ <!-- actionbar height + tab height -->
+ <dimen name="actionbar_and_tab_height">107dp</dimen>
<!-- Margin to the left and right of the search box. -->
<dimen name="search_margin_horizontal">8dp</dimen>
@@ -119,10 +123,6 @@
<dimen name="search_list_padding_top">8dp</dimen>
<dimen name="search_box_elevation">2dp</dimen>
- <!-- Size of text in tabs. -->
- <dimen name="tab_height">43dp</dimen>
- <dimen name="tab_elevation">2dp</dimen>
-
<!-- Padding to the left and right of call log action buttons. -->
<dimen name="call_log_action_horizontal_padding">8dp</dimen>
<!-- Left-padding for the call log action buttons - ensures the buttons align with the text
@@ -144,4 +144,6 @@
<!-- Length of dialpad's shadows in dialer. -->
<dimen name="shadow_length">10dp</dimen>
+
+ <dimen name="empty_list_message_text_size">16sp</dimen>
</resources>
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index ad86e240d..4f5c35518 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -40,6 +40,7 @@ import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
+import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
@@ -50,6 +51,7 @@ import com.android.contacts.common.util.PhoneNumberHelper;
import com.android.contacts.common.util.ViewUtil;
import com.android.dialer.R;
import com.android.dialer.list.ListsFragment.HostInterface;
+import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.EmptyLoader;
import com.android.dialer.voicemail.VoicemailStatusHelper;
import com.android.dialer.voicemail.VoicemailStatusHelper.StatusMessage;
@@ -298,9 +300,11 @@ public class CallLogFragment extends ListFragment
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
- updateEmptyMessage(mCallTypeFilter);
+ getListView().setEmptyView(view.findViewById(R.id.empty_list_view));
getListView().setItemsCanFocus(true);
maybeAddFooterView();
+
+ updateEmptyMessage(mCallTypeFilter);
}
/**
@@ -413,22 +417,23 @@ public class CallLogFragment extends ListFragment
}
private void updateEmptyMessage(int filterType) {
- final String message;
+ final int messageId;
switch (filterType) {
case Calls.MISSED_TYPE:
- message = getString(R.string.recentMissed_empty);
+ messageId = R.string.recentMissed_empty;
break;
case Calls.VOICEMAIL_TYPE:
- message = getString(R.string.recentVoicemails_empty);
+ messageId = R.string.recentVoicemails_empty;
break;
case CallLogQueryHandler.CALL_TYPE_ALL:
- message = getString(R.string.recentCalls_empty);
+ messageId = R.string.recentCalls_empty;
break;
default:
throw new IllegalArgumentException("Unexpected filter type in CallLogFragment: "
+ filterType);
}
- ((TextView) getListView().getEmptyView()).setText(message);
+ DialerUtils.configureEmptyListView(
+ getListView().getEmptyView(), R.drawable.empty_call_log, messageId, getResources());
}
public void callSelectedEntry() {
diff --git a/src/com/android/dialer/list/AllContactsFragment.java b/src/com/android/dialer/list/AllContactsFragment.java
index a796680e9..ddcb15df4 100644
--- a/src/com/android/dialer/list/AllContactsFragment.java
+++ b/src/com/android/dialer/list/AllContactsFragment.java
@@ -23,8 +23,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
-import android.widget.ListView;
-import android.widget.QuickContactBadge;
import com.android.contacts.common.list.ContactEntryListAdapter;
import com.android.contacts.common.list.ContactEntryListFragment;
@@ -32,6 +30,7 @@ import com.android.contacts.common.list.ContactListFilter;
import com.android.contacts.common.list.DefaultContactListAdapter;
import com.android.contacts.common.util.ViewUtil;
import com.android.dialer.R;
+import com.android.dialer.util.DialerUtils;
/**
* Fragments to show all contacts with phone numbers.
@@ -50,6 +49,12 @@ public class AllContactsFragment extends ContactEntryListFragment<ContactEntryLi
@Override
public void onViewCreated(View view, android.os.Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
+
+ View emptyListView = view.findViewById(R.id.empty_list_view);
+ DialerUtils.configureEmptyListView(emptyListView, R.drawable.empty_contacts,
+ R.string.listFoundAllContactsZero, getResources());
+ getListView().setEmptyView(emptyListView);
+
ViewUtil.addBottomPaddingToListViewForFab(getListView(), getResources());
}
diff --git a/src/com/android/dialer/list/SpeedDialFragment.java b/src/com/android/dialer/list/SpeedDialFragment.java
index 6e86a3e36..c21449288 100644
--- a/src/com/android/dialer/list/SpeedDialFragment.java
+++ b/src/com/android/dialer/list/SpeedDialFragment.java
@@ -23,6 +23,7 @@ import android.app.Fragment;
import android.app.LoaderManager;
import android.content.CursorLoader;
import android.content.Loader;
+import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Rect;
import android.net.Uri;
@@ -47,6 +48,7 @@ import com.android.contacts.common.ContactTileLoaderFactory;
import com.android.contacts.common.list.ContactTileView;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
import com.android.dialer.R;
+import com.android.dialer.util.DialerUtils;
import java.util.ArrayList;
import java.util.HashMap;
@@ -208,7 +210,10 @@ public class SpeedDialFragment extends Fragment implements OnItemClickListener,
(ImageView) getActivity().findViewById(R.id.contact_tile_drag_shadow_overlay);
mListView.setDragShadowOverlay(dragShadowOverlay);
- mEmptyView = mParentView.findViewById(R.id.phone_no_favorites_view);
+ final Resources resources = getResources();
+ mEmptyView = mParentView.findViewById(R.id.empty_list_view);
+ DialerUtils.configureEmptyListView(
+ mEmptyView, R.drawable.empty_speed_dial, R.string.no_favorites, getResources());
mContactTileFrame = mParentView.findViewById(R.id.contact_tile_frame);
diff --git a/src/com/android/dialer/util/DialerUtils.java b/src/com/android/dialer/util/DialerUtils.java
index 584caa9a1..f1dfe20e0 100644
--- a/src/com/android/dialer/util/DialerUtils.java
+++ b/src/com/android/dialer/util/DialerUtils.java
@@ -21,8 +21,12 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
import android.net.Uri;
import android.provider.Telephony;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
import android.widget.Toast;
import com.android.contacts.common.CallUtil;
@@ -82,4 +86,25 @@ public class DialerUtils {
}
return null;
}
+
+ /**
+ * Sets the image asset and text for an empty list view (see empty_list_view.xml).
+ *
+ * @param emptyListView The empty list view.
+ * @param imageResId The resource id for the drawable to set as the image.
+ * @param strResId The resource id for the string to set as the message.
+ * @param res The resources to obtain the image and string from.
+ */
+ public static void configureEmptyListView(
+ View emptyListView, int imageResId, int strResId, Resources res) {
+ ImageView emptyListViewImage =
+ (ImageView) emptyListView.findViewById(R.id.emptyListViewImage);
+
+ emptyListViewImage.setImageDrawable(res.getDrawable(imageResId));
+ emptyListViewImage.setContentDescription(res.getString(strResId));
+
+ TextView emptyListViewMessage =
+ (TextView) emptyListView.findViewById(R.id.emptyListViewMessage);
+ emptyListViewMessage.setText(res.getString(strResId));
+ }
}