Skip to content

Commit

Permalink
Show expired instead of negative days left
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Nov 21, 2023
1 parent af8439a commit 543aa7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ fun MullvadTopBarWithDeviceName(
text =
deviceName?.let {
stringResource(id = R.string.top_bar_device_name, deviceName)
}
?: "",
} ?: "",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodySmall,
Expand All @@ -312,14 +311,18 @@ fun MullvadTopBarWithDeviceName(
if (daysLeftUntilExpiry != null) {
Text(
text =
stringResource(
id = R.string.top_bar_time_left,
pluralStringResource(
id = R.plurals.days,
daysLeftUntilExpiry,
daysLeftUntilExpiry
if (daysLeftUntilExpiry >= 0) {
stringResource(
id = R.string.top_bar_time_left,
pluralStringResource(
id = R.plurals.days,
daysLeftUntilExpiry,
daysLeftUntilExpiry
)
)
),
} else {
stringResource(id = R.string.top_bar_time_left_expired)
},
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onBackground.copy(alpha = AlphaTopBar)
)
Expand Down
1 change: 1 addition & 0 deletions android/lib/resource/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,5 @@
<string name="payment_pending_dialog_message">We are currently verifying your purchase, this might take some time. Your time will be added if the verification is successful.</string>
<string name="loading_connecting">Connecting...</string>
<string name="loading_verifying">Verifying purchase...</string>
<string name="top_bar_time_left_expired">Expired</string>
</resources>

0 comments on commit 543aa7a

Please sign in to comment.