public class

PropertyInspector

extends ViewGroup
implements View.OnClickListener BottomSheetContentViewInterface PropertyInspectorController
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.pspdfkit.ui.inspector.PropertyInspector

Class Overview

Top level layout of the generic properties inspector. Contains title and scrollable list of PropertyInspectorView.

Summary

Nested Classes
class PropertyInspector.ItemDecoration An ItemDecoration allows the application to add custom drawing to specific inspector views. 
interface PropertyInspector.OnCancelListener Listener for inspector cancellation. 
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
PropertyInspector(Context context)
Construct inspector layout.
Public Methods
void addInspectorView(PropertyInspectorView inspectorView, int location)
Add new view to inspector layout.
void addInspectorView(PropertyInspectorView inspectorView)
Add new view to inspector layout.
void addItemDecoration(PropertyInspector.ItemDecoration decoration)
Adds an PropertyInspector.ItemDecoration to this inspector.
void cancel()
Request cancellation of the inspector.
boolean dispatchKeyEvent(KeyEvent event)
Custom back key handling to implement navigation from detail view.
void ensureFullyVisible(PropertyInspectorView inspectorView)
Scrolls to inspector view when its not fully visible in property inspector.
PropertyInspectorView getInspectorView(int location)
Retrieve PropertyInspectorView at specified location.
int getInspectorViewCount()
Returns the number of PropertyInspectorViews inside inspector.
int getMaximumHeight()
int getMinimumHeight()
int getSuggestedHeight()
View getVisibleDetailView()
Retrieve detail view that is currently visible in the property inspector.
void hideDetailView(boolean animate)
int indexOfInspectorView(PropertyInspectorView inspectorView)
Find index of specified inspector view.
boolean isCancelOnTouchOutside()
boolean isResizable()
Check whether property inspector wants to be resizable.
void onClick(View view)
void onRestoreInstanceState(Parcelable state)
Parcelable onSaveInstanceState()
void removeAllInspectorViews()
Removes all inspector views from inspector.
void removeAllItemDecorations()
Removes all PropertyInspector.ItemDecorations from this inspector.
void removeInspectorView(PropertyInspectorView inspectorView)
Removes inspector view from inspector.
void removeItemDecoration(PropertyInspector.ItemDecoration decoration)
Removes an PropertyInspector.ItemDecoration from this inspector.
void reset()
Resets inspector to its initial state.
void setCancelListener(PropertyInspector.OnCancelListener cancelListener)
Set a listener to be notified of a cancellation.
void setCancelOnTouchOutside(boolean cancelOnTouchOutside)
Make inspector request PropertyInspectorCoordinatorLayout to be cancelled when touched outside its bounds.
void setInspectorViews(List<PropertyInspectorView> inspectorViews, boolean animate)
Set list of inspector views to be displayed in property inspector.
void setResizable(boolean isResizable)
Hints to parent layout that property inspector does not wish to be resizable.
void setTitle(int titleRes)
Set header title inside inspector view.
void setTitle(String title)
Set header title inside inspector view.
void setTitleBarVisible(boolean isTitleEnabled)
Controls inspector title bar visibility.
void showDetailView(View view, String title, boolean animate)
Replaces inspector contents with specific view.
Protected Methods
void dispatchRestoreInstanceState(SparseArray<Parcelable> container)
void dispatchSaveInstanceState(SparseArray<Parcelable> container)
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
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.View.OnClickListener
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource
From interface com.pspdfkit.framework.views.inspector.bottomsheet.BottomSheetContentViewInterface
From interface com.pspdfkit.ui.inspector.PropertyInspectorController

Public Constructors

public PropertyInspector (Context context)

Construct inspector layout.

Parameters
context The context.

Public Methods

public void addInspectorView (PropertyInspectorView inspectorView, int location)

Add new view to inspector layout.

Parameters
inspectorView The inspector view to add.
location The position at which to add the child or -1 to add last.

public void addInspectorView (PropertyInspectorView inspectorView)

Add new view to inspector layout.

Parameters
inspectorView The inspector view to add.

public void addItemDecoration (PropertyInspector.ItemDecoration decoration)

