From 83ff9db6680a9fb761eb542f2933ee88bcc77cc0 Mon Sep 17 00:00:00 2001 From: Jernej Virag Date: Mon, 14 Feb 2022 16:17:40 +0000 Subject: Size restrict right notification icon size Right now the right notification icon is always loaded at full resolution. This will downsample the icon to displayed size if the user passes a bitmap that's large. Bug:218845090 Bug:210690571 Test: Manually on device Change-Id: Ib66933a8fe92765e069f1571ded990b37f82b05f --- core/res/res/layout/notification_template_header.xml | 2 ++ core/res/res/layout/notification_template_material_base.xml | 6 +++++- core/res/res/layout/notification_template_right_icon.xml | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/res/res/layout/notification_template_header.xml b/core/res/res/layout/notification_template_header.xml index 81a79c50c3ef..a7f2aa7cba69 100644 --- a/core/res/res/layout/notification_template_header.xml +++ b/core/res/res/layout/notification_template_header.xml @@ -49,6 +49,8 @@ android:layout_marginStart="@dimen/notification_icon_circle_start" android:background="@drawable/notification_icon_circle" android:padding="@dimen/notification_icon_circle_padding" + android:maxDrawableWidth="@dimen/notification_icon_circle_size" + android:maxDrawableHeight="@dimen/notification_icon_circle_size" /> diff --git a/core/res/res/layout/notification_template_material_base.xml b/core/res/res/layout/notification_template_material_base.xml index c6983ae5e045..fd787f6ea470 100644 --- a/core/res/res/layout/notification_template_material_base.xml +++ b/core/res/res/layout/notification_template_material_base.xml @@ -45,6 +45,8 @@ android:layout_marginStart="@dimen/notification_icon_circle_start" android:background="@drawable/notification_icon_circle" android:padding="@dimen/notification_icon_circle_padding" + android:maxDrawableWidth="@dimen/notification_icon_circle_size" + android:maxDrawableHeight="@dimen/notification_icon_circle_size" /> - - -- cgit v1.2.3-59-g8ed1b