From 1d0895a8f7daced87d5dd1fddff653984ab9f8b8 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Wed, 22 Nov 2023 09:22:39 +0100 Subject: [PATCH] Show out of time instead of negative days in the top bar --- .../mullvad/mullvadvpn/compose/component/TopBar.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt index 6db5d6473599..babd89271c33 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt @@ -314,11 +314,15 @@ fun MullvadTopBarWithDeviceName( text = stringResource( id = R.string.top_bar_time_left, - pluralStringResource( - id = R.plurals.days, - daysLeftUntilExpiry, - daysLeftUntilExpiry - ) + if (daysLeftUntilExpiry >= 0) { + pluralStringResource( + id = R.plurals.days, + daysLeftUntilExpiry, + daysLeftUntilExpiry + ) + } else { + stringResource(id = R.string.out_of_time) + } ), style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onBackground.copy(alpha = AlphaTopBar)