-
Notifications
You must be signed in to change notification settings - Fork 354
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
Showing
15 changed files
with
243 additions
and
94 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...rc/main/kotlin/net/mullvad/mullvadvpn/compose/communication/CustomListActionResultData.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,54 @@ | ||
package net.mullvad.mullvadvpn.compose.communication | ||
|
||
import android.os.Parcelable | ||
import kotlinx.parcelize.IgnoredOnParcel | ||
import kotlinx.parcelize.Parcelize | ||
import net.mullvad.mullvadvpn.lib.model.CustomListName | ||
|
||
sealed interface CustomListActionResultData : Parcelable { | ||
val undo: CustomListAction? | ||
|
||
@Parcelize | ||
data class CreatedWithLocations( | ||
val customListName: CustomListName, | ||
val locationNames: List<String>, | ||
override val undo: CustomListAction | ||
) : CustomListActionResultData | ||
|
||
@Parcelize | ||
data class Deleted( | ||
val customListName: CustomListName, | ||
override val undo: CustomListAction.Create | ||
) : CustomListActionResultData | ||
|
||
@Parcelize | ||
data class Renamed(val newName: CustomListName, override val undo: CustomListAction) : | ||
CustomListActionResultData | ||
|
||
@Parcelize | ||
data class LocationAdded( | ||
val customListName: CustomListName, | ||
val locationName: String, | ||
override val undo: CustomListAction | ||
) : CustomListActionResultData | ||
|
||
@Parcelize | ||
data class LocationRemoved( | ||
val customListName: CustomListName, | ||
val locationName: String, | ||
override val undo: CustomListAction | ||
) : CustomListActionResultData | ||
|
||
@Parcelize | ||
data class LocationChanged( | ||
val customListName: CustomListName, | ||
override val undo: CustomListAction | ||
) : CustomListActionResultData | ||
|
||
@Parcelize | ||
data object GenericError : CustomListActionResultData { | ||
@IgnoredOnParcel override val undo: CustomListAction? = null | ||
} | ||
|
||
fun hasUndo() = undo != null | ||
} |
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
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
Oops, something went wrong.