---
title: "Using property inspectors within PdfFragment | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/customizing-the-interface/using-inspectors-within-fragment/"
md_url: "https://www.nutrient.io/guides/android/customizing-the-interface/using-inspectors-within-fragment.md"
last_updated: "2026-06-08T16:26:43.981Z"
description: "Learn to integrate property inspectors into your PdfFragment, enabling efficient editing of object properties with customizable views in your application."
---

# Using property inspectors within PdfFragment

The property inspector is a general purpose PSPDFKit UI component that allows editing of object properties. [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) already integrates property inspectors for editing annotation and form properties out of the box. The annotation inspector is displayed when a user selects the annotation properties picker from the annotation creation toolbar or the popup toolbar. The form inspector is displayed when a user starts editing choice form fields.

This article introduces the property inspector API and shows how to integrate existing property inspectors as standalone views and connect them with corresponding special modes in your custom activities built around [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html).

This article assumes you’re familiar with the concept of [special modes](https://www.nutrient.io/../../customizing-the-interface/using-toolbars-within-fragment/#special-modes).

## Property inspector

[`PropertyInspector`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector/index.html) is a [`ViewGroup`](https://developer.android.com/reference/android/view/ViewGroup.html) that displays multiple [`PropertyInspectorView`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector-view/index.html)s in a vertical list. PSPDFKit ships with a comprehensive set of inspector views.

By default, PSPDFKit displays property inspectors in a bottom sheet, and a single instance of [`PropertyInspectorCoordinatorLayout`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector-coordinator-layout/index.html) is used in [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) to coordinate the display of the inspectors. Each property inspector has its own controller that manages its lifecycle. These controllers are generally tied to [`PropertyInspectorCoordinatorLayout`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector-coordinator-layout/index.html) and wrap the complete lifecycle of a single property inspector. When a document enters a [special mode](https://www.nutrient.io/../../customizing-the-interface/using-toolbars-within-fragment/#special-modes), we wire up the required property inspector controller with the corresponding special mode controller inside [`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html). When using [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html), you can implement these controllers to handle your own property inspector lifecycle or use the default inspector controllers provided by the framework.

Currently, PSPDFKit ships with the following inspector controllers:

- [`AnnotatingInspectorController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector.annotation/-annotating-inspector-controller/index.html) manages the annotation inspector in annotation mode (both creation and editing). It must be bound to [`AnnotatingController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-annotating-controller/index.html) after entering annotation mode. The default implementation is provided by [`DefaultAnnotatingInspectorController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector.annotation/-default-annotating-inspector-controller/index.html).

- [`FormEditingInspectorController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector.forms/-form-editing-inspector-controller/index.html) manages the form editing inspector for filling the choice form fields ([`ComboBoxFormElement`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.forms/-combo-box-form-element/index.html) and [`ListBoxFormElement`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.forms/-list-box-form-element/index.html)). It must be bound to [`FormEditingController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-form-editing-controller/index.html) after entering form editing mode.

## Manual integration of property inspectors

For adding property inspectors to your custom activity built around [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html), you need to manually add [`PropertyInspectorCoordinatorLayout`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector-coordinator-layout/index.html) to a view wrapping the [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html):

```xml

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             xmlns:tools="http://schemas.android.com/tools"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             tools:context=".examples.activities.ToolbarsInFragmentActivity"
             tools:ignore="UnusedAttribute">

    <FrameLayout
        android:id="@+id/fragmentContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <com.pspdfkit.ui.inspector.PropertyInspectorCoordinatorLayout
        android:id="@+id/inspectorCoordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="16dp" />

</FrameLayout>

```

Here’s a simple layout containing one [`FrameLayout`](https://developer.android.com/reference/android/widget/FrameLayout.html) serving as a fragment placeholder, with a [`PropertyInspectorCoordinatorLayout`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.inspector/-property-inspector-coordinator-layout/index.html) on top of it.

Special mode controllers are retrieved from mode change listeners registered on the [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html). In your activity, you can register a listener to a fragment and then bind the controller to the previously created property inspector controller:

### MYACTIVITY.KT

```kt

class MyActivity : AppCompatActivity(), OnAnnotatingModeChangeListener {
    private lateinit var inspectorCoordinatorLayout: PropertyInspectorCoordinatorLayout
    private lateinit var annotatingInspectorController: AnnotatingInspectorController
    private lateinit var fragment: PdfFragment

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_annotation_toolbar_fragment)

        inspectorCoordinatorLayout = findViewById(R.id.inspectorCoordinatorLayout)
        annotatingInspectorController = DefaultAnnotatingInspectorController(this, inspectorCoordinatorLayout)

        //... Init fragment here...

        // Register a listener for special mode changes.
        fragment.addOnAnnotatingModeChangeListener(this)
    }

    override fun onEnterAnnotatingMode(controller: AnnotatingController) {
        // Bind the inspector controller to the annotation mode controller.
        annotatingInspectorController.bindController(controller)
    }

    override fun onChangeAnnotatingMode(controller: AnnotatingController) {
        // Nothing to be done here. The inspector controller will automatically pick annotation controller changes.
    }

    override fun onExitAnnotatingMode(controller: AnnotatingController) {
        // Unbind the annotation controller from the inspector controller.
        annotatingInspectorController.unbindController()
    }
}

```

### MYACTIVITY.JAVA

```java

class MyActivity extends AppCompatActivity implements OnAnnotatingModeChangeListener {
    private PropertyInspectorCoordinatorLayout inspectorCoordinatorLayout;
    private AnnotatingInspectorController annotatingInspectorController;
    private PdfFragment fragment;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_annotaton_toolbar_fragment);

        inspectorCoordinatorLayout = findViewById(R.id.inspectorCoordinatorLayout);
        annotatingInspectorController = new DefaultAnnotatingInspectorController(this, inspectorCoordinatorLayout);

        //... Init fragment here...

        // Register a listener for special mode changes.
        fragment.addOnAnnotatingModeChangeListener(this);
    }

    @Override
    public void onEnterAnnotatingMode(@NonNull AnnotatingController controller) {
        // Bind the inspector controller to the annotation mode controller.
        annotatingInspectorController.bindController(controller);
    }

    @Override
    public void onChangeAnnotatingMode(@NonNull AnnotatingController controller) {
        // Nothing to be done here. The inspector controller will automatically pick annotation controller changes.
    }

    @Override
    public void onExitAnnotatingMode(@NonNull AnnotatingController controller) {
        // Unbind the annotation controller from the inspector controller.
        annotatingInspectorController.unbindController();
    }
}

```

This implementation will only get you the annotation creation inspector without toolbars. See the entirety of `ToolbarsInFragmentExample` for information on how to integrate other inspectors and toolbars. For an example of how to integrate the form editing inspector, take a look at `FormEditingInFragmentExample` in our Catalog app.

You can use [`AnnotatingController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-annotating-controller/index.html) methods to control your annotation inspector in your custom UI, even without toolbars. Use [`toggleAnnotationInspector()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-annotating-controller/toggle-annotation-inspector.html) to toggle the display of the annotation inspector and [`shouldDisplayPicker()`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-annotating-controller/should-display-picker.html) to find out whether or not the annotation inspector is enabled for the active annotation tool.
---

## Related pages

- [Enabling the form inspector on Android](/guides/android/user-interface/property-inspectors/form-inspector.md)
- [Enabling the annotation inspector on Android](/guides/android/annotations/annotation-inspector.md)

