-
Notifications
You must be signed in to change notification settings - Fork 18
DrawableSource
Alexander Zhirkevich edited this page Sep 7, 2022
·
4 revisions
Source of android Drawable
fun interface DrawableSource {
suspend fun get(context: Context) : Drawable
}
suspend fun get(context: Context) : Drawable
Get drawable using context
Implementation | Description |
---|---|
DrawableSource.Empty |
Represents lack of Drawable
|
DrawableSource.Resource |
Get drawable from app drawable resources |
DrawableSource.File |
Get drawable from android file system. App must have permission to read this file |
It is fun interface
. So, if you have direct Drawable
instance, it can be easily wrapped to DrawableSource
:
val source = DrawableSource { drawable }
Serialization will not work for this example