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

Commit 56e536f4 authored by Lorenzo Lucena Maguire's avatar Lorenzo Lucena Maguire Committed by Android (Google) Code Review
Browse files

Merge changes from topic "DoubleTapPowerButtonGestureSystemSettings" into main

* changes:
  Create Double Tap Power Illustrations based on target action
  Support wallet launch in Double Tap Power Gesture Settings
  Rename Double Tap Power To Open Camera Gesture Xml
  Refactor DoubleTapPowerPreferenceController
  Create Double Tap Power For Wallet Launch Preference Controller
  Create Double Tap Power Gesture For Camera Preference Controller
  Create Double Tap Power Gesture Main Switch Preference Controller
  Create DoubleTapPowerSettingsUtils
parents 8043fba4 18d0d263
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
    Copyright (C) 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
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="412dp"
    android:height="300dp"
    android:viewportHeight="300"
    android:viewportWidth="412">
    <path
        android:fillColor="#000000"
        android:pathData="M384.2 300H27.8C12.5 300 0 287.2 0 271.5V28.5C0 12.8 12.5 0 27.8 0H384.3C399.5 0 412 12.8 412 28.5V271.7C412 287.2 399.5 300 384.2 300Z" />
    <path
        android:fillColor="#D2E3FC"
        android:pathData="M272.5 77.2V82.9C277.9 82.9 282.3 87.3 282.3 92.7C282.3 98.1 277.9 102.5 272.5 102.5V108.2C281.1 108.2 288 101.2 288 92.7C288 84.2 281 77.2 272.5 77.2Z" />
    <path
        android:fillColor="#669DF6"
        android:pathData="M282.3 92.7C282.3 87.3 277.9 82.9 272.5 82.9V102.6C277.9 102.6 282.3 98.2 282.3 92.7Z" />
    <path
        android:fillColor="#80868B"
        android:pathData="M274.9 97.7V88.2C274.9 86.9 273.8 85.8 272.5 85.8V35.9C272.5 29.3 267.2 24 260.6 24H151.3C144.7 24 139.4 29.3 139.4 35.9V264.1C139.4 270.7 144.7 276 151.3 276H260.7C267.3 276 272.6 270.7 272.6 264.1V147.6C273.9 147.6 275 146.5 275 145.2V121.4C275 120.1 273.9 119 272.6 119V100C273.9 100.1 274.9 99 274.9 97.7ZM270.2 264.1C270.2 269.3 265.9 273.6 260.7 273.6H151.3C146.1 273.6 141.8 269.3 141.8 264.1V35.9C141.8 30.7 146.1 26.4 151.3 26.4H260.7C265.9 26.4 270.2 30.7 270.2 35.9V264.1Z" />
    <path
        android:fillColor="#E8EAED"
        android:pathData="M270.2 264.1C270.2 269.3 265.9 273.6 260.7 273.6H151.3C146.1 273.6 141.8 269.3 141.8 264.1V35.9C141.8 30.7 146.1 26.4 151.3 26.4H260.7C265.9 26.4 270.2 30.7 270.2 35.9V264.1Z" />
    <path
        android:fillColor="#000000"
        android:pathData="M194.64 151.3C192.292 151.3 190.281 150.464 188.609 148.791C186.936 147.119 186.1 145.109 186.1 142.76V125.68C186.1 123.332 186.936 121.321 188.609 119.649C190.281 117.976 192.292 117.14 194.64 117.14H220.26C222.608 117.14 224.619 117.976 226.291 119.649C227.964 121.321 228.8 123.332 228.8 125.68V142.76C228.8 145.109 227.964 147.119 226.291 148.791C224.619 150.464 222.608 151.3 220.26 151.3H194.64ZM194.64 126.214H220.26C221.292 126.214 222.253 126.374 223.142 126.694C224.067 127.014 224.886 127.477 225.597 128.082V125.68C225.597 124.186 225.082 122.922 224.05 121.89C223.018 120.858 221.754 120.343 220.26 120.343H194.64C193.145 120.343 191.882 120.858 190.85 121.89C189.818 122.922 189.303 124.186 189.303 125.68V128.082C190.014 127.477 190.815 127.014 191.704 126.694C192.63 126.374 193.608 126.214 194.64 126.214ZM189.463 133.473L214.922 139.611C215.172 139.682 215.421 139.7 215.67 139.664C215.954 139.593 216.186 139.469 216.364 139.291L224.904 132.138C224.441 131.32 223.801 130.662 222.982 130.164C222.164 129.665 221.256 129.416 220.26 129.416H194.64C193.395 129.416 192.292 129.808 191.331 130.591C190.37 131.338 189.747 132.298 189.463 133.473Z" />
