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

Commit 18ca825d authored by Pat Manning's avatar Pat Manning Committed by Android (Google) Code Review
Browse files

Merge "Update pointer fill option backgrounds for color contrast and touch target size." into main

parents 821bbb41 b50acbfe
Loading
Loading
Loading
Loading
+214 −12
Original line number Diff line number Diff line
@@ -14,15 +14,217 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetBottom="@dimen/pointer_fill_style_circle_offset"
    android:insetLeft="@dimen/pointer_fill_style_circle_offset"
    android:insetRight="@dimen/pointer_fill_style_circle_offset"
    android:insetTop="@dimen/pointer_fill_style_circle_offset">
<selector xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" >
    <item
        android:state_hovered="true"
        android:state_selected="true">
        <layer-list>
            <item
                android:top="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:left="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:bottom="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:right="@dimen/pointer_fill_style_circle_background_outline_offset">
                <shape android:shape="rectangle">
                    <corners
                        android:radius="@dimen/pointer_fill_style_circle_background_corner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter_less_stroke"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter_less_stroke" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_background_selected_outline_stroke"
                        android:color="@androidprv:color/materialColorSecondary" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_background_offset"
                android:left="@dimen/pointer_fill_style_circle_background_offset"
                android:bottom="@dimen/pointer_fill_style_circle_background_offset"
                android:right="@dimen/pointer_fill_style_circle_background_offset">
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/pointer_fill_style_circle_background_corner_inner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter_selected"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter_selected" />
                    <solid
                        android:color="@color/pointer_fill_hovered_color" />
                </shape>
            </item>
            <item
                android:id="@+id/tintableCircleHoveredSelected"
                android:top="@dimen/pointer_fill_style_circle_offset_selected"
                android:left="@dimen/pointer_fill_style_circle_offset_selected"
                android:bottom="@dimen/pointer_fill_style_circle_offset_selected"
                android:right="@dimen/pointer_fill_style_circle_offset_selected">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_diameter"
                        android:height="@dimen/pointer_fill_style_circle_diameter" />
                    <solid android:color="@android:color/white" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:left="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:bottom="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:right="@dimen/pointer_fill_style_circle_outline_offset_selected">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_outline_diameter"
                        android:height="@dimen/pointer_fill_style_circle_outline_diameter" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_outline_stroke"
                        android:color="@android:color/white" />
                </shape>
            </item>
            <item android:gravity="center"
                android:width="@dimen/pointer_fill_style_checkmark_size"
                android:height="@dimen/pointer_fill_style_checkmark_size"
                android:drawable="@drawable/pointer_fill_check_24dp" />
        </layer-list>
    </item>
    <item android:state_selected="true">
        <layer-list>
            <item
                android:top="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:left="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:bottom="@dimen/pointer_fill_style_circle_background_outline_offset"
                android:right="@dimen/pointer_fill_style_circle_background_outline_offset">
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/pointer_fill_style_circle_background_corner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter_less_stroke"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter_less_stroke" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_background_selected_outline_stroke"
                        android:color="@androidprv:color/materialColorSecondary" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_background_offset"
                android:left="@dimen/pointer_fill_style_circle_background_offset"
                android:bottom="@dimen/pointer_fill_style_circle_background_offset"
                android:right="@dimen/pointer_fill_style_circle_background_offset">
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/pointer_fill_style_circle_background_corner_inner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter_selected"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter_selected" />
                    <solid android:color="@androidprv:color/materialColorSurfaceBright" />
                </shape>
            </item>
            <item
                android:id="@+id/tintableCircleSelected"
                android:top="@dimen/pointer_fill_style_circle_offset_selected"
                android:left="@dimen/pointer_fill_style_circle_offset_selected"
                android:bottom="@dimen/pointer_fill_style_circle_offset_selected"
                android:right="@dimen/pointer_fill_style_circle_offset_selected">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_diameter"
                        android:height="@dimen/pointer_fill_style_circle_diameter" />
                    <solid android:color="@android:color/white" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:left="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:bottom="@dimen/pointer_fill_style_circle_outline_offset_selected"
                android:right="@dimen/pointer_fill_style_circle_outline_offset_selected">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_outline_diameter"
                        android:height="@dimen/pointer_fill_style_circle_outline_diameter" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_outline_stroke"
                        android:color="@android:color/white" />
                </shape>
            </item>
            <item
                android:gravity="center"
                android:width="@dimen/pointer_fill_style_checkmark_size"
                android:height="@dimen/pointer_fill_style_checkmark_size"
                android:drawable="@drawable/pointer_fill_check_24dp" />
        </layer-list>
    </item>
    <item android:state_hovered="true">
        <layer-list>
            <item>
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/pointer_fill_style_circle_background_corner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter" />
                    <solid android:color="@color/pointer_fill_hovered_color" />
                </shape>
            </item>
            <item
                android:id="@+id/tintableCircleHovered"
                android:top="@dimen/pointer_fill_style_circle_offset"
                android:left="@dimen/pointer_fill_style_circle_offset"
                android:bottom="@dimen/pointer_fill_style_circle_offset"
                android:right="@dimen/pointer_fill_style_circle_offset">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_diameter"
                        android:height="@dimen/pointer_fill_style_circle_diameter" />
                    <solid android:color="@android:color/white" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_outline_offset"
                android:left="@dimen/pointer_fill_style_circle_outline_offset"
                android:bottom="@dimen/pointer_fill_style_circle_outline_offset"
                android:right="@dimen/pointer_fill_style_circle_outline_offset">
                <shape android:shape="oval">
                    <size
            android:width="@dimen/pointer_fill_style_circle_inner_diameter"
            android:height="@dimen/pointer_fill_style_circle_inner_diameter" />
                        android:width="@dimen/pointer_fill_style_circle_outline_diameter"
                        android:height="@dimen/pointer_fill_style_circle_outline_diameter" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_outline_stroke"
                        android:color="@android:color/white" />
                </shape>
            </item>
        </layer-list>
    </item>
    <item><!-- default state -->
        <layer-list>
            <item>
                <shape android:shape="rectangle">
                    <corners android:radius="@dimen/pointer_fill_style_circle_background_corner_radius" />
                    <size
                        android:width="@dimen/pointer_fill_style_circle_background_outer_diameter"
                        android:height="@dimen/pointer_fill_style_circle_background_outer_diameter" />
                    <solid android:color="@androidprv:color/materialColorSurfaceBright" />
                </shape>
            </item>
            <item
                android:id="@+id/tintableCircleDefault"
                android:top="@dimen/pointer_fill_style_circle_offset"
                android:left="@dimen/pointer_fill_style_circle_offset"
                android:bottom="@dimen/pointer_fill_style_circle_offset"
                android:right="@dimen/pointer_fill_style_circle_offset">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_diameter"
                        android:height="@dimen/pointer_fill_style_circle_diameter" />
                    <solid android:color="@android:color/white" />
                </shape>
