summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/historyitemactions
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-04-26 13:00:04 -0700
committerCopybara-Service <copybara-piper@google.com>2018-04-26 20:37:51 -0700
commit4db07410fbf823158a8cd3edcc7a6e1d72cc607f (patch)
tree0a7561302e6a9cc929e33a8b1cbea448abbf923c /java/com/android/dialer/historyitemactions
parent49c5ea2e3085ff4f54b75a936b5a37ae96452b70 (diff)
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
Diffstat (limited to 'java/com/android/dialer/historyitemactions')
-rw-r--r--java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java8
-rw-r--r--java/com/android/dialer/historyitemactions/HistoryItemActionModule.java5
-rw-r--r--java/com/android/dialer/historyitemactions/res/layout/module_layout.xml1
3 files changed, 13 insertions, 1 deletions
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"/>
<TextView