Merge changes I0c0a76c7,Iccfbe842 into main

* changes:
  Touchpad: remove icons
  Touchpad: add tap dragging setting
This commit is contained in:
Harry Cutts
2024-03-05 11:39:22 +00:00
committed by Android (Google) Code Review
8 changed files with 62 additions and 131 deletions

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2023 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="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M120,840L120,780L780,780Q780,780 780,780Q780,780 780,780L780,120L840,120L840,780Q840,804.75 822.38,822.38Q804.75,840 780,840L120,840ZM599.91,670Q571,670 550.5,649.41Q530,628.82 530,599.91Q530,571 550.59,550.5Q571.18,530 600.09,530Q629,530 649.5,550.59Q670,571.18 670,600.09Q670,629 649.41,649.5Q628.82,670 599.91,670ZM220,480L220,420L378,420L119,161L161,119L420,378L420,220L480,220L480,480L220,480Z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2022 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="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M407,635Q430,658 473.5,656.5Q517,655 537,624L753,285L418,504Q388,524 386,568Q384,612 407,635ZM478,161Q535,161 597,179.5Q659,198 716,243L664,280Q619,250 567.5,235.5Q516,221 477.98,221Q337.51,221 238.75,321.21Q140,421.43 140,563.98Q140,609 152.5,655Q165,701 188,740L767,740Q789,704 802,656Q815,608 815,562Q815,520 802.5,471.5Q790,423 758,382L797,330Q835,386 854,442.5Q873,499 875,556Q877,616 863,669Q849,722 822,767Q810,790 796.5,795Q783,800 763,800L192,800Q175,800 158.5,791.5Q142,783 134,767Q108,719 94,669.5Q80,620 80,564Q80,481 111.5,407.5Q143,334 197,279.5Q251,225 323.68,193Q396.36,161 478,161ZM469,492L469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492L469,492L469,492L469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492Q469,492 469,492Z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2022 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="24.0dp"
android:height="24.0dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M16.1,25.5V9.7L10.1,15.7L8,13.6L17.65,3.95L27.3,13.6L25.2,15.7L19.1,9.65V25.5ZM30.35,43.95 L20.7,34.25 22.8,32.2 28.8,38.2V22.4H31.8V38.25L37.9,32.2L40,34.3Z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2022 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="24.0dp"
android:height="24.0dp"
android:viewportWidth="48.0"
android:viewportHeight="48.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M23.25,2Q27.8,2 31.025,5.175Q34.25,8.35 34.25,12.9Q34.25,15.5 33.125,17.8Q32,20.1 29.95,21.7H28.25V19.2Q29.7,18.05 30.475,16.4Q31.25,14.75 31.25,12.9Q31.25,9.6 28.9,7.3Q26.55,5 23.25,5Q19.95,5 17.6,7.3Q15.25,9.6 15.25,12.9Q15.25,14.75 16.025,16.4Q16.8,18.05 18.25,19.2V22.8Q15.45,21.35 13.85,18.7Q12.25,16.05 12.25,12.9Q12.25,8.35 15.475,5.175Q18.7,2 23.25,2ZM21.35,44Q20.5,44 19.75,43.675Q19,43.35 18.45,42.8L8.15,32.5L10.95,29.6Q11.65,28.9 12.525,28.525Q13.4,28.15 14.35,28.4L18.25,29.3V13Q18.25,10.9 19.7,9.45Q21.15,8 23.25,8Q25.35,8 26.8,9.45Q28.25,10.9 28.25,13V21.6H29.55Q29.8,21.6 30,21.7Q30.2,21.8 30.45,21.9L37.85,25.5Q39.05,26.05 39.625,27.275Q40.2,28.5 39.95,29.8L38.15,40.7Q37.9,42.15 36.75,43.075Q35.6,44 34.15,44ZM20.95,41H35L37.15,28.55Q37.15,28.55 37.15,28.55Q37.15,28.55 37.15,28.55L28,24H25.25V13Q25.25,12.1 24.7,11.55Q24.15,11 23.25,11Q22.35,11 21.8,11.55Q21.25,12.1 21.25,13V32.95L13.55,31.3L12.4,32.45ZM35,41H20.95H21.25Q21.25,41 21.8,41Q22.35,41 23.25,41Q24.15,41 24.7,41Q25.25,41 25.25,41H28H35Q35,41 35,41Q35,41 35,41Z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2022 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="24dp"
android:height="24dp"
android:viewportWidth="48"
android:viewportHeight="48"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M40.15,47 L38.2,43.1 34.3,41.15 38.2,39.3 40.15,35.3 42,39.3 46,41.15 42,43.1ZM28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4Q28.5,31.4 28.5,31.4ZM23.05,48H30.4L29.75,45H23.05Q22,45 20.975,44.8Q19.95,44.6 19.25,43.9L6.5,30.65L7.85,29.4L19.75,35.85V9.15Q19.75,8.6 20.1,8.25Q20.45,7.9 21,7.9Q21.55,7.9 21.9,8.25Q22.25,8.6 22.25,9.15V24H26V4.25Q26,3.7 26.35,3.35Q26.7,3 27.25,3Q27.8,3 28.15,3.35Q28.5,3.7 28.5,4.25V24H32.25V6.1Q32.25,5.55 32.6,5.2Q32.95,4.85 33.5,4.85Q34.05,4.85 34.4,5.2Q34.75,5.55 34.75,6.1V24H38.5V12.45Q38.5,11.9 38.85,11.55Q39.2,11.2 39.75,11.2Q40.3,11.2 40.65,11.55Q41,11.9 41,12.45V31.4H44V12.45Q44,10.7 42.75,9.45Q41.5,8.2 39.75,8.2Q39.2,8.2 38.675,8.3Q38.15,8.4 37.75,8.75V6.45Q37.75,4.55 36.525,3.2Q35.3,1.85 33.5,1.85Q32.85,1.85 32.25,2.025Q31.65,2.2 31.1,2.6Q30.65,1.4 29.625,0.7Q28.6,0 27.3,0Q25.55,0 24.275,1.25Q23,2.5 23,4.25V5.55Q22.6,5.2 22.075,5.05Q21.55,4.9 21,4.9Q19.25,4.9 18,6.15Q16.75,7.4 16.75,9.15V30.95L8.85,26.5Q8,26.05 7.1,26.325Q6.2,26.6 5.5,27.25L2,30.3L16.85,45.7Q18.05,46.95 19.675,47.475Q21.3,48 23.05,48ZM6.85,14.8 L5.15,11.15 1.5,9.45 5.15,7.75 6.85,4.1 8.55,7.7 12.2,9.6 8.6,11.15Z"/>
</vector>

