Created
April 19, 2022 18:47
-
-
Save 5AbhishekSaxena/33df7096adc59ca624f30ecee9d634e0 to your computer and use it in GitHub Desktop.
This is an improved version of https://gist.github.com/5AbhishekSaxena/0a1e18dfa61af3bdded939187f27a43e
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
sealed class UiImage<out T>(val resource: T) { | |
data class LocalImage(private val imageRes: Int) : UiImage<Int>(resource = imageRes) | |
data class RemoteImage(private val imageUrl: String) : UiImage<String>(resource = imageUrl) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implementation example