Class DynamicLoader
java.lang.Object
com.pranavpandey.android.dynamic.util.loader.DynamicLoader
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the drawable cache.Returns the drawable cache used by this loader.static DynamicLoader
Retrieves the singleton instance ofDynamicLoader
.loadAppIcon
(Context context, String packageName) Load the app icon from the cache.loadDrawable
(Context context, int drawableRes) Load the drawable resource from the cache.<V,
P, R> Future<?> setAsync
(DynamicCallback<V, P, R> callback) Set the view asynchronously by using theDynamicCallback
.<V,
P, R> Future<?> setAsync
(ExecutorService executorService, DynamicCallback<V, P, R> callback) Set the view asynchronously by using theDynamicCallback
.
-
Method Details
-
getInstance
Retrieves the singleton instance ofDynamicLoader
.Must be called before accessing the public methods.
- Returns:
- The singleton instance of
DynamicLoader
-
getDrawableLruCache
Returns the drawable cache used by this loader.- Returns:
- The drawable cache used by this loader.
-
clearDrawables
public void clearDrawables()Clear the drawable cache. -
loadDrawable
Load the drawable resource from the cache.- Parameters:
context
- The context to get the resources.drawableRes
- The drawable resource to be used.- Returns:
- The drawable resource from the cache.
-
loadAppIcon
Load the app icon from the cache.- Parameters:
context
- The context to get the package manager.packageName
- The package name to be used.- Returns:
- The app icon from the cache.
-