summaryrefslogtreecommitdiffhomepage
path: root/android/lib/model
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-03-11 11:00:15 +0100
committerKalle Lindström <karl.lindstrom@mullvad.net>2025-03-19 09:33:07 +0100
commite2d5d4f1f444f1dfbee5077889a62731aec080c6 (patch)
tree94e8bfca4a946f931ae3ce6b22a8a50eec795b48 /android/lib/model
parent793c39338a2fcd2bf188952061edaeaa925d614a (diff)
downloadmullvadvpn-e2d5d4f1f444f1dfbee5077889a62731aec080c6.tar.xz
mullvadvpn-e2d5d4f1f444f1dfbee5077889a62731aec080c6.zip
Improve TV connect screen UI
- Implements the navigation rail design for Android TV - Implements the TV notification banner design - Adds two new Gradle modules: * tv: contains the Android TV specific Compose components (e.g. the NavigationDrawerTV component) * ui/compose: contains Compose-specific code that is needed by both the app module and the tv module.
Diffstat (limited to 'android/lib/model')
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt44
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/VersionInfo.kt3
2 files changed, 47 insertions, 0 deletions
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt
new file mode 100644
index 0000000000..fdaa5f3c9d
--- /dev/null
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/InAppNotification.kt
@@ -0,0 +1,44 @@
+package net.mullvad.mullvadvpn.lib.model
+
+import java.time.Duration
+
+enum class StatusLevel {
+ Error,
+ Warning,
+ Info,
+}
+
+sealed class InAppNotification {
+ abstract val statusLevel: StatusLevel
+ abstract val priority: Long
+
+ data class TunnelStateError(val error: ErrorState) : InAppNotification() {
+ override val statusLevel = StatusLevel.Error
+ override val priority: Long = 1001
+ }
+
+ data object TunnelStateBlocked : InAppNotification() {
+ override val statusLevel = StatusLevel.Error
+ override val priority: Long = 1000
+ }
+
+ data class UnsupportedVersion(val versionInfo: VersionInfo) : InAppNotification() {
+ override val statusLevel = StatusLevel.Error
+ override val priority: Long = 999
+ }
+
+ data class AccountExpiry(val expiry: Duration) : InAppNotification() {
+ override val statusLevel = StatusLevel.Warning
+ override val priority: Long = 1001
+ }
+
+ data class NewDevice(val deviceName: String) : InAppNotification() {
+ override val statusLevel = StatusLevel.Info
+ override val priority: Long = 1001
+ }
+
+ data object NewVersionChangelog : InAppNotification() {
+ override val statusLevel = StatusLevel.Info
+ override val priority: Long = 1001
+ }
+}
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/VersionInfo.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/VersionInfo.kt
new file mode 100644
index 0000000000..1a225d482f
--- /dev/null
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/VersionInfo.kt
@@ -0,0 +1,3 @@
+package net.mullvad.mullvadvpn.lib.model
+
+data class VersionInfo(val currentVersion: String, val isSupported: Boolean)