</inset>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_circle_outline_offset"
                android:left="@dimen/pointer_fill_style_circle_outline_offset"
                android:bottom="@dimen/pointer_fill_style_circle_outline_offset"
                android:right="@dimen/pointer_fill_style_circle_outline_offset">
                <shape android:shape="oval">
                    <size
                        android:width="@dimen/pointer_fill_style_circle_outline_diameter"
                        android:height="@dimen/pointer_fill_style_circle_outline_diameter" />
                    <stroke
                        android:width="@dimen/pointer_fill_style_circle_outline_stroke"
                        android:color="@android:color/white" />
                </shape>
            </item>
        </layer-list>
    </item>
</selector>
+0 −67
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright 2024 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:state_selected="true" android:state_hovered="true">
        <layer-list>
            <item>
                <shape android:shape="oval">
                    <size android:width="@dimen/pointer_fill_style_circle_hover_selected_diameter"
                        android:height="@dimen/pointer_fill_style_circle_hover_selected_diameter" />
                    <stroke android:width="@dimen/pointer_fill_style_shape_hovered_stroke"
                        android:color="@color/pointer_fill_outline_color" />
                </shape>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_checkmark_hovered_padding"
                android:left="@dimen/pointer_fill_style_checkmark_hovered_padding"
                android:bottom="@dimen/pointer_fill_style_checkmark_hovered_padding"
                android:right="@dimen/pointer_fill_style_checkmark_hovered_padding"
                android:drawable="@drawable/pointer_fill_check_24dp" />
        </layer-list>
    </item>
    <item android:state_selected="true">
        <layer-list>
            <item>
                <inset android:insetTop="@dimen/pointer_fill_style_circle_selected_offset"
                    android:insetLeft="@dimen/pointer_fill_style_circle_selected_offset"
                    android:insetBottom="@dimen/pointer_fill_style_circle_selected_offset"
                    android:insetRight="@dimen/pointer_fill_style_circle_selected_offset">
                    <shape android:shape="oval">
                        <size android:width="@dimen/pointer_fill_style_circle_selected_diameter"
                            android:height="@dimen/pointer_fill_style_circle_selected_diameter" />
                        <stroke android:width="@dimen/pointer_fill_style_shape_selected_stroke"
                            android:color="@color/pointer_fill_outline_color" />
                    </shape>
                </inset>
            </item>
            <item
                android:top="@dimen/pointer_fill_style_checkmark_selected_padding"
                android:left="@dimen/pointer_fill_style_checkmark_selected_padding"
                android:bottom="@dimen/pointer_fill_style_checkmark_selected_padding"
                android:right="@dimen/pointer_fill_style_checkmark_selected_padding"
                android:drawable="@drawable/pointer_fill_check_24dp" />
        </layer-list>
    </item>
    <item android:state_hovered="true">
        <shape android:shape="oval">
            <size android:width="@dimen/pointer_fill_style_circle_hover_diameter"
                android:height="@dimen/pointer_fill_style_circle_hover_diameter" />
            <stroke android:width="@dimen/pointer_fill_style_shape_hovered_stroke"
                android:color="@color/pointer_fill_outline_color" />
        </shape>
    </item>
