diff options
author | yueg <yueg@google.com> | 2018-04-10 16:41:49 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-10 16:44:15 -0700 |
commit | bea76bf6e5de3c99990490d9b66023b99a926111 (patch) | |
tree | abeae6999ee5b32bdb0473abeaeee45ce7963478 /java/com/android/incallui/incall/impl/ButtonController.java | |
parent | 6dab61fec518d3ff34265b1ce1fb8614e2660fee (diff) |
Change speaker button for in call UI and bubble.
Bug: 74238896
Test: ButtonControllerTest
PiperOrigin-RevId: 192370117
Change-Id: I265cc9541957c2dd376176ed7a703b4938fe4563
Diffstat (limited to 'java/com/android/incallui/incall/impl/ButtonController.java')
-rw-r--r-- | java/com/android/incallui/incall/impl/ButtonController.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/java/com/android/incallui/incall/impl/ButtonController.java b/java/com/android/incallui/incall/impl/ButtonController.java index 9106dab9d..328ebbe67 100644 --- a/java/com/android/incallui/incall/impl/ButtonController.java +++ b/java/com/android/incallui/incall/impl/ButtonController.java @@ -312,10 +312,10 @@ interface ButtonController { @StringRes private int label = R.string.incall_label_speaker; @DrawableRes private int icon = R.drawable.quantum_ic_volume_up_vd_theme_24; - private boolean checkable; + private boolean nonBluetoothMode; private CharSequence contentDescription; - private CharSequence checkedContentDescription; - private CharSequence uncheckedContentDescription; + private CharSequence isOnContentDescription; + private CharSequence isOffContentDescription; public SpeakerButtonController(@NonNull InCallButtonUiDelegate delegate) { this.delegate = delegate; @@ -367,31 +367,31 @@ interface ButtonController { button.setEnabled(isEnabled && isAllowed); button.setVisibility(View.VISIBLE); button.setChecked(isChecked); - button.setOnClickListener(checkable ? null : this); - button.setOnCheckedChangeListener(checkable ? this : null); + button.setOnClickListener(nonBluetoothMode ? null : this); + button.setOnCheckedChangeListener(nonBluetoothMode ? this : null); button.setLabelText(label); button.setIconDrawable(icon); button.setContentDescription( - isChecked ? checkedContentDescription : uncheckedContentDescription); - button.setShouldShowMoreIndicator(!checkable); + (nonBluetoothMode && !isChecked) ? isOffContentDescription : isOnContentDescription); + button.setShouldShowMoreIndicator(!nonBluetoothMode); } } public void setAudioState(CallAudioState audioState) { SpeakerButtonInfo info = new SpeakerButtonInfo(audioState); - checkable = info.checkable; + nonBluetoothMode = info.nonBluetoothMode; isChecked = info.isChecked; label = info.label; icon = info.icon; @StringRes int contentDescriptionResId = info.contentDescription; contentDescription = delegate.getContext().getText(contentDescriptionResId); - checkedContentDescription = + isOnContentDescription = TextUtils.concat( contentDescription, delegate.getContext().getText(R.string.incall_talkback_speaker_on)); - uncheckedContentDescription = + isOffContentDescription = TextUtils.concat( contentDescription, delegate.getContext().getText(R.string.incall_talkback_speaker_off)); @@ -406,7 +406,7 @@ interface ButtonController { @Override public void onCheckedChanged(CheckableLabeledButton checkableLabeledButton, boolean isChecked) { checkableLabeledButton.setContentDescription( - isChecked ? checkedContentDescription : uncheckedContentDescription); + isChecked ? isOnContentDescription : isOffContentDescription); delegate.toggleSpeakerphone(); } } |