Use voicemail image for empty voicemail tab and update color
This CL updates the icon for the empty voicemail tab and updates the tint of it as well. It also updates the size of the voicemail icon when in landscape mode.
Bug: 25661977,74085541
Test: N/A
PiperOrigin-RevId: 187557890
Change-Id: Ic19643f4e63e3ce70ba6b029ce45a570404f28e7
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java b/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java
index 6d71dad..3a5e72b 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailFragment.java
@@ -210,7 +210,8 @@
showView(emptyContentView);
emptyContentView.setDescription((R.string.empty_voicemail_tab_text));
- emptyContentView.setImage(R.drawable.quantum_ic_schedule_vd_theme_24);
+ emptyContentView.setImage(R.drawable.quantum_ic_voicemail_vd_theme_24);
+ emptyContentView.setImageTint(R.color.empty_voicemail_icon_tint_color, null);
}
private void showView(View view) {
diff --git a/java/com/android/dialer/widget/EmptyContentView.java b/java/com/android/dialer/widget/EmptyContentView.java
index 5c2e4d5..b99657a 100644
--- a/java/com/android/dialer/widget/EmptyContentView.java
+++ b/java/com/android/dialer/widget/EmptyContentView.java
@@ -17,6 +17,10 @@
package com.android.dialer.widget;
import android.content.Context;
+import android.content.res.ColorStateList;
+import android.content.res.Resources.Theme;
+import android.support.annotation.ColorRes;
+import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -86,6 +90,11 @@
}
}
+ public void setImageTint(@ColorRes int color, @Nullable Theme theme) {
+ imageView.setImageTintList(
+ (ColorStateList.valueOf(getContext().getResources().getColor(color, theme))));
+ }
+
public void setActionLabel(@StringRes int resourceId) {
actionLabel = resourceId;
if (resourceId == NO_LABEL) {
diff --git a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
index 00344bf..3a7574f 100644
--- a/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
+++ b/java/com/android/dialer/widget/res/layout-land/empty_content_view.xml
@@ -18,7 +18,7 @@
<ImageView
android:id="@+id/empty_list_view_image"
android:layout_width="match_parent"
- android:layout_height="0dp"
+ android:layout_height="108dp"
android:layout_weight="1"
android:maxHeight="126dp"
android:gravity="center_horizontal"/>
diff --git a/java/com/android/dialer/widget/res/values/colors.xml b/java/com/android/dialer/widget/res/values/colors.xml
index c974609..12a5cb9 100644
--- a/java/com/android/dialer/widget/res/values/colors.xml
+++ b/java/com/android/dialer/widget/res/values/colors.xml
@@ -1,4 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2018 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
<resources>
<color name="empty_list_text_color">#b2b2b2</color>
+ <color name="empty_voicemail_icon_tint_color">#E1E1E1</color>
</resources>
\ No newline at end of file