public class

PdfSearchViewLazy

extends DocumentListenerFrameLayout
implements PdfSearchView
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.pspdfkit.framework.views.utils.DocumentListenerFrameLayout
           ↳ com.pspdfkit.ui.search.PdfSearchViewLazy

Class Overview

Lazy implementation of the PdfSearchView interface. Initializes PdfSearchViewModular once shown or made visible.

Override createSearchView() to return different search implementation.

Summary

Nested Classes
interface PdfSearchViewLazy.OnViewReadyListener Listener notified once the lazy view is initialized. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PdfSearchViewLazy(Context context)
PdfSearchViewLazy(Context context, AttributeSet attrs)
PdfSearchViewLazy(Context context, AttributeSet attrs, int defStyleAttr)
PdfSearchViewLazy(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void addOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Register a listener that would like to receive visibility change events.
void clearDocument()
Called by the activity when the view should unbind the previously set document.
void clearSearch()
Clears the search input field as well as any previously collected search results.
PdfSearchView createSearchView()
Factory method called when the search view is being prepared for display.
PSPDFKitViews.Type getPSPDFViewType()
Returns the type of this view.
PdfSearchView getSearchView()
Returns the active search view (if initialized).
void hide()
Called by the activity when the view should hide itself.
boolean isDisplayed()
Called when the activity needs to know the visibility of this view.
boolean isShown()
void onPageChanged(PdfDocument document, int pageIndex)
Called when user scrolled to a new page.
synchronized PdfSearchView prepareForDisplay()
Prepares the lazy initialized search view for display.
void removeOnVisibilityChangedListener(OnVisibilityChangedListener listener)
Unregister a previously registered listener that no longer wants to receive visibility change events.
void setDocument(PdfDocument document, PdfConfiguration configuration)
Called when the document has been loaded and is going to be displayed.
void setInputFieldText(String text, boolean startSearch)
Inserts text in search input field and optionally starts search.
void setOnViewReadyListener(PdfSearchViewLazy.OnViewReadyListener listener)
Sets listener that will get notified once the lazy view is ready.
void setSearchConfiguration(SearchConfiguration searchConfiguration)
Sets the search configuration to this search view.
void setSearchViewListener(PdfSearchView.Listener searchViewListener)
Sets a listener to be notified of search events on this view.
void setVisibility(int visibility)
void show()
Called by the activity when the view should make itself visible.
[Expand]
Inherited Methods
From class com.pspdfkit.framework.views.utils.DocumentListenerFrameLayout
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.listeners.DocumentListener
From interface com.pspdfkit.ui.PSPDFKitViews.PSPDFView
From interface com.pspdfkit.ui.search.PdfSearchView

Public Constructors

public PdfSearchViewLazy (Context context)

public PdfSearchViewLazy (Context context, AttributeSet attrs)

public PdfSearchViewLazy (Context context, AttributeSet attrs, int defStyleAttr)

public PdfSearchViewLazy (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void addOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Register a listener that would like to receive visibility change events. Whenever the visibility of a managed PSPDFKitViews.PSPDFView changes, all registered listeners will be notified.

Parameters
listener Listener to be added.

public void clearDocument ()

Called by the activity when the view should unbind the previously set document. This may be called in low-memory situations or prior to re-binding another document.

public void clearSearch ()

Clears the search input field as well as any previously collected search results. This will also cancel any currently running search operation. Implementations of PdfSearchView need to call onSearchCleared() on the current listener.

public PdfSearchView createSearchView ()

Factory method called when the search view is being prepared for display.

Returns
  • New instance of the search view that is initialized by this lazy view.

public PSPDFKitViews.Type getPSPDFViewType ()

Returns the type of this view.

Returns

public PdfSearchView getSearchView ()

Returns the active search view (if initialized).

public void hide ()

Called by the activity when the view should hide itself.

public boolean isDisplayed ()

Called when the activity needs to know the visibility of this view. Returns true if this view is visible, otherwise returns false.

public boolean isShown ()

public void onPageChanged (PdfDocument document, int pageIndex)

Called when user scrolled to a new page.

Parameters
document Currently opened document.
pageIndex Page number of new page.

public synchronized PdfSearchView prepareForDisplay ()

Prepares the lazy initialized search view for display.

Returns

public void removeOnVisibilityChangedListener (OnVisibilityChangedListener listener)

Unregister a previously registered listener that no longer wants to receive visibility change events.

Parameters
listener Listener to be removed.

public void setDocument (PdfDocument document, PdfConfiguration configuration)

Called when the document has been loaded and is going to be displayed. This has to be called on the main thread.

Parameters
document Loaded PdfDocument.
configuration Containing document and presentation settings.

public void setInputFieldText (String text, boolean startSearch)

Inserts text in search input field and optionally starts search.

Parameters
text Search text.
startSearch Hides keyboard and starts search if true

public void setOnViewReadyListener (PdfSearchViewLazy.OnViewReadyListener listener)

Sets listener that will get notified once the lazy view is ready.

Parameters
listener Listener to register or null to unregister existing listener.

public void setSearchConfiguration (SearchConfiguration searchConfiguration)

Sets the search configuration to this search view.

Parameters
searchConfiguration Search configuration to be set for this PdfSearchView.

public void setSearchViewListener (PdfSearchView.Listener searchViewListener)

Sets a listener to be notified of search events on this view. May be null to remove any previously set listener.

Parameters
searchViewListener A Listener which should be notified of search events, or null to remove a previously registered listener.

public void setVisibility (int visibility)

public void show ()

Called by the activity when the view should make itself visible.