Class PdfSearchViewInline
-
- 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 PdfSearchViewInline extends AbstractPdfSearchView implements PSPDFKitViews.PSPDFView
Search view to be placed in the action bar of a AppCompatActivity.
-
-
Field Summary
Fields Modifier and Type Field Description public final static int
INLINE_SEARCH_SHOW_DELAY
public int
prevIconColorTint
public int
nextIconColorTint
public int
backIconColorTint
public int
prevIcon
public int
nextIcon
public boolean
isDisplayed
-
Constructor Summary
Constructors Constructor Description PdfSearchViewInline(Context context)
PdfSearchViewInline(Context context, AttributeSet attrs)
-
Method Summary
Modifier and Type Method Description int
getPrevIconColorTint()
Returns the icon color for the previous search result icon. void
setPrevIconColorTint(@ColorInt() int prevIconColorTint)
Sets the icon color for the previous search result icon. int
getNextIconColorTint()
Returns the icon color for the next search result icon. void
setNextIconColorTint(@ColorInt() int nextIconColorTint)
Sets the icon color for the next search result icon. int
getBackIconColorTint()
Returns the icon color for the back icon. void
setBackIconColorTint(@ColorInt() int backIconColorTint)
Sets the icon color for the back icon. int
getPrevIcon()
Returns previous search result button icon. void
setPrevIcon(@DrawableRes() int prevIcon)
Sets previous search result button icon. int
getNextIcon()
Returns next search result button icon. void
setNextIcon(@DrawableRes() int nextIcon)
Sets next search result button icon. 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. int
getTextColor()
Returns text color for the inline search text input field. void
setTextColor(@ColorInt() int textColor)
Sets text color for the inline search text input field. int
getHintTextColor()
Returns hint text color for the inline search text input field. void
setHintTextColor(@ColorInt() int hintTextColor)
Sets hint text color for the inline search text input field. int
getNavigationTextColor()
Returns the text color for the navigation text (that states the current displayed result). void
setNavigationTextColor(@ColorInt() int navigationTextColor)
Sets the text color for the navigation text (that states the current displayed result). void
show()
Shows the view in the parent. void
hide()
Hides the view in the parent. boolean
onTouchEvent(@NonNull() MotionEvent event)
boolean
performClick()
boolean
isIdle()
-
-
Constructor Detail
-
PdfSearchViewInline
PdfSearchViewInline(Context context)
-
PdfSearchViewInline
PdfSearchViewInline(Context context, AttributeSet attrs)
-
-
Method Detail
-
getPrevIconColorTint
@ColorInt() int getPrevIconColorTint()
Returns the icon color for the previous search result icon.
- Returns:
Tint color for the previous search result icon.
-
setPrevIconColorTint
void setPrevIconColorTint(@ColorInt() int prevIconColorTint)
Sets the icon color for the previous search result icon.
- Parameters:
prevIconColorTint
- Tint color for the previous search result icon.
-
getNextIconColorTint
@ColorInt() int getNextIconColorTint()
Returns the icon color for the next search result icon.
- Returns:
Tint color for the next search result icon.
-
setNextIconColorTint
void setNextIconColorTint(@ColorInt() int nextIconColorTint)
Sets the icon color for the next search result icon.
- Parameters:
nextIconColorTint
- Tint color for the next search result icon.
-
getBackIconColorTint
@ColorInt() int getBackIconColorTint()
Returns the icon color for the back icon.
- Returns:
Tint color for the back icon.
-
setBackIconColorTint
void setBackIconColorTint(@ColorInt() int backIconColorTint)
Sets the icon color for the back icon.
- Parameters:
backIconColorTint
- Tint color for the back icon.
-
getPrevIcon
@DrawableRes() int getPrevIcon()
Returns previous search result button icon.
- Returns:
Previous search result button resource drawable.
-
setPrevIcon
void setPrevIcon(@DrawableRes() int prevIcon)
Sets previous search result button icon.
- Parameters:
prevIcon
- Previous search result button resource drawable.
-
getNextIcon
@DrawableRes() int getNextIcon()
Returns next search result button icon.
- Returns:
Next search result button resource drawable.
-
setNextIcon
void setNextIcon(@DrawableRes() int nextIcon)
Sets next search result button icon.
- Parameters:
nextIcon
- Next search result button resource drawable.
-
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.
-
getTextColor
@ColorInt() int getTextColor()
Returns text color for the inline search text input field.
- Returns:
Input field text color.
-
setTextColor
void setTextColor(@ColorInt() int textColor)
Sets text color for the inline search text input field.
- Parameters:
textColor
- Input field text color.
-
getHintTextColor
@ColorInt() int getHintTextColor()
Returns hint text color for the inline search text input field.
- Returns:
Input field hint text color.
-
setHintTextColor
void setHintTextColor(@ColorInt() int hintTextColor)
Sets hint text color for the inline search text input field.
- Parameters:
hintTextColor
- Input field hint text color.
-
getNavigationTextColor
@ColorInt() int getNavigationTextColor()
Returns the text color for the navigation text (that states the current displayed result).
- Returns:
Text color for the navigation text.
-
setNavigationTextColor
void setNavigationTextColor(@ColorInt() int navigationTextColor)
Sets the text color for the navigation text (that states the current displayed result).
- Parameters:
navigationTextColor
- Text color for the navigation text.
-
show
void show()
Shows the view in the parent.
-
hide
void hide()
Hides the view in the parent.
-
onTouchEvent
boolean onTouchEvent(@NonNull() MotionEvent event)
-
performClick
boolean performClick()
-
isIdle
boolean isIdle()
-
-
-
-