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

Commit c4134188 authored by Jason Hsu's avatar Jason Hsu Committed by Automerger Merge Worker
Browse files

Merge "Add accessibility shortcut icon into adaptive icon" into sc-dev am: b9e50941

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14278147

Change-Id: I1e97c4a362186f462284d1996a1c36c9cb8436b5
parents 6145fb55 b9e50941
Loading
Loading
Loading
Loading
+22 −23
Original line number Original line Diff line number Diff line
@@ -230,7 +230,6 @@ public final class AccessibilityTargetHelper {
                        context.getDrawable(R.drawable.ic_accessibility_color_inversion),
                        context.getDrawable(R.drawable.ic_accessibility_color_inversion),
                        Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
                        Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);


        // TODO: Update with shortcut icon
        final ToggleAllowListingFeatureTarget reduceBrightColors =
        final ToggleAllowListingFeatureTarget reduceBrightColors =
                new ToggleAllowListingFeatureTarget(context,
                new ToggleAllowListingFeatureTarget(context,
                        shortcutType,
                        shortcutType,
@@ -238,7 +237,7 @@ public final class AccessibilityTargetHelper {
                                REDUCE_BRIGHT_COLORS_COMPONENT_NAME.flattenToString()),
                                REDUCE_BRIGHT_COLORS_COMPONENT_NAME.flattenToString()),
                        REDUCE_BRIGHT_COLORS_COMPONENT_NAME.flattenToString(),
                        REDUCE_BRIGHT_COLORS_COMPONENT_NAME.flattenToString(),
                        context.getString(R.string.reduce_bright_colors_feature_name),
                        context.getString(R.string.reduce_bright_colors_feature_name),
                        null,
                        context.getDrawable(R.drawable.ic_accessibility_reduce_bright_colors),
                        Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED);
                        Settings.Secure.REDUCE_BRIGHT_COLORS_ACTIVATED);


        targets.add(magnification);
        targets.add(magnification);
+10 −38
Original line number Original line Diff line number Diff line
<!--
<!--
    Copyright (C) 2020 The Android Open Source Project
    Copyright (C) 2021 The Android Open Source Project


    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -13,40 +13,12 @@
    See the License for the specific language governing permissions and
    See the License for the specific language governing permissions and
    limitations under the License.
    limitations under the License.
-->
-->
<vector android:height="24dp" android:viewportHeight="192"

    android:viewportWidth="192" android:width="24dp"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/accessibility_daltonizer_background" />
    <path android:fillColor="#00BCD4" android:pathData="M37.14,173.74L8.61,83.77c-1.72,-5.75 0.26,-11.97 4.97,-15.63L87.15,11c5.2,-4.04 12.46,-3.99 17.61,0.12l73.81,58.94c4.63,3.7 6.53,9.88 4.8,15.57l-28.48,88.18c-1.85,6.06 -7.39,10.19 -13.67,10.19H50.84C44.53,184 38.97,179.83 37.14,173.74z"/>
    <foreground>
    <path android:fillAlpha="0.2" android:fillColor="#FFFFFF"
        <inset
        android:pathData="M13.58,69.14L87.15,12c5.2,-4.04 12.46,-3.99 17.61,0.12l73.81,58.94c3.36,2.68 5.27,6.67 5.41,10.82c0.15,-4.51 -1.79,-8.93 -5.41,-11.82l-73.81,-58.94C99.61,7.01 92.35,6.96 87.15,11L13.58,68.14c-3.71,2.88 -5.72,7.36 -5.56,11.94C8.17,75.85 10.14,71.81 13.58,69.14z" android:strokeAlpha="0.2"/>
            android:drawable="@drawable/ic_accessibility_color_correction_foreground"
    <path android:fillAlpha="0.2" android:fillColor="#263238"
            android:inset="@dimen/accessibility_icon_foreground_padding_ratio" />
        android:pathData="M183.35,84.63l-28.48,88.18c-1.85,6.06 -7.39,10.19 -13.67,10.19H50.84c-6.31,0 -11.87,-4.17 -13.7,-10.26L8.61,82.77c-0.36,-1.22 -0.55,-2.46 -0.59,-3.69c-0.06,1.56 0.13,3.14 0.59,4.69l28.53,89.97c1.83,6.09 7.39,10.26 13.7,10.26h90.37c6.28,0 11.82,-4.13 13.67,-10.19l28.48,-88.18c0.48,-1.57 0.67,-3.17 0.61,-4.75C183.92,82.13 183.73,83.39 183.35,84.63z" android:strokeAlpha="0.2"/>
    </foreground>
    <path android:pathData="M60.01,135L60.01,135H60l48.04,49h33.17c6.28,0 11.82,-4.13 13.67,-10.19l18.68,-57.84L129.51,72.2l-0.01,0c0.27,0.27 0.52,0.5 0.77,0.77l0.55,0.55c1.57,1.56 1.57,4.08 -0.04,5.68l-12.56,12.49l6.36,6.3l1.38,1.37l-5.67,5.64l-5.71,-5.68L79.15,135H60.42H60.01z">
