summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/incall/impl
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/incallui/incall/impl')
-rw-r--r--java/com/android/incallui/incall/impl/ButtonController.java22
-rw-r--r--java/com/android/incallui/incall/impl/res/drawable/incall_button_background_more.xml17
2 files changed, 27 insertions, 12 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();
}
}
diff --git a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_more.xml b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_more.xml
index 6755f0fae..8faa35bea 100644
--- a/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_more.xml
+++ b/java/com/android/incallui/incall/impl/res/drawable/incall_button_background_more.xml
@@ -1,4 +1,18 @@
-<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2018 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<selector>
@@ -25,6 +39,7 @@
<item>
<bitmap
android:gravity="end"
+ android:tint="@color/incall_button_icon"
android:src="@drawable/quantum_ic_arrow_drop_down_white_18"/>
</item>
</layer-list>