From d5ca4c29d3b84925816dbc218f6d18530c99f0a7 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 11 Dec 2024 16:26:14 +0100 Subject: [PATCH] Fixed broken avatar generation for notifications & shortcuts --- .../main/java/org/linphone/contacts/AvatarGenerator.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/linphone/contacts/AvatarGenerator.kt b/app/src/main/java/org/linphone/contacts/AvatarGenerator.kt index 58bdefba4..dfeadb58f 100644 --- a/app/src/main/java/org/linphone/contacts/AvatarGenerator.kt +++ b/app/src/main/java/org/linphone/contacts/AvatarGenerator.kt @@ -45,11 +45,17 @@ class AvatarGenerator(private val context: Context) { init { val textTypedValue = TypedValue() context.theme.resolveAttribute(R.attr.color_avatar_text, textTypedValue, true) - textColor = textTypedValue.data + // This will fail for notifications + if (textTypedValue.data != 0) { + textColor = textTypedValue.data + } val backgroundTypedValue = TypedValue() context.theme.resolveAttribute(R.attr.color_avatar_background, backgroundTypedValue, true) - backgroundColor = backgroundTypedValue.data + // This will fail for notifications + if (backgroundTypedValue.data != 0) { + backgroundColor = backgroundTypedValue.data + } } fun setTextSize(size: Float) = apply {