Final (?) touches to people/apps/sound circles

* Support comparing icon sets with a custom equivalence (needed because AppEntry doesn't implement equals(), and somewhat tricky because CircularIconPreference itself is not generic).
* Use final icons for allowed sounds.
* Use final appearance for +n icon.

Test: atest com.android.settings.notification.modes
Bug: 346551087
Flag: android.app.modes_ui
Change-Id: Iceadf4a182e607111afb72ff36bca872a62ae040
This commit is contained in:
Matías Hernández
2024-07-22 17:03:25 +02:00
parent d8b9fe8f01
commit 44c7272733
11 changed files with 262 additions and 26 deletions

View File

@@ -29,6 +29,7 @@ import android.service.notification.ZenPolicy;
import androidx.annotation.NonNull;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settingslib.notification.modes.ZenMode;
import com.google.common.collect.ImmutableList;
@@ -41,19 +42,13 @@ import java.util.Map;
*/
class ZenModeOtherLinkPreferenceController extends AbstractZenModePreferenceController {
// TODO: b/346551087 - Use proper icons
private static final ImmutableMap</* @PriorityCategory */ Integer, /* @DrawableRes */ Integer>
PRIORITIES_TO_ICONS = ImmutableMap.of(
PRIORITY_CATEGORY_ALARMS,
com.android.internal.R.drawable.ic_audio_alarm,
PRIORITY_CATEGORY_MEDIA,
com.android.settings.R.drawable.ic_media_stream,
PRIORITY_CATEGORY_SYSTEM,
com.android.settings.R.drawable.ic_settings_keyboards,
PRIORITY_CATEGORY_REMINDERS,
com.android.internal.R.drawable.ic_popup_reminder,
PRIORITY_CATEGORY_EVENTS,
com.android.internal.R.drawable.ic_zen_mode_type_schedule_calendar);
PRIORITY_CATEGORY_ALARMS, R.drawable.ic_zen_mode_sound_alarms,
PRIORITY_CATEGORY_MEDIA, R.drawable.ic_zen_mode_sound_media,
PRIORITY_CATEGORY_SYSTEM, R.drawable.ic_zen_mode_sound_system,
PRIORITY_CATEGORY_REMINDERS, R.drawable.ic_zen_mode_sound_reminders,
PRIORITY_CATEGORY_EVENTS, R.drawable.ic_zen_mode_sound_events);
private final ZenModeSummaryHelper mSummaryHelper;