</vector>
 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) 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
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="412dp"
    android:height="300dp"
    android:viewportHeight="300"
    android:viewportWidth="412">
    <path
        android:fillColor="#FFFFFF"
        android:pathData="M384.2 300H27.8C12.5 300 0 287.2 0 271.5V28.5C0 12.8 12.5 0 27.8 0H384.3C399.5 0 412 12.8 412 28.5V271.7C412 287.2 399.5 300 384.2 300Z" />
    <path
        android:fillColor="#8AB4F8"
        android:pathData="M272.5 77.2V82.9C277.9 82.9 282.3 87.3 282.3 92.7C282.3 98.1 277.9 102.5 272.5 102.5V108.2C281.1 108.2 288 101.2 288 92.7C288 84.2 281 77.2 272.5 77.2Z" />
    <path
        android:fillColor="#669DF6"
        android:pathData="M282.3 92.7C282.3 87.3 277.9 82.9 272.5 82.9V102.6C277.9 102.6 282.3 98.2 282.3 92.7Z" />
    <path
        android:fillColor="#DADCE0"
        android:pathData="M274.9 97.7V88.2C274.9 86.9 273.8 85.8 272.5 85.8V35.9C272.5 29.3 267.2 24 260.6 24H151.3C144.7 24 139.4 29.3 139.4 35.9V264.1C139.4 270.7 144.7 276 151.3 276H260.7C267.3 276 272.6 270.7 272.6 264.1V147.6C273.9 147.6 275 146.5 275 145.2V121.4C275 120.1 273.9 119 272.6 119V100C273.9 100.1 274.9 99 274.9 97.7ZM270.2 264.1C270.2 269.3 265.9 273.6 260.7 273.6H151.3C146.1 273.6 141.8 269.3 141.8 264.1V35.9C141.8 30.7 146.1 26.4 151.3 26.4H260.7C265.9 26.4 270.2 30.7 270.2 35.9V264.1Z" />
    <path
        android:fillColor="#3C4043"
        android:pathData="M270.2 264.1C270.2 269.3 265.9 273.6 260.7 273.6H151.3C146.1 273.6 141.8 269.3 141.8 264.1V35.9C141.8 30.7 146.1 26.4 151.3 26.4H260.7C265.9 26.4 270.2 30.7 270.2 35.9V264.1Z" />
    <path
        android:fillColor="#FFFFFF"
        android:pathData="M194.64 151.3C192.292 151.3 190.281 150.464 188.609 148.791C186.936 147.119 186.1 145.109 186.1 142.76V125.68C186.1 123.332 186.936 121.321 188.609 119.649C190.281 117.976 192.292 117.14 194.64 117.14H220.26C222.608 117.14 224.619 117.976 226.291 119.649C227.964 121.321 228.8 123.332 228.8 125.68V142.76C228.8 145.109 227.964 147.119 226.291 148.791C224.619 150.464 222.608 151.3 220.26 151.3H194.64ZM194.64 126.214H220.26C221.292 126.214 222.253 126.374 223.142 126.694C224.067 127.014 224.886 127.477 225.597 128.082V125.68C225.597 124.186 225.082 122.922 224.05 121.89C223.018 120.858 221.754 120.343 220.26 120.343H194.64C193.145 120.343 191.882 120.858 190.85 121.89C189.818 122.922 189.303 124.186 189.303 125.68V128.082C190.014 127.477 190.815 127.014 191.704 126.694C192.63 126.374 193.608 126.214 194.64 126.214ZM189.463 133.473L214.922 139.611C215.172 139.682 215.421 139.7 215.67 139.664C215.954 139.593 216.186 139.469 216.364 139.291L224.904 132.138C224.441 131.32 223.801 130.662 222.982 130.164C222.164 129.665 221.256 129.416 220.26 129.416H194.64C193.395 129.416 192.292 129.808 191.331 130.591C190.37 131.338 189.747 132.298 189.463 133.473Z" />