</selector>
+31 −38
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
        android:layout_height="@dimen/pointer_fill_container_height"
        android:layout_marginBottom="@dimen/pointer_fill_style_circle_padding"
        android:layout_marginTop="@dimen/pointer_fill_style_circle_padding"
        android:background="@drawable/pointer_icon_fill_container_background"
        android:gravity="center"
        android:paddingTop="@dimen/pointer_fill_style_container_padding"
        android:paddingBottom="@dimen/pointer_fill_style_container_padding">
@@ -53,19 +52,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="4" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_black"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_black_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -73,19 +71,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="3" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_green"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_green_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -93,19 +90,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="3" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_red"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_red_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -113,19 +109,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="3" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_pink"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_pink_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -133,19 +128,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="3" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_blue"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_blue_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -153,19 +147,18 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="3" />
            android:layout_weight="1" />

        <ImageView
            android:id="@+id/button_purple"
            android:layout_width="@dimen/pointer_fill_style_circle_diameter"
            android:layout_width="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:layout_weight="0"
            android:layout_height="@dimen/pointer_fill_style_circle_diameter"
            android:layout_height="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:adjustViewBounds="true"
            android:maxWidth="@dimen/pointer_fill_style_circle_diameter"
            android:maxWidth="@dimen/pointer_fill_style_circle_background_outer_diameter"
            android:contentDescription="@string/pointer_fill_style_purple_button"
            android:scaleType="center"
            android:background="@drawable/pointer_icon_fill_color_background"
            android:src="@drawable/pointer_icon_fill_color_foreground" />
            android:src="@drawable/pointer_icon_fill_color_background" />

        <View
            android:layout_width="0dp"
@@ -173,7 +166,7 @@
            android:focusable="false"
            android:clickable="false"
            android:importantForAccessibility="no"
            android:layout_weight="4" />
            android:layout_weight="1" />
    </LinearLayout>

</LinearLayout>
+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

Loading