From 41eb2f5a58c8a1d4caae7385ecc4374a9851c3b8 Mon Sep 17 00:00:00 2001 From: yueg Date: Wed, 31 Jan 2018 14:01:57 -0800 Subject: Add arrow icon to bubble sound button when Bluetooth is connected. It's an indicator that the button triggers another list. Bug: 67605985 Test: manual PiperOrigin-RevId: 184042869 Change-Id: I3fea526a322dcc3935af111ebd0916b7c5ffcb24 --- .../quantum_ic_arrow_drop_down_vd_theme_24.xml | 25 ++++++++++++++++++++++ .../incallui/NewReturnToCallController.java | 4 ++++ java/com/android/newbubble/NewBubbleInfo.java | 8 ++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 assets/quantum/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml diff --git a/assets/quantum/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml b/assets/quantum/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml new file mode 100644 index 000000000..0c1c4f0eb --- /dev/null +++ b/assets/quantum/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml @@ -0,0 +1,25 @@ + + + + \ No newline at end of file diff --git a/java/com/android/incallui/NewReturnToCallController.java b/java/com/android/incallui/NewReturnToCallController.java index 0b637f89c..e37b14734 100644 --- a/java/com/android/incallui/NewReturnToCallController.java +++ b/java/com/android/incallui/NewReturnToCallController.java @@ -275,6 +275,10 @@ public class NewReturnToCallController implements InCallUiListener, Listener, Au actions.add( Action.builder() .setIconDrawable(context.getDrawable(speakerButtonInfo.icon)) + .setSecondaryIconDrawable( + speakerButtonInfo.checkable + ? null + : context.getDrawable(R.drawable.quantum_ic_arrow_drop_down_vd_theme_24)) .setName(context.getText(speakerButtonInfo.label)) .setCheckable(speakerButtonInfo.checkable) .setChecked(speakerButtonInfo.isChecked) diff --git a/java/com/android/newbubble/NewBubbleInfo.java b/java/com/android/newbubble/NewBubbleInfo.java index cc7ac7c6f..d9232a5a0 100644 --- a/java/com/android/newbubble/NewBubbleInfo.java +++ b/java/com/android/newbubble/NewBubbleInfo.java @@ -80,6 +80,9 @@ public abstract class NewBubbleInfo { public abstract Drawable getIconDrawable(); + @Nullable + public abstract Drawable getSecondaryIconDrawable(); + @NonNull public abstract CharSequence getName(); @@ -100,7 +103,8 @@ public abstract class NewBubbleInfo { .setChecked(action.isChecked()) .setCheckable(action.isCheckable()) .setName(action.getName()) - .setIconDrawable(action.getIconDrawable()); + .setIconDrawable(action.getIconDrawable()) + .setSecondaryIconDrawable(action.getSecondaryIconDrawable()); } /** Builder for {@link Action} */ @@ -109,6 +113,8 @@ public abstract class NewBubbleInfo { public abstract Builder setIconDrawable(Drawable iconDrawable); + public abstract Builder setSecondaryIconDrawable(@Nullable Drawable secondaryIconDrawable); + public abstract Builder setName(@NonNull CharSequence name); public abstract Builder setIntent(@NonNull PendingIntent intent); -- cgit v1.2.3