Class PropertyInspectorCoordinatorLayout
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
,androidx.core.view.NestedScrollingParent
,androidx.core.view.NestedScrollingParent2
,androidx.core.view.NestedScrollingParent3
,com.pspdfkit.ui.inspector.PropertyInspectorCoordinatorLayoutController
public class PropertyInspectorCoordinatorLayout extends CoordinatorLayout implements PropertyInspectorCoordinatorLayoutController
This layout is responsible for handling PropertyInspectors. It is used in , but it can be added to any view group, for example to the root view of the custom activity.
PSPDFKit ships with property inspector controllers that manage property inspector lifecycle for built in inspectors:
- AnnotationCreationInspectorController - manages annotation properties inspector in annotation creation mode
- AnnotationEditingInspectorController - manages annotation properties inspector in annotation editing mode
- FormEditingInspectorController - manages bottom sheet displayed when filling choice form elements
We recommend to use these controllers instead of manually managing your UI.
-
-
Constructor Summary
Constructors Constructor Description PropertyInspectorCoordinatorLayout(Context context)
PropertyInspectorCoordinatorLayout(Context context, AttributeSet attrs)
PropertyInspectorCoordinatorLayout(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description boolean
showInspector(@NonNull() PropertyInspector propertyInspector, boolean animate)
Displays property inspector. boolean
hideInspector(boolean animate)
Removes active inspector if visible. boolean
isInspectorVisible(@NonNull() PropertyInspector inspector)
Tests if inspector
is currently active in coordinator.boolean
isInspectorVisible()
Tests if coordinator has any active inspector currently visible. void
setDrawUnderBottomInset(boolean showInspectorViewsUnderBottomInset)
Controls whether inspector contents are drawn under bottom insets (system or set via setBottomInset. void
addPropertyInspectorLifecycleListener(@NonNull() PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener)
Adds the listener for lifecycle changes of the PropertyInspector as it goes through the PropertyInspectorCoordinatorLayout - preparing, displaying, removing. void
removePropertyInspectorLifecycleListener(@NonNull() PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener)
Removes previously registered listener for lifecycle changes of the PropertyInspector as it goes through the PropertyInspectorCoordinatorLayout - preparing, displaying, removing. void
onDetachedFromWindow()
void
setFitsSystemWindows(boolean fitSystemWindows)
void
setBottomInset(int bottomInset)
Sets bottom inset for displayed PropertyInspectors. -
-
Constructor Detail
-
PropertyInspectorCoordinatorLayout
PropertyInspectorCoordinatorLayout(Context context)
-
PropertyInspectorCoordinatorLayout
PropertyInspectorCoordinatorLayout(Context context, AttributeSet attrs)
-
PropertyInspectorCoordinatorLayout
PropertyInspectorCoordinatorLayout(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
showInspector
@UiThread() boolean showInspector(@NonNull() PropertyInspector propertyInspector, boolean animate)
Displays property inspector. This replaces previous displayed inspector.
- Parameters:
propertyInspector
- Inspector instance to show.animate
- Whether to animate the change.- Returns:
True if inspector was hidden and is now visible, false if it was already visible.
-
hideInspector
@UiThread() boolean hideInspector(boolean animate)
Removes active inspector if visible.
- Parameters:
animate
- Whether to animate the change.- Returns:
True if inspector was visible and is now hidden, false if it was already hidden.
-
isInspectorVisible
boolean isInspectorVisible(@NonNull() PropertyInspector inspector)
Tests if
inspector
is currently active in coordinator.- Parameters:
inspector
- Inspector instance.- Returns:
True if
inspector
is currently active in coordinator layout.
-
isInspectorVisible
boolean isInspectorVisible()
Tests if coordinator has any active inspector currently visible.
- Returns:
True if there is inspector visible.
-
setDrawUnderBottomInset
void setDrawUnderBottomInset(boolean showInspectorViewsUnderBottomInset)
Controls whether inspector contents are drawn under bottom insets (system or set via setBottomInset.
- Parameters:
showInspectorViewsUnderBottomInset
-true
when inspector should be visible under bottom insets.
-
addPropertyInspectorLifecycleListener
void addPropertyInspectorLifecycleListener(@NonNull() PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener)
Adds the listener for lifecycle changes of the PropertyInspector as it goes through the PropertyInspectorCoordinatorLayout - preparing, displaying, removing. If the listener has already been added previously, this method will be a no-op. Adding
null
is not allowed, and will result in an exception.- Parameters:
lifecycleListener
- PropertyInspectorLifecycleListener that should be notified.
-
removePropertyInspectorLifecycleListener
void removePropertyInspectorLifecycleListener(@NonNull() PropertyInspectorCoordinatorLayoutController.PropertyInspectorLifecycleListener lifecycleListener)
Removes previously registered listener for lifecycle changes of the PropertyInspector as it goes through the PropertyInspectorCoordinatorLayout - preparing, displaying, removing. Upon calling this method the
listener
will no longer be notified of any changes. If the listener has not been added, this method will be a no-op. Addingnull
is not allowed,and will result in an exception.- Parameters:
lifecycleListener
- PropertyInspectorLifecycleListener that should be removed.
-
onDetachedFromWindow
void onDetachedFromWindow()
-
setFitsSystemWindows
void setFitsSystemWindows(boolean fitSystemWindows)
-
setBottomInset
void setBottomInset(int bottomInset)
Sets bottom inset for displayed PropertyInspectors. This will be added on top of standard immersive mode insets.
-
-
-
-