Adds an PropertyInspector.ItemDecoration to this inspector.

Parameters
decoration Decoration to add.

public void cancel ()

Request cancellation of the inspector.

public boolean dispatchKeyEvent (KeyEvent event)

Custom back key handling to implement navigation from detail view.

public void ensureFullyVisible (PropertyInspectorView inspectorView)

Scrolls to inspector view when its not fully visible in property inspector.

Parameters
inspectorView Property inspector view to scroll to.

public PropertyInspectorView getInspectorView (int location)

Retrieve PropertyInspectorView at specified location.

Returns
  • Inspector view at requested location.

public int getInspectorViewCount ()

Returns the number of PropertyInspectorViews inside inspector.

Returns
  • Positive number indicating number of child inspector views.

public int getMaximumHeight ()

public int getMinimumHeight ()

public int getSuggestedHeight ()

public View getVisibleDetailView ()

Retrieve detail view that is currently visible in the property inspector.

Returns
  • Visible detail view or null if no detail view is visible right now.

public void hideDetailView (boolean animate)

Hide view shown in showDetailView(View, String, boolean). This will restore previous inspector contents.

Parameters
animate True to animate transition, false to change immediately.

public int indexOfInspectorView (PropertyInspectorView inspectorView)

Find index of specified inspector view.

Returns
  • Index inside inspector views array or -1 when not found.

public boolean isCancelOnTouchOutside ()

Returns
  • True when the inspector should be cancelled when touched outside of its bounds.

public boolean isResizable ()

Check whether property inspector wants to be resizable.

Returns
  • true when property inspector wants to be resizable when shown in bottom sheet.

public void onClick (View view)

public void onRestoreInstanceState (Parcelable state)

public Parcelable onSaveInstanceState ()

public void removeAllInspectorViews ()

Removes all inspector views from inspector.

public void removeAllItemDecorations ()

Removes all PropertyInspector.ItemDecorations from this inspector.

public void removeInspectorView (PropertyInspectorView inspectorView)

Removes inspector view from inspector.

Parameters
inspectorView View to remove from inspector.

public void removeItemDecoration (PropertyInspector.ItemDecoration decoration)

Removes an PropertyInspector.ItemDecoration from this inspector.

Parameters
decoration Decoration to remove.

public void reset ()

Resets inspector to its initial state.

public void setCancelListener (PropertyInspector.OnCancelListener cancelListener)

Set a listener to be notified of a cancellation. Calling this method will replace any previously set listener. You may provide null to clear the listener.

Parameters
cancelListener PropertyInspector.OnCancelListener that should be notified, or null to clear the listener.

public void setCancelOnTouchOutside (boolean cancelOnTouchOutside)

Make inspector request PropertyInspectorCoordinatorLayout to be cancelled when touched outside its bounds.

Parameters
cancelOnTouchOutside True when inspector should be cancelled when touched outside its bounds.

public void setInspectorViews (List<PropertyInspectorView> inspectorViews, boolean animate)

Set list of inspector views to be displayed in property inspector. This replaces previously displayed views.

Parameters
inspectorViews The inspector views to display.
animate Whether to animate the change.

public void setResizable (boolean isResizable)

Hints to parent layout that property inspector does not wish to be resizable.

Parameters
isResizable True when inspector should be resized when dragging.

public void setTitle (int titleRes)

Set header title inside inspector view.

public void setTitle (String title)

Set header title inside inspector view.

public void setTitleBarVisible (boolean isTitleEnabled)

Controls inspector title bar visibility.

Parameters
isTitleEnabled true to enable title bar, false to disable.

public void showDetailView (View view, String title, boolean animate)

Replaces inspector contents with specific view. Only single detail view can be visible at a time.

Parameters
view View to show.
title Optional inspector title that will be displayed when detail view is visible.
animate True to animate transition, false to change immediately.

Protected Methods

protected void dispatchRestoreInstanceState (SparseArray<Parcelable> container)

protected void dispatchSaveInstanceState (SparseArray<Parcelable> container)

protected void onLayout (boolean changed, int l, int t, int r, int b)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)