-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6541297
commit f59dea5
Showing
8 changed files
with
112 additions
and
41 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
20 changes: 20 additions & 0 deletions
20
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DeviceNameInfoDialog.kt
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,20 @@ | ||
package net.mullvad.mullvadvpn.compose.dialog | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.stringResource | ||
import net.mullvad.mullvadvpn.R | ||
|
||
@Composable | ||
fun DeviceNameInfoDialog(onDismiss: () -> Unit) { | ||
InfoDialog( | ||
message = | ||
buildString { | ||
appendLine(stringResource(id = R.string.device_name_info_first_paragraph)) | ||
appendLine() | ||
appendLine(stringResource(id = R.string.device_name_info_second_paragraph)) | ||
appendLine() | ||
appendLine(stringResource(id = R.string.device_name_info_third_paragraph)) | ||
}, | ||
onDismiss = onDismiss | ||
) | ||
} |
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
9 changes: 0 additions & 9 deletions
9
android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/state/AccountUiState.kt
This file was deleted.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/AccountUiState.kt
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,28 @@ | ||
package net.mullvad.mullvadvpn.viewmodel | ||
|
||
import net.mullvad.mullvadvpn.model.AccountExpiry | ||
import net.mullvad.mullvadvpn.model.DeviceState | ||
import org.joda.time.DateTime | ||
|
||
data class AccountUiState( | ||
val deviceName: String?, | ||
val accountNumber: String?, | ||
val accountExpiry: DateTime?, | ||
val dialogState: AccountScreenDialogState = AccountScreenDialogState.NoDialog | ||
) { | ||
companion object { | ||
fun default() = | ||
AccountUiState( | ||
deviceName = DeviceState.Unknown.deviceName(), | ||
accountNumber = DeviceState.Unknown.token(), | ||
accountExpiry = AccountExpiry.Missing.date(), | ||
dialogState = AccountScreenDialogState.NoDialog | ||
) | ||
} | ||
} | ||
|
||
sealed class AccountScreenDialogState { | ||
data object NoDialog : AccountScreenDialogState() | ||
|
||
data object DeviceNameInfoDialog : AccountScreenDialogState() | ||
} |
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