RemoteDrawable
A LiveDataDrawable that resolves its LiveData contents from the given URI.
NOTE: By default, the drawable will be downloaded as its original size. When the uri
represents a vector drawable, its original/ intrinsic size could be smaller than the view to be attached. This results in a blurry or pixelated appearance in the UI. In this case, targetView
can be assigned as an indicator to specify the dimensions of the target view for this drawable. Also, it is the client's responsibility to make sure the uri
is secure and trusted.
Parameters
The context used for downloading the drawable from the URI.
The URI to download the drawable from.
The drawable to show before the drawable from the URI has been downloaded.
The drawable to show if some error happen.
The target view for the drawable. When a target view is given, the remote drawable will be downloaded as large as the dimension of the target view. When this is null
, the remote drawable will be downloaded as its original size.
Constructors
Inherited properties
Inherited functions
Extensions
Returns the drawable's dominant color with a brightness adjustment. If no dominant color is available it falls back to defaultColor. The brightness value of the dominant color is adjusted to an average value in between the original one and the defaultColor brightness value. Therefore, the returned dominant color can be brighter or darker than the original dominant color.