From 6ca8c72289f7bbaab3bf0ae3a37cc26d9cb93923 Mon Sep 17 00:00:00 2001 From: wangqi Date: Thu, 29 Mar 2018 10:19:58 -0700 Subject: Replace png icons with vector drawable for video call screen. Bug: 76221932 Test: manual PiperOrigin-RevId: 190948113 Change-Id: I4151ab3fc5231183d49fc1bdc247a09e5ffadc22 --- .../android/incallui/ReturnToCallController.java | 5 ++-- java/com/android/incallui/StatusBarNotifier.java | 4 +-- .../incallui/answer/impl/AnswerFragment.java | 2 +- .../incallui/incall/impl/ButtonController.java | 3 +- .../android/incallui/rtt/impl/RttOverflowMenu.java | 3 +- .../speakerbuttonlogic/SpeakerButtonInfo.java | 27 ++++-------------- .../video/impl/SpeakerButtonController.java | 12 ++++---- .../layout-land/videocall_controls_surfaceview.xml | 16 +++-------- .../impl/res/layout-v21/switch_camera_button.xml | 15 ++++++++++ .../video/impl/res/layout/frag_videocall.xml | 19 +++++++++++-- .../video/impl/res/layout/frag_videocall_land.xml | 19 +++++++++++-- .../impl/res/layout/frag_videocall_surfaceview.xml | 5 ++-- .../video/impl/res/layout/switch_camera_button.xml | 14 ++++++++++ .../video/impl/res/layout/video_contact_grid.xml | 14 ++++++++++ .../video/impl/res/layout/videocall_controls.xml | 30 ++++++++++++-------- .../impl/res/layout/videocall_controls_land.xml | 32 ++++++++++++---------- .../res/layout/videocall_controls_surfaceview.xml | 16 +++-------- .../video/impl/res/values-h580dp/dimens.xml | 1 + .../video/impl/res/values-w460dp/dimens.xml | 1 + .../incallui/video/impl/res/values/dimens.xml | 1 + .../incallui/video/impl/res/values/styles.xml | 5 +++- 21 files changed, 150 insertions(+), 94 deletions(-) (limited to 'java/com/android/incallui') diff --git a/java/com/android/incallui/ReturnToCallController.java b/java/com/android/incallui/ReturnToCallController.java index 9dfb73bae..d5e6a1001 100644 --- a/java/com/android/incallui/ReturnToCallController.java +++ b/java/com/android/incallui/ReturnToCallController.java @@ -44,7 +44,6 @@ import com.android.incallui.call.CallList; import com.android.incallui.call.CallList.Listener; import com.android.incallui.call.DialerCall; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; -import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; import java.lang.ref.WeakReference; import java.util.ArrayList; import java.util.List; @@ -280,7 +279,7 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio @NonNull private List generateActions() { List actions = new ArrayList<>(); - SpeakerButtonInfo speakerButtonInfo = new SpeakerButtonInfo(audioState, IconSize.SIZE_24_DP); + SpeakerButtonInfo speakerButtonInfo = new SpeakerButtonInfo(audioState); // Return to call actions.add( @@ -294,7 +293,7 @@ public class ReturnToCallController implements InCallUiListener, Listener, Audio // Mute/unmute actions.add( Action.builder() - .setIconDrawable(context.getDrawable(R.drawable.quantum_ic_mic_off_white_24)) + .setIconDrawable(context.getDrawable(R.drawable.quantum_ic_mic_off_vd_theme_24)) .setChecked(audioState.isMuted()) .setIntent(toggleMute) .setName(context.getText(R.string.incall_label_mute)) diff --git a/java/com/android/incallui/StatusBarNotifier.java b/java/com/android/incallui/StatusBarNotifier.java index 503df6c88..9a2753219 100644 --- a/java/com/android/incallui/StatusBarNotifier.java +++ b/java/com/android/incallui/StatusBarNotifier.java @@ -916,7 +916,7 @@ public class StatusBarNotifier createNotificationPendingIntent(context, ACTION_TURN_ON_SPEAKER); builder.addAction( new Notification.Action.Builder( - Icon.createWithResource(context, R.drawable.quantum_ic_volume_up_white_24), + Icon.createWithResource(context, R.drawable.quantum_ic_volume_up_vd_theme_24), context.getText(R.string.notification_action_speaker_on), speakerOnPendingIntent) .build()); @@ -930,7 +930,7 @@ public class StatusBarNotifier createNotificationPendingIntent(context, ACTION_TURN_OFF_SPEAKER); builder.addAction( new Notification.Action.Builder( - Icon.createWithResource(context, R.drawable.quantum_ic_phone_in_talk_white_24), + Icon.createWithResource(context, R.drawable.quantum_ic_phone_in_talk_vd_theme_24), context.getText(R.string.notification_action_speaker_off), speakerOffPendingIntent) .build()); diff --git a/java/com/android/incallui/answer/impl/AnswerFragment.java b/java/com/android/incallui/answer/impl/AnswerFragment.java index e5271f5c2..77352f94b 100644 --- a/java/com/android/incallui/answer/impl/AnswerFragment.java +++ b/java/com/android/incallui/answer/impl/AnswerFragment.java @@ -174,7 +174,7 @@ public class AnswerFragment extends Fragment }, ANSWER_VIDEO_AS_AUDIO( - R.drawable.quantum_ic_videocam_off_white_24, + R.drawable.quantum_ic_videocam_off_vd_theme_24, R.string.a11y_description_incoming_call_answer_video_as_audio, R.string.a11y_incoming_call_answer_video_as_audio, R.string.call_incoming_swipe_to_answer_video_as_audio) { diff --git a/java/com/android/incallui/incall/impl/ButtonController.java b/java/com/android/incallui/incall/impl/ButtonController.java index dd11fff33..98460c704 100644 --- a/java/com/android/incallui/incall/impl/ButtonController.java +++ b/java/com/android/incallui/incall/impl/ButtonController.java @@ -31,7 +31,6 @@ import com.android.incallui.incall.protocol.InCallButtonIds; import com.android.incallui.incall.protocol.InCallButtonUiDelegate; import com.android.incallui.incall.protocol.InCallScreenDelegate; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; -import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; /** Manages a single button. */ interface ButtonController { @@ -379,7 +378,7 @@ interface ButtonController { } public void setAudioState(CallAudioState audioState) { - SpeakerButtonInfo info = new SpeakerButtonInfo(audioState, IconSize.SIZE_36_DP); + SpeakerButtonInfo info = new SpeakerButtonInfo(audioState); checkable = info.checkable; isChecked = info.isChecked; diff --git a/java/com/android/incallui/rtt/impl/RttOverflowMenu.java b/java/com/android/incallui/rtt/impl/RttOverflowMenu.java index 2a061c546..6a7aeba96 100644 --- a/java/com/android/incallui/rtt/impl/RttOverflowMenu.java +++ b/java/com/android/incallui/rtt/impl/RttOverflowMenu.java @@ -24,7 +24,6 @@ import com.android.incallui.incall.protocol.InCallButtonUiDelegate; import com.android.incallui.incall.protocol.InCallScreenDelegate; import com.android.incallui.rtt.impl.RttCheckableButton.OnCheckedChangeListener; import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo; -import com.android.incallui.speakerbuttonlogic.SpeakerButtonInfo.IconSize; /** Overflow menu for RTT call. */ public class RttOverflowMenu extends PopupWindow implements OnCheckedChangeListener { @@ -89,7 +88,7 @@ public class RttOverflowMenu extends PopupWindow implements OnCheckedChangeListe } void setAudioState(CallAudioState audioState) { - SpeakerButtonInfo info = new SpeakerButtonInfo(audioState, IconSize.SIZE_24_DP); + SpeakerButtonInfo info = new SpeakerButtonInfo(audioState); if (info.checkable) { speakerButton.setChecked(info.isChecked); speakerButton.setOnClickListener(null); diff --git a/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java b/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java index 5ab821be0..58fd40fb4 100644 --- a/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java +++ b/java/com/android/incallui/speakerbuttonlogic/SpeakerButtonInfo.java @@ -42,7 +42,7 @@ public class SpeakerButtonInfo { public final boolean checkable; public final boolean isChecked; - public SpeakerButtonInfo(CallAudioState audioState, @IconSize int iconSize) { + public SpeakerButtonInfo(CallAudioState audioState) { if ((audioState.getSupportedRouteMask() & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) { checkable = false; @@ -51,40 +51,25 @@ public class SpeakerButtonInfo { if ((audioState.getRoute() & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) { - icon = - iconSize == IconSize.SIZE_36_DP - ? R.drawable.quantum_ic_bluetooth_audio_white_36 - : R.drawable.quantum_ic_bluetooth_audio_white_24; + icon = R.drawable.quantum_ic_bluetooth_audio_vd_theme_24; contentDescription = R.string.incall_content_description_bluetooth; } else if ((audioState.getRoute() & CallAudioState.ROUTE_SPEAKER) == CallAudioState.ROUTE_SPEAKER) { - icon = - iconSize == IconSize.SIZE_36_DP - ? R.drawable.quantum_ic_volume_up_white_36 - : R.drawable.quantum_ic_volume_up_white_24; + icon = R.drawable.quantum_ic_volume_up_vd_theme_24; contentDescription = R.string.incall_content_description_speaker; } else if ((audioState.getRoute() & CallAudioState.ROUTE_WIRED_HEADSET) == CallAudioState.ROUTE_WIRED_HEADSET) { - icon = - iconSize == IconSize.SIZE_36_DP - ? R.drawable.quantum_ic_headset_white_36 - : R.drawable.quantum_ic_headset_white_24; + icon = R.drawable.quantum_ic_headset_vd_theme_24; contentDescription = R.string.incall_content_description_headset; } else { - icon = - iconSize == IconSize.SIZE_36_DP - ? R.drawable.quantum_ic_phone_in_talk_white_36 - : R.drawable.quantum_ic_phone_in_talk_white_24; + icon = R.drawable.quantum_ic_phone_in_talk_vd_theme_24; contentDescription = R.string.incall_content_description_earpiece; } } else { checkable = true; isChecked = audioState.getRoute() == CallAudioState.ROUTE_SPEAKER; label = R.string.incall_label_speaker; - icon = - iconSize == IconSize.SIZE_36_DP - ? R.drawable.quantum_ic_volume_up_white_36 - : R.drawable.quantum_ic_volume_up_white_24; + icon = R.drawable.quantum_ic_volume_up_vd_theme_24; contentDescription = R.string.incall_content_description_speaker; } } diff --git a/java/com/android/incallui/video/impl/SpeakerButtonController.java b/java/com/android/incallui/video/impl/SpeakerButtonController.java index d98545feb..e17cf7b9f 100644 --- a/java/com/android/incallui/video/impl/SpeakerButtonController.java +++ b/java/com/android/incallui/video/impl/SpeakerButtonController.java @@ -36,7 +36,7 @@ public class SpeakerButtonController implements OnCheckedChangeListener, OnClick @NonNull private CheckableImageButton button; - @DrawableRes private int icon = R.drawable.quantum_ic_volume_up_white_36; + @DrawableRes private int icon = R.drawable.quantum_ic_volume_up_vd_theme_24; private boolean isChecked; private boolean checkable; @@ -77,24 +77,24 @@ public class SpeakerButtonController implements OnCheckedChangeListener, OnClick if ((audioState.getRoute() & CallAudioState.ROUTE_BLUETOOTH) == CallAudioState.ROUTE_BLUETOOTH) { - icon = R.drawable.quantum_ic_bluetooth_audio_white_36; + icon = R.drawable.quantum_ic_bluetooth_audio_vd_theme_24; contentDescriptionResId = R.string.incall_content_description_bluetooth; } else if ((audioState.getRoute() & CallAudioState.ROUTE_SPEAKER) == CallAudioState.ROUTE_SPEAKER) { - icon = R.drawable.quantum_ic_volume_up_white_36; + icon = R.drawable.quantum_ic_volume_up_vd_theme_24; contentDescriptionResId = R.string.incall_content_description_speaker; } else if ((audioState.getRoute() & CallAudioState.ROUTE_WIRED_HEADSET) == CallAudioState.ROUTE_WIRED_HEADSET) { - icon = R.drawable.quantum_ic_headset_white_36; + icon = R.drawable.quantum_ic_headset_vd_theme_24; contentDescriptionResId = R.string.incall_content_description_headset; } else { - icon = R.drawable.quantum_ic_phone_in_talk_white_36; + icon = R.drawable.quantum_ic_phone_in_talk_vd_theme_24; contentDescriptionResId = R.string.incall_content_description_earpiece; } } else { checkable = true; isChecked = audioState.getRoute() == CallAudioState.ROUTE_SPEAKER; - icon = R.drawable.quantum_ic_volume_up_white_36; + icon = R.drawable.quantum_ic_volume_up_vd_theme_24; contentDescriptionResId = R.string.incall_content_description_speaker; } diff --git a/java/com/android/incallui/video/impl/res/layout-land/videocall_controls_surfaceview.xml b/java/com/android/incallui/video/impl/res/layout-land/videocall_controls_surfaceview.xml index 40b50bc70..9a3682f02 100644 --- a/java/com/android/incallui/video/impl/res/layout-land/videocall_controls_surfaceview.xml +++ b/java/com/android/incallui/video/impl/res/layout-land/videocall_controls_surfaceview.xml @@ -60,33 +60,25 @@ @@ -111,7 +103,7 @@ android:layout_width="@dimen/videocall_button_size" android:layout_height="@dimen/videocall_button_size" android:contentDescription="@string/incall_content_description_swap_calls" - android:src="@drawable/quantum_ic_swap_calls_white_36" + android:src="@drawable/quantum_ic_swap_calls_vd_theme_24" android:visibility="gone" tools:visibility="visible" /> diff --git a/java/com/android/incallui/video/impl/res/layout-v21/switch_camera_button.xml b/java/com/android/incallui/video/impl/res/layout-v21/switch_camera_button.xml index 1fb1bb088..66602837e 100644 --- a/java/com/android/incallui/video/impl/res/layout-v21/switch_camera_button.xml +++ b/java/com/android/incallui/video/impl/res/layout-v21/switch_camera_button.xml @@ -1,6 +1,21 @@ + diff --git a/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml b/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml index f8c6fc3c7..ed32ae235 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_videocall.xml @@ -1,4 +1,18 @@ + diff --git a/java/com/android/incallui/video/impl/res/layout/frag_videocall_land.xml b/java/com/android/incallui/video/impl/res/layout/frag_videocall_land.xml index 2353deea1..f74456963 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_videocall_land.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_videocall_land.xml @@ -1,4 +1,18 @@ + @@ -93,7 +107,8 @@ android:background="@drawable/videocall_background_circle_white" android:contentDescription="@string/incall_content_description_muted" android:scaleType="center" - android:src="@drawable/quantum_ic_mic_off_black_24" + android:src="@drawable/quantum_ic_mic_off_vd_theme_24" + android:tint="@android:color/black" android:visibility="gone" tools:visibility="visible"/> diff --git a/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml b/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml index 1a2bc2429..dd1bd61c2 100644 --- a/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml +++ b/java/com/android/incallui/video/impl/res/layout/frag_videocall_surfaceview.xml @@ -65,7 +65,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:scaleType="center" - android:src="@drawable/quantum_ic_videocam_off_white_24" + android:src="@drawable/quantum_ic_videocam_off_vd_theme_24" android:tint="@color/videocall_camera_off_tint" android:tintMode="src_in" android:visibility="gone" @@ -84,7 +84,8 @@ android:background="@drawable/videocall_background_circle_white" android:contentDescription="@string/incall_content_description_muted" android:scaleType="center" - android:src="@drawable/quantum_ic_mic_off_black_24" + android:src="@drawable/quantum_ic_mic_off_vd_theme_24" + android:tint="@android:color/black" android:visibility="gone" tools:visibility="visible"/> diff --git a/java/com/android/incallui/video/impl/res/layout/switch_camera_button.xml b/java/com/android/incallui/video/impl/res/layout/switch_camera_button.xml index 87c2e1b6c..f473dd8c3 100644 --- a/java/com/android/incallui/video/impl/res/layout/switch_camera_button.xml +++ b/java/com/android/incallui/video/impl/res/layout/switch_camera_button.xml @@ -1,4 +1,18 @@ + + + @@ -92,10 +100,8 @@ diff --git a/java/com/android/incallui/video/impl/res/layout/videocall_controls_land.xml b/java/com/android/incallui/video/impl/res/layout/videocall_controls_land.xml index d71b3c00e..404e5c842 100644 --- a/java/com/android/incallui/video/impl/res/layout/videocall_controls_land.xml +++ b/java/com/android/incallui/video/impl/res/layout/videocall_controls_land.xml @@ -1,4 +1,18 @@ + @@ -93,10 +99,8 @@ diff --git a/java/com/android/incallui/video/impl/res/layout/videocall_controls_surfaceview.xml b/java/com/android/incallui/video/impl/res/layout/videocall_controls_surfaceview.xml index d2dc992b7..7cea79267 100644 --- a/java/com/android/incallui/video/impl/res/layout/videocall_controls_surfaceview.xml +++ b/java/com/android/incallui/video/impl/res/layout/videocall_controls_surfaceview.xml @@ -61,33 +61,25 @@ @@ -112,7 +104,7 @@ android:layout_width="@dimen/videocall_button_size" android:layout_height="@dimen/videocall_button_size" android:contentDescription="@string/incall_content_description_swap_calls" - android:src="@drawable/quantum_ic_swap_calls_white_36" + android:src="@drawable/quantum_ic_swap_calls_vd_theme_24" android:visibility="gone" tools:visibility="visible" /> diff --git a/java/com/android/incallui/video/impl/res/values-h580dp/dimens.xml b/java/com/android/incallui/video/impl/res/values-h580dp/dimens.xml index e9e7f9e8b..d4a5e17d6 100644 --- a/java/com/android/incallui/video/impl/res/values-h580dp/dimens.xml +++ b/java/com/android/incallui/video/impl/res/values-h580dp/dimens.xml @@ -17,6 +17,7 @@ 16dp 72dp + 18dp 88dp 88dp 116dp diff --git a/java/com/android/incallui/video/impl/res/values-w460dp/dimens.xml b/java/com/android/incallui/video/impl/res/values-w460dp/dimens.xml index e9e7f9e8b..d4a5e17d6 100644 --- a/java/com/android/incallui/video/impl/res/values-w460dp/dimens.xml +++ b/java/com/android/incallui/video/impl/res/values-w460dp/dimens.xml @@ -17,6 +17,7 @@ 16dp 72dp + 18dp 88dp 88dp 116dp diff --git a/java/com/android/incallui/video/impl/res/values/dimens.xml b/java/com/android/incallui/video/impl/res/values/dimens.xml index 606b158d9..b6449a6d1 100644 --- a/java/com/android/incallui/video/impl/res/values/dimens.xml +++ b/java/com/android/incallui/video/impl/res/values/dimens.xml @@ -23,4 +23,5 @@ 24dp 8dp 60dp + 12dp diff --git a/java/com/android/incallui/video/impl/res/values/styles.xml b/java/com/android/incallui/video/impl/res/values/styles.xml index 010aca2d1..03395d989 100644 --- a/java/com/android/incallui/video/impl/res/values/styles.xml +++ b/java/com/android/incallui/video/impl/res/values/styles.xml @@ -16,10 +16,13 @@ -->