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

Commit 8fe15cb2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[3FT] "Open another app" Preference" into main

parents 5b86508d 6040ec9d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -97,3 +97,10 @@ flag {
  description: "All touchpad settings pages should either migrate to non-custom implementations or be updated"
  bug: "400647661"
}

flag {
  name: "three_finger_tap_app_launch"
  namespace: "android_settings"
  description: "Use three finger tap to open a custom app"
  bug: "399645334"
}
+5 −0
Original line number Diff line number Diff line
@@ -4977,6 +4977,11 @@
    <!-- Radio button text for 'View recent apps' action. This is one of multiple actions the user can select from the three finger tap customization radio group. The action if selected will show the recent apps when a three-finger tap is performed on a touchpad. [CHAR LIMIT=35] -->
    <string name="three_finger_tap_recent_apps">View recent apps</string>
    <!-- Title text for 'Open another app' action preference. This preference allows the user to select an installed app to to launch when a three-finger tap is performed on a touchpad. [CHAR LIMIT=35] -->
    <string name="three_finger_tap_launch_app_title">Open another app</string>
    <!-- Summary text for the 'Open another app' action Preference. [CHAR LIMIT=NONE] -->
    <string name="three_finger_tap_launch_app_summary">Choose from a list of installed apps</string>
    <!-- Title text for 'Go home' gesture education [CHAR LIMIT=35] -->
    <string name="gesture_title_go_home">Go home</string>
    <!-- Summary text for 'Go home' gesture education [CHAR LIMIT=60] -->
+7 −0
Original line number Diff line number Diff line
@@ -41,4 +41,11 @@
        android:key="recent_apps"
        android:title="@string/three_finger_tap_recent_apps"
        settings:controller="com.android.settings.inputmethod.TouchpadThreeFingerTapActionPreferenceController"/>
    <Preference
        android:key="launch_app"
        android:title="@string/three_finger_tap_launch_app_title"
        android:summary="@string/three_finger_tap_launch_app_summary"
        android:fragment="com.android.settings.inputmethod.TouchpadThreeFingerTapAppSelectionFragment"
        android:featureFlag="com.android.settings.flags.three_finger_tap_app_launch"/>

</PreferenceScreen>
+21 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2025 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"
    android:key="input_touchpad_three_finger_tap"
    android:persistent="false"
    android:title="@string/three_finger_tap_launch_app_title"/>
+61 −0
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.settings.inputmethod;

import static com.android.settings.inputmethod.InputPeripheralsSettingsUtils.isTouchpad;

import android.app.settings.SettingsEnums;
import android.content.Context;

import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;

/** List all installed apps to be launched with three finger tap. */
@SearchIndexable(forTarget = SearchIndexable.ALL & ~SearchIndexable.ARC)
public class TouchpadThreeFingerTapAppSelectionFragment extends InputDeviceDashboardFragment {

    private static final String TAG = "TouchpadThreeFingerTapAppSelectionFragment";

    @Override
    public int getMetricsCategory() {
        return SettingsEnums.TOUCHPAD_THREE_FINGER_TAP;
    }

    @Override
    protected int getPreferenceScreenResId() {
        return R.xml.input_touchpad_three_finger_tap_app_selection;
    }

    @Override
    protected String getLogTag() {
        return TAG;
    }

    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider(R.xml.input_touchpad_three_finger_tap_app_selection) {
                @Override
                protected boolean isPageSearchEnabled(Context context) {
                    return isTouchpad();
                }
            };

    @Override
    protected boolean needToFinishEarly() {
        return isTouchpadDetached();
    }
}