SearchResultHighlighter

PdfDrawableProvider creating highlights based on a list of SearchResult instances.

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard

Adds the given results to the set of previously added results. In contrast to setSearchResults a call to this will not clear previously set results. Also any previously selected search result will not be cleared.

Link copied to clipboard

Clears all previously selected search results.

Link copied to clipboard
open suspend override fun getDrawablesForPage(context: Context, document: PdfDocument, @IntRange(from = 0) pageIndex: Int): List<ERROR CLASS: Symbol not found for PdfDrawable>

Returns all drawables for the given document and pageIndex. The framework may call this method on any thread.

Link copied to clipboard

Returns padding of the highlighted search result used when pop-out animating the currently selected search result. This defaults to R.dimen.pspdf__search_result_animation_padding.

Link copied to clipboard

Returns padding of the highlighted search result used when highlighting annotations. This defaults to R.dimen.pspdf__search_result_annotation_padding.

Link copied to clipboard

Returns color of the highlighted search result. This defaults to R.color.pspdf__color_highlight.

Link copied to clipboard

Returns border color of the highlighted search result. This defaults to R.color.pspdf__border_color_highlight.

Link copied to clipboard

Returns border width of the highlighted search result. This defaults to R.dimen.pspdf__search_result_border_width.

Link copied to clipboard

Returns ratio between corner radius of the search result rectangle and its height. This defaults to 0.1f.

Link copied to clipboard

Returns maximal corner radius of the highlighted search result. This defaults to R.dimen.pspdf__search_result_max_corner_radius.

Link copied to clipboard

Returns minimal corner radius of the highlighted search result. This defaults to R.dimen.pspdf__search_result_min_corner_radius.

Link copied to clipboard

Returns padding of the the highlighted search result used when highlighting document text. This defaults to R.dimen.pspdf__search_result_padding.

Link copied to clipboard
fun setSearchResultAnimationPadding(@IntRange(from = 0) searchResultAnimationPadding: Int)

Sets padding of the highlighted search result used when pop-out animating the currently selected search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultAnnotationPadding(@IntRange(from = 0) searchResultAnnotationPadding: Int)

Sets padding of the highlighted search result used when highlighting annotations. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultBackgroundColor(@ColorInt searchResultBackgroundColor: Int)

Sets color of the highlighted search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultBorderColor(@ColorInt searchResultBorderColor: Int)

Sets border color of the highlighted search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultBorderWidth(@IntRange(from = 0) searchResultBorderWidth: Int)

Sets border width of the highlighted search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultCornerRadiusToHeightRatio(@FloatRange(from = 0.0) searchResultCornerRadiusToHeightRatio: Float)

Sets ratio between corner radius of the search result rectangle and its height. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultMaxCornerRadius(@IntRange(from = 0) searchResultMaxCornerRadius: Int)

Sets maximal corner radius of the highlighted search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultMinCornerRadius(@IntRange(from = 0) searchResultMinCornerRadius: Int)

Sets minimal corner radius of the highlighted search result. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard
fun setSearchResultPadding(@IntRange(from = 0) searchResultPadding: Int)

Sets padding of the the highlighted search result used when highlighting document text. Once you've set this property, you need to call getDrawablesForPage in order to get search highlight drawables with latest properties applied.

Link copied to clipboard

Sets new search results. Calling this will replace any previously set search results and also clear the currently selected search result.

Link copied to clipboard
fun setSelectedSearchResult(newSelectedSearchResult: SearchResult?)

Marks a single search results as selected, deselecting any previously selected search result. Callers must ensure that the selected search results has been set previously using setSearchResults or an exception will be thrown.