Created
February 1, 2022 18:32
-
-
Save ch8n/27de736a560741d996b7e08259573ccf to your computer and use it in GitHub Desktop.
Sealed class for Download Manager Status
This file contains hidden or 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
sealed class DownloadManagerStatus { | |
sealed class DownloadStatus : DownloadManagerStatus() { | |
sealed class StatusPaused : DownloadStatus() { | |
object QueuedForWifi : StatusPaused() | |
object WaitingForNetwork : StatusPaused() | |
object WaitingToRetry : StatusPaused() | |
object Unknown : StatusPaused() | |
} | |
sealed class StatusFailed : DownloadStatus() { | |
object CannotResume : StatusFailed() | |
object DeviceNotFound : StatusFailed() | |
object FileAlreadyExists : StatusFailed() | |
object FileError : StatusFailed() | |
object HttpDataError : StatusFailed() | |
object InsufficientSpace : StatusFailed() | |
object TooManyRedirects : StatusFailed() | |
object UnhandledHttpCode : StatusFailed() | |
object Unknown : StatusFailed() | |
} | |
object StatusSuccessful : DownloadStatus() | |
object StatusRunning : DownloadStatus() | |
object StatusPending : DownloadStatus() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment