-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Inform user about enabling Ent-to-End Identity (WPB-308) (#1903)
* feat: Inform user about enabling End to End identity * feat: Inform user about enabling End to End identity: updated kalium * feat: Inform user about enabling End to End identity: ready for review * feat: Inform user about enabling Ent-to-End Identity: code style fix * feat: Inform user about enabling Ent-to-End Identity: tests fix * feat: Inform user about enabling Ent-to-End Identity: review * feat: Inform user about enabling Ent-to-End Identity: updated kalium * feat: Inform user about enabling Ent-to-End Identity: review
- Loading branch information
1 parent
8438b3e
commit 30a7692
Showing
8 changed files
with
269 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2023 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.android.util | ||
|
||
import com.wire.android.R | ||
import com.wire.android.util.ui.UIText | ||
import kotlin.time.Duration | ||
|
||
fun Duration.toTimeLongLabelUiText(): UIText.PluralResource = when { | ||
inWholeDays >= DAYS_IN_WEEK -> { | ||
val weeks = inWholeDays.toInt() / DAYS_IN_WEEK | ||
UIText.PluralResource(R.plurals.weeks_long_label, weeks, weeks) | ||
} | ||
|
||
inWholeDays >= 1 -> UIText.PluralResource(R.plurals.days_long_label, inWholeDays.toInt(), inWholeDays) | ||
inWholeHours >= 1 -> UIText.PluralResource(R.plurals.hours_long_label, inWholeHours.toInt(), inWholeHours) | ||
inWholeMinutes >= 1 -> UIText.PluralResource(R.plurals.minutes_long_label, inWholeMinutes.toInt(), inWholeMinutes) | ||
else -> UIText.PluralResource(R.plurals.seconds_long_label, inWholeSeconds.toInt(), inWholeSeconds) | ||
} | ||
|
||
private const val DAYS_IN_WEEK = 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.