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

Commit 35210039 authored by Matías Hernández's avatar Matías Hernández
Browse files

Show icons for allowed sounds

(Some icons are temporary, until we get the final assets)

Also some fixes/improvements to CircularIconsPreference:
* Show the correct placeholder and +N icons.
* Fix the displayIcons-before-measure case (global layout listener was incorrect).
* Properly cancel pending image load futures (field didn't point to the actual future).
* Don't reload icons if it's the same set (depends on equals() for the items, so unfortunately doesn't work for AppEntry yet).

Test: atest com.android.settings.notification.modes
Bug: 346551087
Flag: android.app.modes_ui
Change-Id: I9d029a5fdd785ada4e2ba4d8a90eba72b5fb9085
parent 0ebc865c
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<!--
  ~ 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.
  -->

<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:shape="oval">
    <size
        android:width="@dimen/zen_mode_circular_icon_diameter"
        android:height="@dimen/zen_mode_circular_icon_diameter" />
    <solid android:color="?androidprv:attr/materialColorSecondaryContainer" />
    <!-- TODO: b/346551087 - Include border (or not) according to final design
    <stroke android:width="1dp" android:color="?androidprv:attr/materialColorOnSecondaryContainer" />
    -->
</shape>
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/zen_mode_circular_icon_size"
    android:layout_height="@dimen/zen_mode_circular_icon_size"
    android:layout_width="@dimen/zen_mode_circular_icon_diameter"
    android:layout_height="@dimen/zen_mode_circular_icon_diameter"
    android:layout_marginTop="@dimen/zen_mode_circular_icon_margin_vertical"
    android:layout_marginBottom="@dimen/zen_mode_circular_icon_margin_vertical"
    android:layout_marginEnd="@dimen/zen_mode_circular_icon_margin_between" />
 No newline at end of file
+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.
  -->

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    android:layout_width="@dimen/zen_mode_circular_icon_diameter"
    android:layout_height="@dimen/zen_mode_circular_icon_diameter"
    android:layout_marginTop="@dimen/zen_mode_circular_icon_margin_vertical"
    android:layout_marginBottom="@dimen/zen_mode_circular_icon_margin_vertical"
    android:gravity="center"
    android:padding="4dp"
    android:drawablePadding="0dp"
    android:background="@drawable/preference_circular_icons_plus_item_background"
    android:textColor="?androidprv:attr/materialColorOnSecondaryContainer"
    android:maxLines="1"
    android:autoSizeTextType="uniform"
    android:autoSizeMinTextSize="6sp" />
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -509,7 +509,8 @@
    <dimen name="zen_mode_icon_list_item_circle_diameter">56dp</dimen>
    <dimen name="zen_mode_icon_list_item_icon_size">32dp</dimen>
    <!-- For the items in the CircularIconsPreference (contacts, apps, sound channels). -->
    <dimen name="zen_mode_circular_icon_size">32dp</dimen>
    <dimen name="zen_mode_circular_icon_diameter">32dp</dimen>
    <dimen name="zen_mode_circular_icon_inner_icon_size">20dp</dimen>
    <dimen name="zen_mode_circular_icon_margin_between">4dp</dimen>
    <dimen name="zen_mode_circular_icon_margin_vertical">8dp</dimen>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -9361,6 +9361,8 @@
    <string name="zen_mode_apps_work_app"><xliff:g id="app_label" example="Chrome">%s</xliff:g> (Work)</string>
    <!-- Text displayed (for a brief time) while the list of bypassing apps is being fetched. Will be replaced by a zen_mode_apps_subtext. [CHAR_LIMIT=60] -->
    <string name="zen_mode_apps_calculating">Calculating\u2026</string>
    <!-- Priority Modes: Format for a string displayed when there are more items (e.g. apps, contacts) that can be shown. For example, we show (A)(B)(C)(+5), where this string represents the "+5" value. Needs to be as compact as possible, since it will be drawn in a really small area. [CHAR_LIMIT=4] -->
    <string name="zen_mode_plus_n_items">+<xliff:g id="number" example="42">%d</xliff:g></string>
    <!-- [CHAR LIMIT=100] Zen mode settings: Allow apps to bypass DND -->
    <string name="zen_mode_bypassing_apps">Allow apps to override</string>
Loading