</adaptive-icon>
        <aapt:attr name="android:fillColor">
            <gradient android:endX="155.9627" android:endY="165.1493"
                android:startX="98.4649" android:startY="107.6516" android:type="linear">
                <item android:color="#19263238" android:offset="0"/>
                <item android:color="#00212121" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillColor="#0097A7" android:pathData="M68.55,120.35l32.173,-32.173l7.658,7.658l-32.173,32.173z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M130.83,73.52l-9.42,-9.36c-1.57,-1.56 -4.1,-1.56 -5.67,0l-12.56,12.48L95.42,69l-5.67,5.64l5.71,5.68L60,116.97V135h19.15l35.42,-35.68l5.71,5.68l5.67,-5.64l-7.73,-7.68l12.56,-12.48C132.4,77.6 132.4,75.08 130.83,73.52zM74.98,126.77l-6.43,-6.43l32.17,-32.17l6.43,6.43L74.98,126.77z"/>
    <path android:fillAlpha="0.1" android:fillColor="#263238"
        android:pathData="M120.28,105l-5.71,-5.68l-35.42,35.68l-19.15,0l1,1l19.15,0l35.42,-35.68l5.71,5.68l5.68,-5.64l-1,-1z" android:strokeAlpha="0.1"/>
    <path android:fillAlpha="0.1" android:fillColor="#263238"
        android:pathData="M90.75,75.64l-0.01,0l4.71,4.68l0.01,0z" android:strokeAlpha="0.1"/>
    <path android:fillAlpha="0.1" android:fillColor="#263238"
        android:pathData="M131.83,74.52l-0.97,-0.97c1.54,1.56 1.53,4.06 -0.07,5.65l-12.56,12.48l1,1l12.55,-12.48C133.4,78.6 133.4,76.08 131.83,74.52z" android:strokeAlpha="0.1"/>
    <path android:fillAlpha="0.1" android:fillColor="#263238"
        android:pathData="M101.72,89.17l6.67,6.66l0,0l-7.67,-7.66l-32.17,32.17l1,1z" android:strokeAlpha="0.1"/>
    <path android:pathData="M37.13,173.7L8.62,83.69c-1.7,-5.8 0.3,-12 5,-15.6l73.52,-57.1c5.2,-4 12.5,-4 17.6,0.1l73.82,58.9c4.6,3.7 6.5,9.9 4.8,15.6l-28.51,88.21c-1.8,6.1 -7.4,10.2 -13.7,10.2H50.83C44.53,184 38.93,179.8 37.13,173.7z">
        <aapt:attr name="android:fillColor">
            <gradient android:centerX="21.977" android:centerY="23.8809"
                android:gradientRadius="158.0384" android:type="radial">
                <item android:color="#19FFFFFF" android:offset="0"/>
                <item android:color="#00FFFFFF" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
</vector>
+26 −0
Original line number Original line Diff line number Diff line
<!--
    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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="#ffffff"
        android:fillType="evenOdd"
        android:pathData="M14.8417,6.6662C14.9562,6.5573 15.0995,6.5 15.2484,6.5C15.3917,6.5 15.5349,6.5573 15.6495,6.6662L16.9901,8.0068C17.2135,8.2302 17.2135,8.5912 16.9844,8.8203L15.1969,10.6078L16.2969,11.7078L15.4891,12.5156L14.6755,11.7021L9.5651,16.8125H6.8438V14.0911L11.9542,8.9807L11.1406,8.1672L11.9484,7.3594L13.0542,8.4537L14.8417,6.6662ZM7.9896,15.6667H9.0896L13.7073,11.049L12.6073,9.949L7.9896,14.5667V15.6667Z" />
</vector>
 No newline at end of file
+10 −48
Original line number Original line Diff line number Diff line
<!--
<!--
    Copyright (C) 2020 The Android Open Source Project
    Copyright (C) 2021 The Android Open Source Project


    Licensed under the Apache License, Version 2.0 (the "License");
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    you may not use this file except in compliance with the License.
@@ -13,50 +13,12 @@
    See the License for the specific language governing permissions and
    See the License for the specific language governing permissions and
    limitations under the License.
    limitations under the License.
