java.lang.Object | ||
↳ | com.pspdfkit.ui.drawable.PdfDrawableProvider | |
↳ | com.pspdfkit.ui.search.SearchResultHighlighter |
PdfDrawableProvider
creating highlights based on a list of SearchResult
instances.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SearchResultHighlighter(Context context)
Creates the search result highlighter.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
synchronized void |
addSearchResults(List<SearchResult> results)
Adds the given
results to the set of previously added results. | ||||||||||
synchronized void |
clearSearchResults()
Clears all previously selected search results.
| ||||||||||
synchronized List<PdfDrawable> |
getDrawablesForPage(Context context, PdfDocument document, int pageIndex)
Returns all drawables for the given
document and pageIndex . | ||||||||||
synchronized int |
getSearchResultAnimationPadding()
Returns padding of the highlighted search result used when pop-out animating the currently
selected search result.
| ||||||||||
synchronized int |
getSearchResultAnnotationPadding()
Returns padding of the highlighted search result used when highlighting annotations.
| ||||||||||
synchronized int |
getSearchResultBackgroundColor()
Returns color of the highlighted search result.
| ||||||||||
synchronized int |
getSearchResultBorderColor()
Returns border color of the highlighted search result.
| ||||||||||
synchronized int |
getSearchResultBorderWidth()
Returns border width of the highlighted search result.
| ||||||||||
synchronized float |
getSearchResultCornerRadiusToHeightRatio()
Returns ratio between corner radius of the search result rectangle and its height.
| ||||||||||
synchronized int |
getSearchResultMaxCornerRadius()
Returns maximal corner radius of the highlighted search result.
| ||||||||||
synchronized int |
getSearchResultMinCornerRadius()
Returns minimal corner radius of the highlighted search result.
| ||||||||||
synchronized int |
getSearchResultPadding()
Returns padding of the the highlighted search result used when highlighting document text.
| ||||||||||
synchronized void |
setSearchResultAnimationPadding(int searchResultAnimationPadding)
Sets padding of the highlighted search result used when pop-out animating the currently
selected search result.
| ||||||||||
synchronized void |
setSearchResultAnnotationPadding(int searchResultAnnotationPadding)
Sets padding of the highlighted search result used when highlighting annotations.
| ||||||||||
synchronized void |
setSearchResultBackgroundColor(int searchResultBackgroundColor)
Sets color of the highlighted search result.
| ||||||||||
synchronized void |
setSearchResultBorderColor(int searchResultBorderColor)
Sets border color of the highlighted search result.
| ||||||||||
synchronized void |
setSearchResultBorderWidth(int searchResultBorderWidth)
Sets border width of the highlighted search result.
| ||||||||||
synchronized void |
setSearchResultCornerRadiusToHeightRatio(float searchResultCornerRadiusToHeightRatio)
Sets ratio between corner radius of the search result rectangle and its height.
| ||||||||||
synchronized void |
setSearchResultMaxCornerRadius(int searchResultMaxCornerRadius)
Sets maximal corner radius of the highlighted search result.
| ||||||||||
synchronized void |
setSearchResultMinCornerRadius(int searchResultMinCornerRadius)
Sets minimal corner radius of the highlighted search result.
| ||||||||||
synchronized void |
setSearchResultPadding(int searchResultPadding)
Sets padding of the the highlighted search result used when highlighting document text.
| ||||||||||
synchronized void |
setSearchResults(List<SearchResult> results)
Sets new search results.
| ||||||||||
synchronized void |
setSelectedSearchResult(SearchResult newSelectedSearchResult)
Marks a single search results as selected, deselecting any previously selected search result.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates the search result highlighter.
context | Context used for pulling theme attributes set for the search result highlights. |
---|
Adds the given results
to the set of previously added results. In contrast to setSearchResults(List)
a call to this will not clear previously set results. Also any
previously selected search result will not be cleared.
results | List of search results to add to highlighting. |
---|
Clears all previously selected search results.
Returns all drawables for the given document
and pageIndex
. The framework may
call this method on any thread.
context | Context for resource resolution. |
---|---|
document | The currently loaded PdfDocument . |
pageIndex | Number of the page for which the drawables should be returned. |
Returns padding of the highlighted search result used when pop-out animating the currently
selected search result. This defaults to pspdf__search_result_animation_padding
.
Returns padding of the highlighted search result used when highlighting annotations. This
defaults to pspdf__search_result_annotation_padding
.
Returns color of the highlighted search result. This defaults to R.color#pspdf__color_highlight
.
Returns border color of the highlighted search result. This defaults to R.color#pspdf__border_color_highlight
.
Returns border width of the highlighted search result. This defaults to R.dimen#pspdf__search_result_border_width
.
Returns ratio between corner radius of the search result rectangle and its height. This
defaults to 0.1f
.
Returns maximal corner radius of the highlighted search result. This defaults to pspdf__search_result_max_corner_radius
.
Returns minimal corner radius of the highlighted search result. This defaults to pspdf__search_result_min_corner_radius
.
Returns padding of the the highlighted search result used when highlighting document text.
This defaults to R.dimen#pspdf__search_result_padding
.
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(Context, PdfDocument, int)
in order to get search highlight drawables
with latest properties applied.
searchResultAnimationPadding | Padding of the highlighted search result used when pop-out animating the currently selected search result (in pixels). |
---|
Sets padding of the highlighted search result used when highlighting annotations. Once you've
set this property, you need to call getDrawablesForPage(Context, PdfDocument, int)
in order to get search highlight drawables with latest properties applied.
searchResultAnnotationPadding | Padding of the highlighted search result used for annotation results (in pixels). |
---|
Sets color of the highlighted search result. Once you've set this property, you need to call
getDrawablesForPage(Context, PdfDocument, int)
in order to get search highlight
drawables with latest properties applied.
searchResultBackgroundColor | Search result background color. |
---|
Sets border color of the highlighted search result. Once you've set this property, you need
to call getDrawablesForPage(Context, PdfDocument, int)
in order to get search
highlight drawables with latest properties applied.
searchResultBorderColor | Search result border color. |
---|
Sets border width of the highlighted search result. Once you've set this property, you need
to call getDrawablesForPage(Context, PdfDocument, int)
in order to get search
highlight drawables with latest properties applied.
searchResultBorderWidth | Search result rectangle border width (in pixels). |
---|
Sets ratio between corner radius of the search result rectangle and its height. Once you've
set this property, you need to call getDrawablesForPage(Context, PdfDocument, int)
in order to get search highlight drawables with latest properties applied.
searchResultCornerRadiusToHeightRatio | Search result corner radius to search result height ratio. |
---|
Sets maximal corner radius of the highlighted search result. Once you've set this property,
you need to call getDrawablesForPage(Context, PdfDocument, int)
in order to get
search highlight drawables with latest properties applied.
searchResultMaxCornerRadius | Maximal corner radius (in pixels). |
---|
Sets minimal corner radius of the highlighted search result. Once you've set this property,
you need to call getDrawablesForPage(Context, PdfDocument, int)
in order to get
search highlight drawables with latest properties applied.
searchResultMinCornerRadius | Minimal corner radius (in pixels). |
---|
Sets padding of the the highlighted search result used when highlighting document text. Once
you've set this property, you need to call getDrawablesForPage(Context, PdfDocument, int)
in order to get search highlight drawables with latest properties applied.
searchResultPadding | Padding of the highlighted search result used for text results (in pixels). |
---|
Sets new search results. Calling this will replace any previously set search results and also clear the currently selected search result.
results | List of search results to highlight. |
---|
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(List)
or an exception will be thrown.
newSelectedSearchResult | A search result that should be highlighted as selected. |
---|