From aaf839206d6a993b598487921ee9316e7c3d9e85 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Mon, 5 Aug 2024 22:12:42 +0200 Subject: [PATCH 1/3] Ease understanding missing track color error. --- .../fahrplan/congress/schedule/SessionViewDrawer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/SessionViewDrawer.kt b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/SessionViewDrawer.kt index 493e3dbc40..4337ecac71 100644 --- a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/SessionViewDrawer.kt +++ b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedule/SessionViewDrawer.kt @@ -1,6 +1,7 @@ package nerd.tuxmobil.fahrplan.congress.schedule import android.content.Context +import android.content.res.Resources.NotFoundException import android.view.View import android.widget.ImageView import android.widget.TextView @@ -83,7 +84,11 @@ internal class SessionViewDrawer( } else { trackNameBackgroundColorDefaultPairs[track] ?: R.color.track_background_default } - @ColorInt val backgroundColor = ContextCompat.getColor(context, backgroundColorResId) + @ColorInt val backgroundColor = try { + ContextCompat.getColor(context, backgroundColorResId) + } catch (e: NotFoundException) { + throw NotFoundException("Missing color for track \"$track\". Entries in track_resource_names.xml must be present in track_background_* colors.") + } val sessionDrawable = if (isFavored && isAlternativeHighlightingEnabled()) { SessionDrawable( backgroundColor, From a5d04ca378000ba0300525d99681eb48884fd4db Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Mon, 9 Sep 2024 21:37:39 +0200 Subject: [PATCH 2/3] Replace deprecated Modifier#animateItemPlacement with Modifier#animateItem. --- .../congress/schedulestatistic/ScheduleStatisticComposables.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt index 6e5d4ee0e7..874da1a31e 100644 --- a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt +++ b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt @@ -128,7 +128,7 @@ private fun ScheduleStatisticList(scheduleStatistic: List) { ColumnStatisticHeader() } items(scheduleStatistic, key = { it.name }) { - ColumnStatisticItem(it, Modifier.animateItemPlacement()) + ColumnStatisticItem(it, Modifier.animateItem()) } } } From f54dac2165da5f21f9f5009e3cacb3a62e386206 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Mon, 9 Sep 2024 21:39:23 +0200 Subject: [PATCH 3/3] Remove unneeded opt-in. --- .../congress/schedulestatistic/ScheduleStatisticComposables.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt index 874da1a31e..bcdf40f8c7 100644 --- a/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt +++ b/app/src/main/java/nerd/tuxmobil/fahrplan/congress/schedulestatistic/ScheduleStatisticComposables.kt @@ -1,6 +1,5 @@ package nerd.tuxmobil.fahrplan.congress.schedulestatistic -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row @@ -110,7 +109,6 @@ private fun NoScheduleStatistic() { } -@OptIn(ExperimentalFoundationApi::class) @Composable private fun ScheduleStatisticList(scheduleStatistic: List) { LazyColumn(