summaryrefslogtreecommitdiff
path: root/src/com/android/systemui/car/systembar/CarSystemBarButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/systemui/car/systembar/CarSystemBarButton.java')
-rw-r--r--src/com/android/systemui/car/systembar/CarSystemBarButton.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/systemui/car/systembar/CarSystemBarButton.java b/src/com/android/systemui/car/systembar/CarSystemBarButton.java
index ff163bc9..02bf886c 100644
--- a/src/com/android/systemui/car/systembar/CarSystemBarButton.java
+++ b/src/com/android/systemui/car/systembar/CarSystemBarButton.java
@@ -42,6 +42,7 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.R;
+import com.android.systemui.car.window.OverlayViewController;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.statusbar.AlphaOptimizedImageView;
@@ -52,7 +53,8 @@ import java.net.URISyntaxException;
* xml file level. This allows for more control via overlays instead of having to update
* code.
*/
-public class CarSystemBarButton extends LinearLayout {
+public class CarSystemBarButton extends LinearLayout implements
+ OverlayViewController.OverlayViewStateListener {
private static final String TAG = "CarSystemBarButton";
private static final String BUTTON_FILTER_DELIMITER = ";";
@@ -227,6 +229,11 @@ public class CarSystemBarButton extends LinearLayout {
return mComponentNames;
}
+ @Override
+ public void onVisibilityChanged(boolean isVisible) {
+ setSelected(isVisible);
+ }
+
/**
* Subclasses should override this method to return the {@link RoleManager} role associated
* with this button.
@@ -440,4 +447,9 @@ public class CarSystemBarButton extends LinearLayout {
icon.setAlpha(mHighlightWhenSelected && mSelected ? mSelectedAlpha : mUnselectedAlpha);
}
}
+
+ @Nullable
+ protected UserTracker getUserTracker() {
+ return mUserTracker;
+ }
}