From 4db07410fbf823158a8cd3edcc7a6e1d72cc607f Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Thu, 26 Apr 2018 13:00:04 -0700 Subject: Build out the bottom sheet for suggested contacts in Speed Dial. The bottom sheet should include: - contact row - voice call - video call - sms - divider - add favorite (follow up) - remove (follow up) - contact info Bug: 77761183 Test: WIP PiperOrigin-RevId: 194440839 Change-Id: I78e0e0fc0a4834338a59b458fe7639786de57877 --- .../dialer/historyitemactions/HistoryItemActionBottomSheet.java | 8 ++++++++ .../dialer/historyitemactions/HistoryItemActionModule.java | 5 +++++ .../dialer/historyitemactions/res/layout/module_layout.xml | 1 - 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'java/com/android/dialer/historyitemactions') diff --git a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java index 79205a7d9..28663c17d 100644 --- a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java +++ b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java @@ -17,8 +17,10 @@ package com.android.dialer.historyitemactions; import android.content.Context; +import android.content.res.ColorStateList; import android.os.Bundle; import android.support.design.widget.BottomSheetDialog; +import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -109,6 +111,12 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O ((TextView) moduleView.findViewById(R.id.module_text)).setText(module.getStringId()); ((ImageView) moduleView.findViewById(R.id.module_image)) .setImageResource(module.getDrawableId()); + if (module.tintDrawable()) { + ((ImageView) moduleView.findViewById(R.id.module_image)) + .setImageTintList( + ColorStateList.valueOf( + ContextCompat.getColor(getContext(), R.color.secondary_text_color))); + } moduleView.setOnClickListener(this); moduleView.setTag(module); return moduleView; diff --git a/java/com/android/dialer/historyitemactions/HistoryItemActionModule.java b/java/com/android/dialer/historyitemactions/HistoryItemActionModule.java index d64cbca53..e948924d7 100644 --- a/java/com/android/dialer/historyitemactions/HistoryItemActionModule.java +++ b/java/com/android/dialer/historyitemactions/HistoryItemActionModule.java @@ -32,6 +32,11 @@ public interface HistoryItemActionModule { @DrawableRes int getDrawableId(); + /** Returns true if tint can be applied to the drawable. */ + default boolean tintDrawable() { + return true; + } + /** @return true if the bottom sheet should close, false otherwise */ boolean onClick(); } diff --git a/java/com/android/dialer/historyitemactions/res/layout/module_layout.xml b/java/com/android/dialer/historyitemactions/res/layout/module_layout.xml index 9aee67937..063051947 100644 --- a/java/com/android/dialer/historyitemactions/res/layout/module_layout.xml +++ b/java/com/android/dialer/historyitemactions/res/layout/module_layout.xml @@ -28,7 +28,6 @@ android:layout_height="@dimen/contact_actions_image_size" android:layout_marginStart="@dimen/contact_actions_image_margin" android:layout_marginEnd="@dimen/contact_actions_image_margin" - android:tint="@color/dialer_secondary_text_color" android:scaleType="center"/>