summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/historyitemactions
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-03-29 10:10:48 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-29 11:25:46 -0700
commit756f013f4797403347ae43a5ab60e8b9e884f124 (patch)
tree3f069e9df345e44ecef8b48f939a52f51393bb9a /java/com/android/dialer/historyitemactions
parente7d6381c9cafa809da51a0fe3f567773b6c73614 (diff)
Badge contact photos for video calls in the bottom sheet.
Bug: 70988682 Test: Existing tests PiperOrigin-RevId: 190946639 Change-Id: Iaa8294e8ba6e85ab3c27bb2e67200d7972a240f2
Diffstat (limited to 'java/com/android/dialer/historyitemactions')
-rw-r--r--java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java25
-rw-r--r--java/com/android/dialer/historyitemactions/res/layout/contact_layout.xml15
2 files changed, 16 insertions, 24 deletions
diff --git a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java
index ce303272c..79205a7d9 100644
--- a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java
+++ b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java
@@ -28,42 +28,37 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.android.dialer.common.Assert;
-import com.android.dialer.glidephotomanager.GlidePhotoManager;
+import com.android.dialer.widget.ContactPhotoView;
import java.util.List;
/**
* {@link BottomSheetDialog} used to show a list of actions in a bottom sheet menu.
*
- * <p>{@link #show(Context, HistoryItemBottomSheetHeaderInfo, List, GlidePhotoManager)} should be
- * used to create and display the menu. Modules are built using {@link HistoryItemActionModule} and
- * some defaults are provided by {@link IntentModule} and {@link DividerModule}.
+ * <p>{@link #show(Context, HistoryItemBottomSheetHeaderInfo, List)} should be used to create and
+ * display the menu. Modules are built using {@link HistoryItemActionModule} and some defaults are
+ * provided by {@link IntentModule} and {@link DividerModule}.
*/
public class HistoryItemActionBottomSheet extends BottomSheetDialog implements OnClickListener {
private final List<HistoryItemActionModule> modules;
private final HistoryItemBottomSheetHeaderInfo historyItemBottomSheetHeaderInfo;
- private final GlidePhotoManager glidePhotoManager;
private HistoryItemActionBottomSheet(
Context context,
HistoryItemBottomSheetHeaderInfo historyItemBottomSheetHeaderInfo,
- List<HistoryItemActionModule> modules,
- GlidePhotoManager glidePhotoManager) {
+ List<HistoryItemActionModule> modules) {
super(context);
this.modules = modules;
this.historyItemBottomSheetHeaderInfo = historyItemBottomSheetHeaderInfo;
- this.glidePhotoManager = glidePhotoManager;
setContentView(LayoutInflater.from(context).inflate(R.layout.sheet_layout, null));
}
public static HistoryItemActionBottomSheet show(
Context context,
HistoryItemBottomSheetHeaderInfo historyItemBottomSheetHeaderInfo,
- List<HistoryItemActionModule> modules,
- GlidePhotoManager glidePhotoManager) {
+ List<HistoryItemActionModule> modules) {
HistoryItemActionBottomSheet sheet =
- new HistoryItemActionBottomSheet(
- context, historyItemBottomSheetHeaderInfo, modules, glidePhotoManager);
+ new HistoryItemActionBottomSheet(context, historyItemBottomSheetHeaderInfo, modules);
sheet.show();
return sheet;
}
@@ -87,10 +82,8 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O
LayoutInflater inflater = LayoutInflater.from(getContext());
View contactView = inflater.inflate(R.layout.contact_layout, container, false);
- // TODO(zachh): The contact image should be badged with a video icon if it is for a video call.
- glidePhotoManager.loadQuickContactBadge(
- contactView.findViewById(R.id.quick_contact_photo),
- historyItemBottomSheetHeaderInfo.getPhotoInfo());
+ ContactPhotoView contactPhotoView = contactView.findViewById(R.id.contact_photo_view);
+ contactPhotoView.setPhoto(historyItemBottomSheetHeaderInfo.getPhotoInfo());
TextView primaryTextView = contactView.findViewById(R.id.primary_text);
TextView secondaryTextView = contactView.findViewById(R.id.secondary_text);
diff --git a/java/com/android/dialer/historyitemactions/res/layout/contact_layout.xml b/java/com/android/dialer/historyitemactions/res/layout/contact_layout.xml
index 4deef3e07..f2dc8c7ac 100644
--- a/java/com/android/dialer/historyitemactions/res/layout/contact_layout.xml
+++ b/java/com/android/dialer/historyitemactions/res/layout/contact_layout.xml
@@ -23,14 +23,13 @@
android:gravity="center_vertical"
android:orientation="horizontal">
- <QuickContactBadge
- android:id="@+id/quick_contact_photo"
- android:layout_width="@dimen/contact_actions_image_size"
- 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:padding="4dp"
- android:focusable="true"/>
+ <com.android.dialer.widget.ContactPhotoView
+ android:id="@+id/contact_photo_view"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="10dp"
+ android:layout_marginEnd="10dp"
+ android:minHeight="@dimen/contact_actions_image_size"/>
<LinearLayout
android:layout_width="wrap_content"