View File

@@ -4375,6 +4375,8 @@
<!-- Title text for 'Tap to click'. [CHAR LIMIT=35] --> <!-- Title text for 'Tap to click'. [CHAR LIMIT=35] -->
<string name="trackpad_tap_to_click">Tap to click</string> <string name="trackpad_tap_to_click">Tap to click</string>
<!-- TODO(b/321978150): mark as translatable once we have finalized text from UX. -->
<string name="trackpad_tap_dragging" translatable="false">Tap dragging</string>
<!-- Title text for 'Touchpad gestures' [CHAR LIMIT=35] --> <!-- Title text for 'Touchpad gestures' [CHAR LIMIT=35] -->
<string name="trackpad_touchpad_gesture_title">Touchpad gestures</string> <string name="trackpad_touchpad_gesture_title">Touchpad gestures</string>
<!-- Summary text for 'Touchpad gestures' [CHAR LIMIT=60] --> <!-- Summary text for 'Touchpad gestures' [CHAR LIMIT=60] -->

View File

@@ -23,7 +23,6 @@
android:key="trackpad_gesture_settings" android:key="trackpad_gesture_settings"
android:title="@string/trackpad_touchpad_gesture_title" android:title="@string/trackpad_touchpad_gesture_title"
android:summary="@string/trackpad_touchpad_gesture_summary" android:summary="@string/trackpad_touchpad_gesture_summary"
android:icon="@drawable/ic_trackpad_touch_gestures_normal"
android:order="-10" android:order="-10"
android:fragment="com.android.settings.inputmethod.TrackpadTouchGestureSettings" android:fragment="com.android.settings.inputmethod.TrackpadTouchGestureSettings"
settings:controller="com.android.settings.inputmethod.TrackpadTouchGestureSettingsController"/> settings:controller="com.android.settings.inputmethod.TrackpadTouchGestureSettingsController"/>
@@ -31,7 +30,6 @@
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="trackpad_tap_to_click" android:key="trackpad_tap_to_click"
android:title="@string/trackpad_tap_to_click" android:title="@string/trackpad_tap_to_click"
android:icon="@drawable/ic_trackpad_tap_to_click"
settings:controller="com.android.settings.inputmethod.TrackpadTapToClickPreferenceController" settings:controller="com.android.settings.inputmethod.TrackpadTapToClickPreferenceController"
android:order="10"/> android:order="10"/>
@@ -39,7 +37,6 @@
android:key="trackpad_reverse_scrolling" android:key="trackpad_reverse_scrolling"
android:title="@string/trackpad_reverse_scrolling_title" android:title="@string/trackpad_reverse_scrolling_title"
android:summary="@string/trackpad_reverse_scrolling_summary" android:summary="@string/trackpad_reverse_scrolling_summary"
android:icon="@drawable/ic_trackpad_reverse_scrolling"
settings:controller="com.android.settings.inputmethod.TrackpadReverseScrollingPreferenceController" settings:controller="com.android.settings.inputmethod.TrackpadReverseScrollingPreferenceController"
android:order="20"/> android:order="20"/>
@@ -47,15 +44,20 @@
android:key="trackpad_bottom_right_tap" android:key="trackpad_bottom_right_tap"
android:title="@string/trackpad_bottom_right_tap_title" android:title="@string/trackpad_bottom_right_tap_title"
android:summary="@string/trackpad_bottom_right_tap_summary" android:summary="@string/trackpad_bottom_right_tap_summary"
android:icon="@drawable/ic_trackpad_bottom_right_click"
settings:controller="com.android.settings.inputmethod.TrackpadBottomPreferenceController" settings:controller="com.android.settings.inputmethod.TrackpadBottomPreferenceController"
android:order="30" android:order="30"
settings:keywords="@string/keywords_trackpad_bottom_right_tap"/> settings:keywords="@string/keywords_trackpad_bottom_right_tap"/>
<!-- TODO(b/321978150): add a summary line once we have finalized text from UX. -->
<SwitchPreferenceCompat
android:key="trackpad_tap_dragging"
android:title="@string/trackpad_tap_dragging"
settings:controller="com.android.settings.inputmethod.TrackpadTapDraggingPreferenceController"
android:order="35"/>
<com.android.settings.widget.SeekBarPreference <com.android.settings.widget.SeekBarPreference
android:key="trackpad_pointer_speed" android:key="trackpad_pointer_speed"
android:title="@string/trackpad_pointer_speed" android:title="@string/trackpad_pointer_speed"
android:icon="@drawable/ic_trackpad_pointer_speed"
android:order="40" android:order="40"
android:selectable="false" android:selectable="false"
settings:controller="com.android.settings.inputmethod.TrackpadPointerSpeedPreferenceController"/> settings:controller="com.android.settings.inputmethod.TrackpadPointerSpeedPreferenceController"/>
@@ -63,6 +65,5 @@
<com.android.settingslib.widget.ButtonPreference <com.android.settingslib.widget.ButtonPreference
android:key="trackpad_touch_gesture" android:key="trackpad_touch_gesture"
android:title="@string/trackpad_touch_gesture" android:title="@string/trackpad_touch_gesture"
android:icon="@drawable/ic_trackpad_touch_gestures_inverse"
settings:controller="com.android.settings.inputmethod.TouchGesturesButtonPreferenceController"/> settings:controller="com.android.settings.inputmethod.TouchGesturesButtonPreferenceController"/>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -0,0 +1,53 @@
/*
* 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 android.content.Context;
import android.hardware.input.InputSettings;
import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController;
public class TrackpadTapDraggingPreferenceController extends TogglePreferenceController {
public TrackpadTapDraggingPreferenceController(Context context, String key) {
super(context, key);
}
@Override
public boolean isChecked() {
return InputSettings.useTouchpadTapDragging(mContext);
}
@Override
public boolean setChecked(boolean isChecked) {
InputSettings.setTouchpadTapDragging(mContext, isChecked);
// TODO(b/321978150): add a metric for tap dragging settings changes.
return true;
}
@Override
public int getAvailabilityStatus() {
return InputSettings.isTouchpadTapDraggingFeatureFlagEnabled()
? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
}
@Override
public int getSliceHighlightMenuRes() {
return R.string.menu_key_system;
}
}