</vector>
+17 −0
Original line number Diff line number Diff line
@@ -11158,6 +11158,23 @@
    <!-- Summary text for double tap power for camera [CHAR LIMIT=160]-->
    <string name="double_tap_power_for_camera_summary">To quickly open camera, press the power button twice. Works from any screen.</string>
    <!-- Title text for double tap power gesture [CHAR LIMIT=80]-->
    <string name="double_tap_power_title">Double tap power button</string>
    <!-- Summary for double tap power settings [DO NOT TRANSLATE] -->
    <string name="double_tap_power_summary" translatable="false"><xliff:g id="double_tap_power_on_off" example="On">%1$s</xliff:g> / <xliff:g id="double_tap_power_actions" example="Access Wallet">%2$s</xliff:g></string>
    <!-- Switch label to enable/disable double tap power button gesture [CHAR LIMIT=60] -->
    <string name="double_tap_power_enabled">Use double tap</string>
    <!-- Category title for double tap power gesture [CHAR_LIMIT=80] -->
    <string name="double_tap_power_target_action_category">Double Tap Power Button</string>
    <!-- Double Tap Power Gesture camera launch action title [CHAR_LIMIT=60] -->
    <string name="double_tap_power_camera_action_title">Open Camera</string>
    <!-- Setting summary to describe double tap power button will open camera. [CHAR LIMIT=NONE] -->
    <string name="double_tap_power_camera_action_summary">Access Camera</string>
    <!-- Double Tap Power Gesture wallet launch action title [CHAR_LIMIT=60] -->
    <string name="double_tap_power_wallet_action_title">Open Wallet</string>
    <!-- Setting summary to describe double tap power button will open wallet. [CHAR LIMIT=NONE] -->
    <string name="double_tap_power_wallet_action_summary">Access Wallet</string>
    <!-- Title text for double twist for camera mode [CHAR LIMIT=60]-->
    <string name="double_twist_for_camera_mode_title">Flip camera for selfie</string>
+21 −12
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2016 The Android Open Source Project
  Copyright (C) 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.
@@ -18,19 +18,28 @@
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:title="@string/double_tap_power_for_camera_title">

    android:title="@string/double_tap_power_title">
    <com.android.settingslib.widget.IllustrationPreference
        android:key="gesture_double_tap_power_video"
        settings:searchable="false"
        app:lottie_rawRes="@drawable/quickly_open_camera"/>

    <SwitchPreferenceCompat
        android:key="gesture_double_tap_power"
        android:title="@string/double_tap_power_for_camera_title"
        android:summary="@string/double_tap_power_for_camera_summary"
        app:keywords="@string/keywords_gesture"
        app:controller="com.android.settings.gestures.DoubleTapPowerPreferenceController"/>
        settings:lottie_rawRes="@drawable/quickly_open_camera"
        settings:controller="com.android.settings.gestures.DoubleTapPowerIllustrationPreferenceController"/>

    <com.android.settingslib.widget.MainSwitchPreference
        android:key="gesture_double_tap_power_enabled_main_switch"
        android:title="@string/double_tap_power_enabled"
        settings:keywords="@string/keywords_gesture"
        settings:controller="com.android.settings.gestures.DoubleTapPowerMainSwitchPreferenceController"/>
    <PreferenceCategory
        android:key="gesture_double_tap_power_actions"
        android:title="@string/double_tap_power_target_action_category">
        <com.android.settingslib.widget.SelectorWithWidgetPreference
            android:key="gesture_double_power_tap_camera"
            android:title="@string/double_tap_power_camera_action_title"
            settings:controller="com.android.settings.gestures.DoubleTapPowerForCameraPreferenceController"/>
        <com.android.settingslib.widget.SelectorWithWidgetPreference
            android:key="gesture_double_power_tap_wallet"
            android:title="@string/double_tap_power_wallet_action_title"
            settings:controller="com.android.settings.gestures.DoubleTapPowerForWalletPreferenceController"/>
    </PreferenceCategory>
</PreferenceScreen>
+35 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2016 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.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:title="@string/double_tap_power_for_camera_title">

    <com.android.settingslib.widget.IllustrationPreference
        android:key="gesture_double_tap_power_video"
        settings:searchable="false"
        settings:lottie_rawRes="@drawable/quickly_open_camera"/>

    <SwitchPreferenceCompat
        android:key="gesture_double_tap_power"
        android:title="@string/double_tap_power_for_camera_title"
        android:summary="@string/double_tap_power_for_camera_summary"
        settings:keywords="@string/keywords_gesture"
        settings:controller="com.android.settings.gestures.DoubleTapPowerToOpenCameraPreferenceController"/>

</PreferenceScreen>
Loading