# Customizing the form editing toolbar on Android

[`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) includes the form editing UI out of the box. This article shows how to manually integrate the existing form editing UI into your custom activities built around [`PdfFragment`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-fragment/index.html).

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

## Form editing bar

The [`FormEditingBar`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.forms/-form-editing-bar/index.html) is a simple auxiliary view that helps with form filling. It provides buttons for navigating between form elements in tab order, clearing filled elements, and leaving form editing mode.

### Manual integration

For adding the form editing bar to your custom activity, you need to manually add [`FormEditingBar`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.forms/-form-editing-bar/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.forms.FormEditingBar
        android:id="@+id/formEditingBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom" />

</FrameLayout>

```

Here’s a simple layout containing a [`FrameLayout`](https://developer.android.com/reference/android/widget/FrameLayout.html) serving as a fragment placeholder, and a [`FormEditingBar`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.forms/-form-editing-bar/index.html) that will be displayed at the bottom of the screen or above the soft keyboard.

To display the form editing bar, you need to bind it to the [`FormEditingController`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui.special_mode.controller/-form-editing-controller/index.html) after entering form editing mode. 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 need to register a listener to a fragment and then bind the form editing controller to the previously created form editing bar:

### MYACTIVITY.KT

```kt

class MyActivity : AppCompatActivity(), OnFormElementEditingModeChangeListener {
    private lateinit var formEditingBar: FormEditingBar
    private lateinit var fragment: PdfFragment

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

        formEditingBar = findViewById(R.id.formEditingBar)

        //... Init fragment here...

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

    override fun onEnterFormElementEditingMode(controller: FormEditingController) {
        // Binding the form editing bar to the form editing controller will animate the bar into view.
        formEditingBar.bindController(controller)
    }

    override fun onChangeFormElementEditingMode(controller: FormEditingController) {
        // Nothing to be done here. The bound form editing bar will pick up the changes.
    }

    override fun onExitFormElementEditingMode(controller: FormEditingController) {
        // Unbind the form editing controller from the UI. This will animate the form editing bar out of view.
        formEditingBar.unbindController()
    }
}

```

### MYACTIVITY.JAVA

```java

class MyActivity extends AppCompatActivity implements OnFormElementEditingModeChangeListener {
    private FormEditingBar formEditingBar;
    private PdfFragment fragment;

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

        formEditingBar = findViewById(R.id.formEditingBar);

        //... Init fragment here...

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

    @Override
    public void onEnterFormElementEditingMode(@NonNull FormEditingController controller) {
        // Binding the form editing bar to the form editing controller will animate it into view.
        formEditingBar.bindController(controller);
    }

    @Override
    public void onChangeFormElementEditingMode(@NonNull FormEditingController controller) {
        // Nothing to be done here. The bound form editing bar will pick up the changes.
    }

    @Override
    public void onExitFormElementEditingMode(@NonNull FormEditingController controller) {
        // Unbind the form editing controller from the UI. This will animate the form editing bar out of view.
        formEditingBar.unbindController();
    }
}

```

## Form editing inspector

[`PdfActivity`](https://www.nutrient.io/api/android/nutrient/com.pspdfkit.ui/-pdf-activity/index.html) displays a form editing inspector in a bottom sheet when 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)) are being edited.

If you want to integrate the form editing inspector into your custom activity, follow the [using property inspectors within fragment](https://www.nutrient.io/guides/android/customizing-the-interface/using-inspectors-within-fragment.md) guide.

For a complete example of how to integrate the form editing inspector and form editing bar, take a look at `FormEditingInFragmentExample` in our Catalog app.
---

## Related pages

- [Customizing PDF viewer styling on Android](/guides/android/customizing-the-interface/appearance-styling.md)
- [Customizing our PDF viewer on Android](/guides/android/user-interface.md)
- [Localization: Change languages in our Android PDF viewer](/guides/android/features/localization.md)
- [Customize toolbar menus on Android](/guides/android/customizing-the-interface/customizing-menus.md)
- [Customizing dialog modals on Android](/guides/android/customizing-the-interface/modal-dialogs-styling.md)
- [Customizing the note editor on Android](/guides/android/customizing-the-interface/customizing-the-note-editor.md)
- [Hide or customize scrollbars in our Android viewer](/guides/android/customizing-the-interface/scrollbars.md)
- [Overlay views on Android](/guides/android/features/overlay-views.md)
- [Customizing the electronic signature UI on Android](/guides/android/customizing-the-interface/configuring-the-signaturepickerfragment.md)
- [Show or hide the UI in our Android viewer](/guides/android/customizing-the-interface/user-interface-visibility.md)
- [Customizing the thumbnail file viewer on Android](/guides/android/customizing-the-interface/customizing-the-thumbnail-bar.md)
- [Separate the document info view in our Android viewer](/guides/android/user-interface/separate-document-info.md)