-->
-->
<vector android:height="24dp" android:viewportHeight="192"

    android:viewportWidth="192" android:width="24dp"
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@color/accessibility_color_inversion_background" />
    <path android:fillColor="#546E7A" android:pathData="M37.14,173.74L8.61,83.77c-1.72,-5.75 0.26,-11.97 4.97,-15.63L87.15,11c5.2,-4.04 12.46,-3.99 17.61,0.12l73.81,58.94c4.63,3.7 6.53,9.88 4.8,15.57l-28.48,88.18c-1.85,6.06 -7.39,10.19 -13.67,10.19H50.84C44.53,184 38.97,179.83 37.14,173.74z"/>
    <foreground>
    <path android:fillAlpha="0.2" android:fillColor="#263238"
        <inset
        android:pathData="M183.37,84.63l-28.48,88.18c-1.85,6.06 -7.39,10.19 -13.67,10.19H50.84c-6.31,0 -11.87,-4.17 -13.7,-10.26L8.61,82.77c-0.36,-1.22 -0.55,-2.46 -0.59,-3.69c-0.06,1.56 0.13,3.14 0.59,4.69l28.53,89.97c1.83,6.09 7.39,10.26 13.7,10.26h90.38c6.28,0 11.82,-4.13 13.67,-10.19l28.48,-88.18c0.48,-1.57 0.67,-3.17 0.61,-4.75C183.94,82.13 183.74,83.39 183.37,84.63z" android:strokeAlpha="0.2"/>
            android:drawable="@drawable/ic_accessibility_color_inversion_foreground"
    <path android:fillAlpha="0.2" android:fillColor="#FFFFFF"
            android:inset="@dimen/accessibility_icon_foreground_padding_ratio" />
        android:pathData="M13.58,69.14L87.15,12c5.2,-4.04 12.46,-3.99 17.61,0.12l73.81,58.94c3.36,2.68 5.27,6.67 5.41,10.82c0.15,-4.51 -1.79,-8.93 -5.41,-11.82l-73.81,-58.94C99.61,7.01 92.35,6.96 87.15,11L13.58,68.14c-3.71,2.88 -5.72,7.36 -5.56,11.94C8.17,75.85 10.14,71.81 13.58,69.14z" android:strokeAlpha="0.2"/>
    </foreground>
    <path android:fillAlpha="0.2" android:fillColor="#FFFFFF"
</adaptive-icon>
        android:pathData="M53,130.05l5.03,-4.79L44.16,112c-0.05,0.78 -0.14,1.52 -0.15,2.34C43.62,136.61 61.27,154.56 84,156v-5.31C70.13,149.64 58.56,141.54 53,130.05z" android:strokeAlpha="0.2"/>
    <path android:fillAlpha="0.2" android:fillColor="#FFFFFF"
        android:pathData="M109,52v5.31c13.65,1.05 24.67,9.15 30.11,20.64l-4.92,4.79L147.81,96c0.09,-0.78 0.17,-1.53 0.19,-2.34C148.38,71.39 131.36,53.44 109,52z" android:strokeAlpha="0.2"/>
    <path android:pathData="M154.89,173.81l13.57,-42.02l-46.53,-46.56C125.75,90.5 128,96.98 128,104c0,17.7 -14.3,32 -32,32c-8.64,0 -16.47,-3.42 -22.22,-8.97l0.9,0.91L130.73,184h10.49C147.5,184 153.04,179.87 154.89,173.81z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="153.3523" android:endY="161.6371"
                android:startX="90.6075" android:startY="98.8923" android:type="linear">
                <item android:color="#33263238" android:offset="0"/>
                <item android:color="#05263238" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:pathData="M96,129.6V78.4c-14.11,0 -25.6,11.49 -25.6,25.6S81.89,129.6 96,129.6z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="150.8492" android:endY="164.1401"
                android:startX="88.1044" android:startY="101.3954" android:type="linear">
                <item android:color="#33263238" android:offset="0"/>
                <item android:color="#05263238" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillAlpha="0.2" android:fillColor="#263238"
        android:pathData="M96,136c-17.53,0 -31.72,-14.04 -31.99,-31.5c0,0.17 -0.01,0.33 -0.01,0.5c0,17.7 14.3,32 32,32s32,-14.3 32,-32c0,-0.17 -0.01,-0.33 -0.01,-0.5C127.72,121.96 113.53,136 96,136z" android:strokeAlpha="0.2"/>
    <path android:fillAlpha="0.2" android:fillColor="#263238"
        android:pathData="M70.4,104c0,0.17 0.01,0.33 0.01,0.5C70.68,90.62 82.06,79.4 96,79.4v-1C81.89,78.4 70.4,89.88 70.4,104z" android:strokeAlpha="0.2"/>
    <path android:fillAlpha="0.2" android:fillColor="#FFFFFF"
        android:pathData="M96,72c-17.7,0 -32,14.3 -32,32s14.3,32 32,32s32,-14.3 32,-32S113.7,72 96,72zM70.4,104c0,-14.11 11.49,-25.6 25.6,-25.6v51.2C81.89,129.6 70.4,118.11 70.4,104z" android:strokeAlpha="0.2"/>
    <path android:fillColor="#FFFFFF" android:pathData="M96,72c-17.7,0 -32,14.3 -32,32s14.3,32 32,32s32,-14.3 32,-32S113.7,72 96,72zM70.4,104c0,-14.11 11.49,-25.6 25.6,-25.6v51.2C81.89,129.6 70.4,118.11 70.4,104z"/>
    <path android:pathData="M37.14,173.74L8.61,83.77c-1.72,-5.75 0.26,-11.97 4.97,-15.63L87.15,11c5.2,-4.04 12.46,-3.99 17.61,0.12l73.81,58.94c4.63,3.7 6.53,9.88 4.8,15.57l-28.48,88.18c-1.85,6.06 -7.39,10.19 -13.67,10.19H50.84C44.53,184 38.97,179.83 37.14,173.74z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="156.2451" android:endY="171.4516"
                android:startX="37.0633" android:startY="52.269802" android:type="linear">
                <item android:color="#19FFFFFF" android:offset="0"/>
                <item android:color="#00FFFFFF" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
