summaryrefslogtreecommitdiff
path: root/java/com/android/dialer
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2018-03-28 13:09:47 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-28 13:51:52 -0700
commit8dc242deac3ef9f96f0ab7de0048477dd64b6a32 (patch)
treebf7a52f0e451dd1dde272d47f4baf4bd6043a1d3 /java/com/android/dialer
parentc9e06d9dd4c210bf7ed7cc3cf81d1acaa8d6089f (diff)
Replace assets "quantum_ic_videocam_white_24" with a vector asset.
Test: Existing tests PiperOrigin-RevId: 190820867 Change-Id: I4835bcbc7698075fb54015dccc6823ada4c71651
Diffstat (limited to 'java/com/android/dialer')
-rw-r--r--java/com/android/dialer/app/res/layout/call_log_list_item_actions.xml6
-rw-r--r--java/com/android/dialer/calllogutils/CallTypeIconsView.java12
-rw-r--r--java/com/android/dialer/historyitemactions/IntentModule.java2
-rw-r--r--java/com/android/dialer/searchfragment/cp2/SearchContactViewHolder.java2
-rw-r--r--java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml2
5 files changed, 15 insertions, 9 deletions
diff --git a/java/com/android/dialer/app/res/layout/call_log_list_item_actions.xml b/java/com/android/dialer/app/res/layout/call_log_list_item_actions.xml
index 7df0d1551..56d1daf6a 100644
--- a/java/com/android/dialer/app/res/layout/call_log_list_item_actions.xml
+++ b/java/com/android/dialer/app/res/layout/call_log_list_item_actions.xml
@@ -64,7 +64,7 @@
<ImageView
style="@style/CallLogActionIconStyle"
- android:src="@drawable/quantum_ic_videocam_white_24"/>
+ android:src="@drawable/quantum_ic_videocam_vd_white_24"/>
<TextView
style="@style/CallLogActionTextStyle"
@@ -78,7 +78,7 @@
<ImageView
style="@style/CallLogActionIconStyle"
- android:src="@drawable/quantum_ic_videocam_white_24"/>
+ android:src="@drawable/quantum_ic_videocam_vd_white_24"/>
<TextView
style="@style/CallLogActionTextStyle"
@@ -92,7 +92,7 @@
<ImageView
style="@style/CallLogActionIconStyle"
- android:src="@drawable/quantum_ic_videocam_white_24"/>
+ android:src="@drawable/quantum_ic_videocam_vd_white_24"/>
<TextView
style="@style/CallLogActionTextStyle"
diff --git a/java/com/android/dialer/calllogutils/CallTypeIconsView.java b/java/com/android/dialer/calllogutils/CallTypeIconsView.java
index 3d2b561f1..1795438fb 100644
--- a/java/com/android/dialer/calllogutils/CallTypeIconsView.java
+++ b/java/com/android/dialer/calllogutils/CallTypeIconsView.java
@@ -19,7 +19,6 @@ package com.android.dialer.calllogutils;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PorterDuff;
import android.graphics.drawable.BitmapDrawable;
@@ -297,7 +296,7 @@ public class CallTypeIconsView extends View {
blocked = drawable.mutate();
blocked.setColorFilter(r.getColor(R.color.blocked_call), PorterDuff.Mode.MULTIPLY);
- iconId = R.drawable.quantum_ic_videocam_white_24;
+ iconId = R.drawable.quantum_ic_videocam_vd_white_24;
drawable = largeIcons ? r.getDrawable(iconId) : getScaledBitmap(context, iconId);
videoCall = drawable.mutate();
videoCall.setColorFilter(r.getColor(R.color.icon_color_grey), PorterDuff.Mode.MULTIPLY);
@@ -324,7 +323,14 @@ public class CallTypeIconsView extends View {
// Gets the icon, scaled to the height of the call type icons. This helps display all the
// icons to be the same height, while preserving their width aspect ratio.
private Drawable getScaledBitmap(Context context, int resourceId) {
- Bitmap icon = BitmapFactory.decodeResource(context.getResources(), resourceId);
+ Drawable drawable = context.getDrawable(resourceId);
+ Bitmap icon =
+ Bitmap.createBitmap(
+ drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
+ Canvas canvas = new Canvas(icon);
+ drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
+ drawable.draw(canvas);
+
int scaledHeight = context.getResources().getDimensionPixelSize(R.dimen.call_type_icon_size);
int scaledWidth =
(int) ((float) icon.getWidth() * ((float) scaledHeight / (float) icon.getHeight()));
diff --git a/java/com/android/dialer/historyitemactions/IntentModule.java b/java/com/android/dialer/historyitemactions/IntentModule.java
index dfe9bb064..efb10e8bb 100644
--- a/java/com/android/dialer/historyitemactions/IntentModule.java
+++ b/java/com/android/dialer/historyitemactions/IntentModule.java
@@ -91,6 +91,6 @@ public class IntentModule implements HistoryItemActionModule {
.setPhoneAccountHandle(phoneAccountHandle)
.setIsVideoCall(true)),
R.string.video_call,
- R.drawable.quantum_ic_videocam_white_24);
+ R.drawable.quantum_ic_videocam_vd_white_24);
}
}
diff --git a/java/com/android/dialer/searchfragment/cp2/SearchContactViewHolder.java b/java/com/android/dialer/searchfragment/cp2/SearchContactViewHolder.java
index 9d18e07b1..de9ce5a56 100644
--- a/java/com/android/dialer/searchfragment/cp2/SearchContactViewHolder.java
+++ b/java/com/android/dialer/searchfragment/cp2/SearchContactViewHolder.java
@@ -179,7 +179,7 @@ public final class SearchContactViewHolder extends ViewHolder implements OnClick
case CallToAction.VIDEO_CALL:
callToActionView.setVisibility(View.VISIBLE);
callToActionView.setImageDrawable(
- context.getDrawable(R.drawable.quantum_ic_videocam_white_24));
+ context.getDrawable(R.drawable.quantum_ic_videocam_vd_white_24));
callToActionView.setContentDescription(
context.getString(R.string.description_search_video_call));
callToActionView.setOnClickListener(this);
diff --git a/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml b/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
index fb476659c..b4af686b7 100644
--- a/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
+++ b/java/com/android/dialer/speeddial/res/layout/favorite_item_layout.xml
@@ -50,7 +50,7 @@
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
- android:src="@drawable/quantum_ic_videocam_white_24"/>
+ android:src="@drawable/quantum_ic_videocam_vd_white_24"/>
</FrameLayout>
</FrameLayout>