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

Commit bb41777f authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

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

parents 27b5476b 574fcaf1
Loading
Loading
Loading
Loading
+32 −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.
  -->

<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>
 No newline at end of file
+35 −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.
  -->

<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>
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
@@ -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>
+13 −3
Original line number Diff line number Diff line
@@ -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>
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ class ZenModeActionsPreferenceController extends AbstractZenModePreferenceContro
            Bundle bundle = new Bundle();
            bundle.putString(EXTRA_AUTOMATIC_ZEN_RULE_ID, zenMode.getId());
            new SubSettingLauncher(mContext)
                    .setDestination(ZenModeIconPickerFragment.class.getName())
                    .setDestination(ZenModeEditNameIconFragment.class.getName())
                    // TODO: b/332937635 - Update metrics category
                    .setSourceMetricsCategory(0)
                    .setArguments(bundle)
Loading