data class Suggestion
(source)
A Suggestion to be displayed by an AwesomeBar implementation.
data class Chip
Chips are compact actions that are shown as part of a suggestion. For example a Suggestion from a search engine may offer multiple search suggestion chips for different search terms. |
|
enum class Flag
Flags can be added by a SuggestionProvider to help the AwesomeBar implementation decide how to display a specific Suggestion. For example an AwesomeBar could display a bookmark star icon next to Suggestions that contain the BOOKMARK flag. |
Suggestion(id: String = UUID.randomUUID().toString(), title: String? = null, description: String? = null, icon: (width: Int, height: Int) -> Bitmap? = { _, _ -> null }, chips: List<Chip> = emptyList(), flags: Set<Flag> = emptySet(), onSuggestionClicked: () -> Unit = null, onChipClicked: (Chip) -> Unit = null, score: Int = 0)
A Suggestion to be displayed by an AwesomeBar implementation. |
val chips: List<Chip>
A list of Chip instances to be displayed. |
|
val description: String?
A user-readable description for the Suggestion. |
|
val flags: Set<Flag>
A set of Flag values for this Suggestion. |
|
val icon: (width: Int, height: Int) -> Bitmap?
A lambda that can be invoked by the AwesomeBar implementation to receive an icon Bitmap for this Suggestion. The AwesomeBar will pass in its desired width and height for the Bitmap. |
|
val id: String
A unique ID identifying this Suggestion. A stable ID but different data indicates to the AwesomeBar that this is the same Suggestion with new data. This will affect how the AwesomeBar animates showing the new suggestion. |
|
val onChipClicked: (Chip) -> Unit
A callback to be executed when a Chip was clicked by the user. |
|
val onSuggestionClicked: () -> Unit
A callback to be executed when the Suggestion was clicked by the user. |
|
val score: Int
A score used to rank suggestions of this provider against each other. A suggestion with a higher score will be shown on top of suggestions with a lower score. |
|
val title: String?
A user-readable title for the Suggestion. |
fun areContentsTheSame(other: Suggestion): Boolean
Returns true if the content of the two suggestions is the same. |