Merge "Add mode: Choose name and icon for new custom modes" into main

This commit is contained in:
Matías Hernández
2024-07-09 02:20:07 +00:00
committed by Android (Google) Code Review
18 changed files with 1154 additions and 69 deletions

View File

@@ -0,0 +1,32 @@
<?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.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/done"
android:text="@string/done"
style="@style/ActionPrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginEnd="20dp"
/>
</FrameLayout>

View File

@@ -0,0 +1,35 @@
<?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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@android:id/edit"
android:maxLines="1"
android:inputType="text|textCapSentences"
android:imeOptions="actionDone"
android:selectAllOnFocus="true"
android:hint="@string/zen_mode_edit_name_hint" />
</LinearLayout>

View File

@@ -9452,6 +9452,18 @@
<!-- [CHAR LIMIT=40] Zen mode settings: Title for the "choose mode icon" screen -->
<string name="zen_mode_icon_picker_title">Change icon</string>
<!-- Priority Modes: Title for the "rename mode" screen [CHAR LIMIT=20] -->
<string name="zen_mode_rename_title">Rename</string>
<!-- Priority Modes: Title for the "add mode" screen [CHAR LIMIT=20] -->
<string name="zen_mode_new_custom_title">Add mode</string>
<!-- Priority Modes: Default name for new custom modes [CHAR LIMIT=30] -->
<string name="zen_mode_new_custom_default_name">Custom mode</string>
<!-- Priority Modes: Hint for the EditText for editing a mode's name [CHAR LIMIT=30] -->
<string name="zen_mode_edit_name_hint">Mode name</string>
<!-- Content description for help icon button [CHAR LIMIT=20] -->
<string name="warning_button_text">Warning</string>

View File

@@ -18,20 +18,30 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="zen_mode_icon_picker_page"
android:key="zen_mode_edit_name_icon"
settings:searchable="false"
android:title="@string/zen_mode_icon_picker_title">
android:title="@string/zen_mode_rename_title">
<com.android.settingslib.widget.LayoutPreference
android:key="current_icon"
android:key="chosen_icon"
android:layout="@layout/settings_entity_header" />
<com.android.settings.applications.SpacePreference
android:layout_height="16dp" />
<com.android.settingslib.widget.LayoutPreference
android:key="name"
android:layout="@layout/modes_edit_name" />
<com.android.settings.applications.SpacePreference
android:layout_height="32dp" />
<com.android.settingslib.widget.LayoutPreference
android:key="icon_list"
android:selectable="false"
android:layout="@layout/modes_icon_list"/>
<com.android.settingslib.widget.LayoutPreference
android:key="done"
android:layout="@layout/modes_edit_done_button" />
</PreferenceScreen>