Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77fd9816 authored by Danny Wang's avatar Danny Wang
Browse files

autoclick: Update panel theme when system theme is changed

Verified this change on DUT since the theme change still use the same
color token.
screencast: http://go/scrcast/NDY2NDk0ODcwNDY3Mzc5MnwyMzU5ZDc5Ni1kNQ

Bug: b/423936900 b/424517779
Test: atest AutoclickControllerTest, manually verified on DUT
Flag: com.android.server.accessibility.enable_autoclick_indicator
Change-Id: I7eca0d054f0509be8c8831400de6cbd0d6506906
parent 0e68e023
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2025 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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/materialColorOnPrimary" android:state_selected="true"/>
    <item android:color="@color/materialColorOnSurface"/>
</selector>
+20 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2025 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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/materialColorPrimary" android:state_selected="true"/>
    <item android:color="@color/materialColorSurfaceContainer"/>
</selector>
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,6 @@
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/materialColorSurfaceContainer" />
    <solid android:color="@color/accessibility_autoclick_type_button_container_background" />
    <corners android:radius="24dp" />
</shape>
+1 −1
Original line number Diff line number Diff line
@@ -1765,7 +1765,7 @@ please see styles_device_defaults.xml.
        <item name="android:layout_height">wrap_content</item>
        <item name="android:scaleType">center</item>
        <item name="android:background">@android:color/transparent</item>
        <item name="android:tint">@color/materialColorOnSurface</item>
        <item name="android:tint">@color/accessibility_autoclick_type_button_color</item>
    </style>

    <style name="AccessibilityAutoclickScrollPanelButtonLayoutStyle">
+6 −1
Original line number Diff line number Diff line
@@ -664,10 +664,15 @@ public class AutoclickController extends BaseEventStreamTransformation implement

    @Override
    public void onConfigurationChanged(@NonNull Configuration newConfig) {
        // TODO(b/431038033): Add a similar onConfigurationChanged to AutoclickScrollPanel.
        // When system configuration is changed, update the indicator view
        // and type panel configuration.
        if (mAutoclickIndicatorView != null) {
            // When system configuration is changed, update the indicator view configuration.
            mAutoclickIndicatorView.onConfigurationChanged(newConfig);
        }
        if (mAutoclickTypePanel != null) {
            mAutoclickTypePanel.onConfigurationChanged(newConfig);
        }
    }

    @Override
Loading