Class PdfSearchViewModular
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,com.pspdfkit.listeners.DocumentListener
,com.pspdfkit.ui.PSPDFKitViews.PSPDFView
,com.pspdfkit.ui.search.PdfSearchView
public final class PdfSearchViewModular extends AbstractPdfSearchView implements PSPDFKitViews.PSPDFView
Search view sitting inside a panel that slides in above the rest of the content.
-
-
Field Summary
Fields Modifier and Type Field Description public int
backgroundColor
public int
inputFieldTextColor
public int
inputFieldHintColor
public int
inputFieldBackgroundColor
public int
separatorColor
public int
listSelector
public int
listItemBackgroundColor
public int
listItemTitleColor
public int
listItemSubtitleColor
public int
highlightBackgroundColor
public int
highlightTextColor
public int
highlightBorderColor
public boolean
isDisplayed
-
Constructor Summary
Constructors Constructor Description PdfSearchViewModular(Context context)
PdfSearchViewModular(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description int
getBackgroundColor()
Returns background color of the modular search view. void
setBackgroundColor(@ColorInt() int backgroundColor)
Sets background color of the modular search view. int
getInputFieldTextColor()
Returns modular search input field text color. void
setInputFieldTextColor(@ColorInt() int inputFieldTextColor)
Sets modular search input field text color. int
getInputFieldHintColor()
Returns modular search input field hint text color. void
setInputFieldHintColor(@ColorInt() int inputFieldHintColor)
Sets modular search input field hint text color. int
getInputFieldBackgroundColor()
Returns modular search input field background color. void
setInputFieldBackgroundColor(@ColorInt() int inputFieldBackgroundColor)
Sets modular search input field background color. int
getSeparatorColor()
Returns the input field separator color. void
setSeparatorColor(@ColorInt() int separatorColor)
Sets the input field separator color. int
getListSelector()
Returns the list item selector. void
setListSelector(@DrawableRes() int listSelector)
Sets the list item selector. int
getListItemBackgroundColor()
Returns the background color of the list items. void
getListItemBackgroundColor(@ColorInt() int listItemBackgroundColor)
Sets the background color of the list items. int
getListItemTitleColor()
Returns the title color of the list items. void
setListItemTitleColor(@ColorInt() int listItemTitleColor)
Sets the title color of the list items. int
getListItemSubtitleColor()
Returns the text color of the list item subtitle. void
setListItemSubtitleColor(@ColorInt() int listItemSubtitleColor)
Sets the text color of the list item subtitle. int
getHighlightBackgroundColor()
Returns the background color of the highlighted search result. void
setHighlightBackgroundColor(@ColorInt() int highlightBackgroundColor)
Sets the background color of the highlighted search result. int
getHighlightTextColor()
Returns the text color of the highlighted search result. void
setHighlightTextColor(@ColorInt() int highlightTextColor)
Sets the text color of the highlighted search result. int
getHighlightBorderColor()
Returns the border color of the highlighted search result. void
setHighlightBorderColor(@ColorInt() int highlightBorderColor)
Sets the border color of the highlighted search result. boolean
isDisplayed()
Called when the activity needs to know the visibility of this view. void
onSearchStarted(@NonNull() String query)
Called when a fresh search has been started. void
onMoreSearchResults(@NonNull() List<SearchResult> results)
Called when another chunk of search results is ready. void
onSearchComplete()
Called when searching has finished. void
onSearchError(@NonNull() Throwable ex)
Called in case of an error that prevented searching the document. void
onSearchCanceled()
Called when search has been cancelled. boolean
onTouchEvent(@NonNull() MotionEvent event)
boolean
performClick()
void
show()
Shows the modular search view. void
hide()
Hides the modular search view. boolean
isIdle()
void
setShowPageLabels(boolean showPageLabels)
-
-
Constructor Detail
-
PdfSearchViewModular
PdfSearchViewModular(Context context)
-
PdfSearchViewModular
PdfSearchViewModular(Context context, AttributeSet attrs)
-
-
Method Detail
-
getBackgroundColor
@ColorInt() int getBackgroundColor()
Returns background color of the modular search view.
- Returns:
Modular search view background color.
-
setBackgroundColor
void setBackgroundColor(@ColorInt() int backgroundColor)
Sets background color of the modular search view.
- Parameters:
backgroundColor
- Modular search view background color.
-
getInputFieldTextColor
@ColorInt() int getInputFieldTextColor()
Returns modular search input field text color.
- Returns:
Text color of the input field.
-
setInputFieldTextColor
void setInputFieldTextColor(@ColorInt() int inputFieldTextColor)
Sets modular search input field text color.
- Parameters:
inputFieldTextColor
- Text color of the input field.
-
getInputFieldHintColor
@ColorInt() int getInputFieldHintColor()
Returns modular search input field hint text color.
- Returns:
Hint text color of the input field.
-
setInputFieldHintColor
void setInputFieldHintColor(@ColorInt() int inputFieldHintColor)
Sets modular search input field hint text color.
- Parameters:
inputFieldHintColor
- Hint text color of the input field.
-
getInputFieldBackgroundColor
@ColorInt() int getInputFieldBackgroundColor()
Returns modular search input field background color.
- Returns:
Background color of the search input field.
-
setInputFieldBackgroundColor
void setInputFieldBackgroundColor(@ColorInt() int inputFieldBackgroundColor)
Sets modular search input field background color.
- Parameters:
inputFieldBackgroundColor
- Background color of the search input field.
-
getSeparatorColor
@ColorInt() int getSeparatorColor()
Returns the input field separator color.
- Returns:
Color of the horizontal line separator below the input field.
-
setSeparatorColor
void setSeparatorColor(@ColorInt() int separatorColor)
Sets the input field separator color.
- Parameters:
separatorColor
- Color of the horizontal line separator below the input field.
-
getListSelector
@DrawableRes() int getListSelector()
Returns the list item selector.
- Returns:
Search result list item selector.
-
setListSelector
void setListSelector(@DrawableRes() int listSelector)
Sets the list item selector.
- Parameters:
listSelector
- Search result list item selector.
-
getListItemBackgroundColor
@ColorInt() int getListItemBackgroundColor()
Returns the background color of the list items.
- Returns:
Background color of the list items.
-
getListItemBackgroundColor
void getListItemBackgroundColor(@ColorInt() int listItemBackgroundColor)
Sets the background color of the list items.
- Parameters:
listItemBackgroundColor
- Background color of the list items.
-
getListItemTitleColor
@ColorInt() int getListItemTitleColor()
Returns the title color of the list items.
- Returns:
Text color of the list item title (page number).
-
setListItemTitleColor
void setListItemTitleColor(@ColorInt() int listItemTitleColor)
Sets the title color of the list items.
- Parameters:
listItemTitleColor
- Text color of the list item title (page number).
-
getListItemSubtitleColor
@ColorInt() int getListItemSubtitleColor()
Returns the text color of the list item subtitle.
- Returns:
Text color of the list item subtitle (search snippet).
-
setListItemSubtitleColor
void setListItemSubtitleColor(@ColorInt() int listItemSubtitleColor)
Sets the text color of the list item subtitle.
- Parameters:
listItemSubtitleColor
- Text color of the list item subtitle (search snippet).
-
getHighlightBackgroundColor
@ColorInt() int getHighlightBackgroundColor()
Returns the background color of the highlighted search result.
- Returns:
Highlighted search result background color.
-
setHighlightBackgroundColor
void setHighlightBackgroundColor(@ColorInt() int highlightBackgroundColor)
Sets the background color of the highlighted search result.
- Parameters:
highlightBackgroundColor
- Highlighted search result background color.
-
getHighlightTextColor
@ColorInt() int getHighlightTextColor()
Returns the text color of the highlighted search result.
- Returns:
Highlighted search result text color.
-
setHighlightTextColor
void setHighlightTextColor(@ColorInt() int highlightTextColor)
Sets the text color of the highlighted search result.
- Parameters:
highlightTextColor
- Highlighted search result text color.
-
getHighlightBorderColor
@ColorInt() int getHighlightBorderColor()
Returns the border color of the highlighted search result.
- Returns:
Border color of the highlighted search result.
-
setHighlightBorderColor
void setHighlightBorderColor(@ColorInt() int highlightBorderColor)
Sets the border color of the highlighted search result.
- Parameters:
highlightBorderColor
- Border color of the highlighted search result.
-
isDisplayed
boolean isDisplayed()
Called when the activity needs to know the visibility of this view. Returns
true
if this view is visible, otherwise returnsfalse
.
-
onSearchStarted
void onSearchStarted(@NonNull() String query)
Called when a fresh search has been started.
- Parameters:
query
- Search term.
-
onMoreSearchResults
void onMoreSearchResults(@NonNull() List<SearchResult> results)
Called when another chunk of search results is ready.
- Parameters:
results
- List of search results.
-
onSearchComplete
void onSearchComplete()
Called when searching has finished.
-
onSearchError
void onSearchError(@NonNull() Throwable ex)
Called in case of an error that prevented searching the document.
- Parameters:
ex
- Throwable containing the search error reason.
-
onSearchCanceled
void onSearchCanceled()
Called when search has been cancelled.
-
onTouchEvent
boolean onTouchEvent(@NonNull() MotionEvent event)
-
performClick
boolean performClick()
-
show
void show()
Shows the modular search view.
-
hide
void hide()
Hides the modular search view.
-
isIdle
boolean isIdle()
-
setShowPageLabels
void setShowPageLabels(boolean showPageLabels)
-
-
-
-