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

Commit eeda8be8 authored by Aaron Heuckroth's avatar Aaron Heuckroth
Browse files

Fix TalkBack accessibility for grid-based power menu.

Test: Automated tests pass. TalkBack direction and ordering correct for LTR languages, direction ordering correct for RTL languages.
Change-Id: Id7206a9e93976ae74a6d515a84e6840aaa730995
parent a390bd49
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -10,14 +10,12 @@
    android:gravity="top|right"
    android:clipChildren="false"
>

    <LinearLayout
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:gravity="top|right"
        android:padding="0dp"
        android:orientation="vertical"
        android:layoutDirection="ltr"
        android:layout_marginRight="@dimen/global_actions_grid_container_bottom_margin"
    >
        <!-- Grid of action items -->
@@ -26,7 +24,6 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layoutDirection="ltr"
            android:layout_marginTop="@dimen/global_actions_grid_side_margin"
            android:translationZ="@dimen/global_actions_translate"
            android:paddingLeft="@dimen/global_actions_grid_horizontal_padding"
@@ -39,25 +36,21 @@
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="ltr"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="ltr"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="ltr"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
        </com.android.systemui.globalactions.ListGridLayout>

        <!-- For separated items-->
        <LinearLayout
            android:id="@+id/separated_button"
+4 −11
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
    android:gravity="top|left"
    android:clipChildren="false"
>

    <LinearLayout
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
@@ -37,11 +36,11 @@
            android:gravity="center"
            android:translationZ="@dimen/global_actions_translate"
        />

        <!-- Grid of action items -->
        <com.android.systemui.globalactions.ListGridLayout
            android:id="@android:id/list"
            android:layout_gravity="bottom|left"
            android:gravity="right"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
@@ -54,28 +53,22 @@
            android:background="?android:attr/colorBackgroundFloating"
        >
            <LinearLayout
                android:layout_gravity="bottom"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="rtl"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_gravity="bottom"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="rtl"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_gravity="bottom"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:layoutDirection="rtl"
                android:orientation="horizontal"
                android:layoutDirection="locale"
            />
        </com.android.systemui.globalactions.ListGridLayout>
    </LinearLayout>
+5 −7
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@
    android:gravity="bottom|center"
    android:clipChildren="false"
>

    <LinearLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
@@ -35,14 +34,13 @@
            android:gravity="center"
            android:translationZ="@dimen/global_actions_translate"
        />

        <!-- Grid of action items -->
        <com.android.systemui.globalactions.ListGridLayout
            android:id="@android:id/list"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layoutDirection="rtl"
            android:orientation="vertical"
            android:gravity="right"
            android:layout_marginRight="@dimen/global_actions_grid_side_margin"
            android:translationZ="@dimen/global_actions_translate"
            android:paddingLeft="@dimen/global_actions_grid_horizontal_padding"
@@ -55,19 +53,19 @@
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:orientation="vertical"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:orientation="vertical"
                android:layoutDirection="locale"
            />
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:visibility="gone"
                android:orientation="vertical"
                android:layoutDirection="locale"
            />
        </com.android.systemui.globalactions.ListGridLayout>
    </LinearLayout>
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public class HardwareUiLayout extends MultiListLayout implements Tunable {
    }

    @Override
    public ViewGroup getParentView(boolean separated, int index, boolean reverse) {
    public ViewGroup getParentView(boolean separated, int index, int rotation) {
        if (separated) {
            return getSeparatedView();
        } else {
+3 −3
Original line number Diff line number Diff line
@@ -57,12 +57,12 @@ public abstract class MultiListLayout extends LinearLayout {
     * @param separated Whether or not this index refers to a position in the separated or list
     *                  container.
     * @param index The index of the item within the container.
     * @param reverse If the MultiListLayout contains sub-lists within the list container, reverse
     *                the order that they are filled.
     * @param rotation Specifies the rotation of the device, which is used in some cases to
     *                 determine child ordering.
     * @return The parent ViewGroup which will be used to contain the specified item
     * after it has been added to the layout.
     */
    public abstract ViewGroup getParentView(boolean separated, int index, boolean reverse);
    public abstract ViewGroup getParentView(boolean separated, int index, int rotation);

    /**
     * Sets the divided view, which may have a differently-colored background.
Loading