From 1b8cef9678745470b0ea960fb9fc752b591fdae0 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Tue, 16 May 2023 14:41:04 +0200 Subject: [PATCH] Fix live location render crash for Android < 7 Bring back proper implementation from 9ef870b9271, probably gone due to mismerge? Change-Id: I198488e57d9b800cee303373372b1fd165ddf7f1 --- .../timeline/item/DefaultLiveLocationShareStatusItem.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultLiveLocationShareStatusItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultLiveLocationShareStatusItem.kt index 9d3d6fc743..2e99384044 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultLiveLocationShareStatusItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/DefaultLiveLocationShareStatusItem.kt @@ -55,8 +55,10 @@ class DefaultLiveLocationShareStatusItem : LiveLocationShareStatusItem { width = mapWidth height = mapHeight } + // Yes, usually one would do this using drawable-v24... which glide seems to ignore? + val resource = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) R.drawable.bg_no_location_map_themed else R.drawable.bg_no_location_map GlideApp.with(mapImageView) - .load(ContextCompat.getDrawable(mapImageView.context, R.drawable.bg_no_location_map_themed)) + .load(ContextCompat.getDrawable(mapImageView.context, resource)) .transform(MultiTransformation(CenterCrop(), mapCornerTransformation)) .into(mapImageView) }