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

Commit 2be49c9b authored by Peter_Liang's avatar Peter_Liang
Browse files

Add new floating action menu for Accessibility targets. (1/n)

Goals:
- Trigger actions of accessibility features would be grouped into the floating menu.

Patch action:
1. Use current Accessibility Target functions to get the corresponding data.
2. The position of the floating menu is at the bottom-right corner of the screen initially.
3. Support dark theme.

Bug: 173958541
Test: atest AccessibilityFloatingMenuTest AccessibilityFloatingMenuViewTest
Change-Id: I28e729520d4eb8ecb0bcc41d4de9d1499380e7f5
parent 2b416cd6
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2021 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 android:id="@+id/menu_background_item">
        <shape android:shape="rectangle">
            <corners
                android:bottomLeftRadius="@dimen/accessibility_floating_menu_single_radius"
                android:bottomRightRadius="0dp"
                android:topLeftRadius="@dimen/accessibility_floating_menu_single_radius"
                android:topRightRadius="0dp"/>
            <solid
                android:color="@color/accessibility_floating_menu_background"/>
        </shape>
    </item>
</layer-list>
 No newline at end of file
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2021 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.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="@dimen/accessibility_floating_menu_padding"
    android:orientation="vertical"
    android:gravity="center">

    <View
        android:id="@+id/icon_view"
        android:layout_width="@dimen/accessibility_floating_menu_width_height"
        android:layout_height="@dimen/accessibility_floating_menu_width_height"/>

    <View
        android:id="@+id/transparent_divider"
        android:layout_width="match_parent"
        android:layout_height="@dimen/accessibility_floating_menu_padding"/>

</LinearLayout>
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -102,4 +102,6 @@
    <color name="privacy_circle_camera">#81C995</color> <!-- g300 -->
    <color name="privacy_circle_microphone_location">#FCAD70</color> <!--o300 -->

    <!-- Accessibility floating menu -->
    <color name="accessibility_floating_menu_background">#B3000000</color> <!-- 70% -->
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -275,4 +275,8 @@
    <!-- TODO(b/178093014) Colors for privacy dialog. These should be changed to the new palette -->
    <color name="privacy_circle_camera">#1E8E3E</color> <!-- g600 -->
    <color name="privacy_circle_microphone_location">#E8710A</color> <!--o600 -->

    <!-- Accessibility floating menu -->
    <color name="accessibility_floating_menu_background">#CCFFFFFF</color> <!-- 80% -->
    <color name="accessibility_floating_menu_stroke_dark">#26FFFFFF</color> <!-- 15% -->
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -1352,6 +1352,16 @@
    <dimen name="people_space_image_radius">20dp</dimen>
    <dimen name="people_space_widget_background_padding">6dp</dimen>

    <!-- Accessibility floating menu -->
    <dimen name="accessibility_floating_menu_elevation">5dp</dimen>
    <dimen name="accessibility_floating_menu_stroke_width">1dp</dimen>
    <dimen name="accessibility_floating_menu_stroke_inset">-2dp</dimen>
    <dimen name="accessibility_floating_menu_margin">16dp</dimen>
    <dimen name="accessibility_floating_menu_padding">6dp</dimen>
    <dimen name="accessibility_floating_menu_width_height">36dp</dimen>
    <dimen name="accessibility_floating_menu_single_radius">25dp</dimen>
    <dimen name="accessibility_floating_menu_multiple_radius">20dp</dimen>

    <dimen name="rounded_slider_height">48dp</dimen>
    <!-- rounded_slider_height / 2 -->
    <dimen name="rounded_slider_corner_radius">24dp</dimen>
Loading