com.salesforce.android.knowledge.ui.KnowledgeImageProvider |
Interface for providing background/header images for articles and data categories.
Images may be provided for articles and data categories by implementing this interface and then passing an instance of the resultant class to the KnowledgeUI client via thesetImageProvider(KnowledgeImageProvider)
method.
The interface does not specify how the images are sourced, but the recommended implementation is
to load them from disk. For performance reasons, it is recommended that implementations cache
the loaded assets for future requests. Failure to do so may result in UI lag and excess memory
consumption. The Android SDK provides an android.support.v4.util.LruCache which is an
excellent choice for a backing cache to a KnowledgeImageProvider
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract Drawable |
getImageForArticle(Context context, ArticleSummary article)
Returns a Drawable image for the given article, or null if no image should be used.
| ||||||||||
abstract Drawable |
getImageForDataCategory(Context context, DataCategorySummary dataCategory)
Returns a Drawable image for the given data category, or null if no image should be used.
|
Returns a Drawable image for the given article, or null if no image should be used.
context | A context object to use. |
---|---|
article | The article for which an image should be returned. |
Returns a Drawable image for the given data category, or null if no image should be used.
context | A context object to use. |
---|---|
dataCategory | The data category for which an image should be returned. |