</vector>
+54 −0
Original line number Original line Diff line number Diff line
<!--
    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.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="108dp"
    android:height="108dp"
    android:viewportWidth="192"
    android:viewportHeight="192">
    <path
        android:fillAlpha="0.2"
        android:fillColor="#212121"
        android:pathData="M96,183L96,183c-48.23,0 -87.72,-39.33 -87.99,-87.5C8.01,95.67 8,95.83 8,96v0c0,48.4 39.6,88 88,88h0c48.4,0 88,-39.6 88,-88v0c0,-0.17 -0.01,-0.33 -0.01,-0.5C183.72,143.67 144.23,183 96,183z" />
    <path
        android:fillAlpha="0.2"
        android:fillColor="#FFFFFF"
        android:pathData="M184,96c0,-48.4 -39.6,-88 -88,-88h0C47.6,8 8,47.6 8,96v0c0,0.17 0.01,0.33 0.01,0.5C8.28,48.33 47.77,9 96,9h0c48.23,0 87.72,39.33 87.99,87.5C183.99,96.33 184,96.17 184,96L184,96z"
        android:strokeAlpha="0.2" />
    <path
        android:fillAlpha="0.2"
        android:fillColor="#FFFFFF"
        android:pathData="M53,122.2l5.03,-4.79l-13.88,-13.26c-0.05,0.78 -0.14,1.52 -0.15,2.34c-0.39,22.27 17.27,40.22 39.99,41.66v-5.31C70.13,141.78 58.56,133.69 53,122.2z"
        android:strokeAlpha="0.2" />
    <path
        android:fillAlpha="0.2"
        android:fillColor="#FFFFFF"
        android:pathData="M109,44.15v5.31c13.65,1.05 24.67,9.15 30.11,20.64l-4.92,4.79l13.62,13.26c0.09,-0.78 0.17,-1.53 0.19,-2.34C148.38,63.53 131.36,45.59 109,44.15z"
        android:strokeAlpha="0.2" />
    <path
        android:fillAlpha="0.2"
        android:fillColor="#263238"
        android:pathData="M70.4,96.18c0,0.17 0.01,0.33 0.01,0.5c0.27,-13.88 11.64,-25.1 25.59,-25.1v-1C81.89,70.57 70.4,82.06 70.4,96.18z"
        android:strokeAlpha="0.2" />
    <path
        android:fillAlpha="0.2"
        android:fillColor="#263238"
        android:pathData="M128,96.67c-0.27,17.47 -14.46,31.5 -31.99,31.5c-8.79,0 -16.75,-3.53 -22.53,-9.26l-0.04,0l5.03,5.04c5.03,3.3 11.05,5.22 17.53,5.22c17.7,0 32,-14.31 32,-32C128.01,97.01 128,96.84 128,96.67z"
        android:strokeAlpha="0.2" />
    <path
        android:fillColor="#FFFFFF"
        android:pathData="M96,64.16c-17.7,0 -32,14.3 -32,32c0,17.7 14.3,32 32,32c17.7,0 32,-14.3 32,-32C128,78.47 113.7,64.16 96,64.16zM70.4,96.16c0,-14.11 11.49,-25.6 25.6,-25.6v51.2C81.89,121.77 70.4,110.28 70.4,96.16z" />
</vector>
 No newline at end of file
Loading