> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/annotation/customize-color-picker.md).

# Customize annotation style editor in Android

Learn how to customize the AnnotationStyleDialogFragment in Android using styles and ToolManagerBuilder. Customize color picker, preset annotations, and icon picker with Android styles. Follow step-by

The [`AnnotationStyleDialogFragment`](/android/annotation/style-editor-dialog.md) can be customized using Android styles or with `ToolManagerBuilder`, depending on the specific property that needs to be customized.

Android styles are used to [customize the color picker](https://docs.apryse.com), [preset annotations](https://docs.apryse.com), and [icon picker](https://docs.apryse.com).

`ToolManagerBuilder` is used to [customize the annotation style dialog properties](https://docs.apryse.com).

## Customize standard colors in color picker

Standard colors are colors presented in the grid layout of the color picker.

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-8467b3458c1df61a78b182113c1a2fc8885e5e68%2F23e65cc71773c378413ddf0ff73ed46999928cb7-1074x750.png?alt=media)

To change these colors, you can override the standard color list as follows:

1. In the `res/values/arrays.xml` file of your project, define a `string-array` containing your custom color list:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<string-array name="custom_standard_colors">
    <item>#f1a099</item>
    <item>#ffc67b</item>
    <item>#ffe6a2</item>
    <item>#80e5b1</item>
    <item>#92e8e8</item>
    <item>#a6a1e6</item>
    <item>#e2a1e6</item>
</string-array>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. In your `res/values/styles.xml` file, define your own style and inherit `PresetColorGridViewStyle`, then set your color list `custom_standard_colors` to the `color_list` attribute:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<style name="CustomPresetColorGridStyle" parent="PresetColorGridViewStyle"> <item name="color_list">@array/custom_standard_colors</item> </style>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Finally, set your customized style `CustomPresetColorGridStyle` to the `preset_colors_style` attribute in your application's theme:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<style name="PDFTronAppTheme" parent="PDFTronAppThemeBase"> <item name="preset_colors_style">@style/CustomPresetColorGridStyle</item> </style>
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**To learn more about applying your custom theme to an application, see: Styles and Themes.**
{% endhint %}

## Customize the annotation preset styles

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-5b8f87e099c55d3a609e4389f30817a39a43c8d0%2Fb9e484aca6b5de46ff97ee1718ca5572c216b888-458x82.png?alt=media)

An annotation preset style defines a group of annotation style attributes. Presets allow users to conveniently change the annotation's appearance with only one tap. You can override existing annotation presets and define your own in your app.

In this tutorial you will implement custom annotation presets for `Text`(sticky note) annotations.

1. In the `res/values/styles.xml` file of your project, create a series of customized annotation styles. For more detail on annotation style attributes, see tool style attributes.

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<style name="CustomPresetStyle1"> <item name="annot_color">#ffcd45</item> <item name="annot_icon">Comment</item> </style>
<style name="CustomPresetStyle2"> <item name="annot_color">#25d2d1</item> <item name="annot_icon">Star</item> </style>
<style name="CustomPresetStyle3"> <item name="annot_color">#00cc63</item> <item name="annot_icon">CheckMark</item> </style>
<style name="CustomPresetStyle4"> <item name="annot_color">#e44234</item> <item name="annot_icon">CrossMark</item> </style>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. In the `res/values/arrays.xml` file of your project, define an `array` containing your customized presets:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<array name="custom_presets">
    <item>@style/CustomPresetStyle1</item>
    <item>@style/CustomPresetStyle2</item>
    <item>@style/CustomPresetStyle3</item>
    <item>@style/CustomPresetStyle4</item>
</array>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. In the application theme, set your `custom_presets` array to the `sticky_note_presets` attribute:If you want to change the presets for a different annotation type, refer to the [attribute presets table](https://docs.apryse.com) to find the appropriate attribute.

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<style name="PDFTronAppTheme" parent="PDFTronAppThemeBase"> <item name="sticky_note_presets">@array/custom_presets</item> </style>
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Attribute presets table

| Preset attribute                  | Annotation type        | Default presets preview                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `R.attr.free_text_presets`        | `FreeText`             | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-0eecc629bc07ad19e25b802f95676f8db50930cc%2Ff1bb600c7f90972d4ae86099823fb05ab0a25d5e-809x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.freehand_presets`         | `Ink`                  | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-835a64bd4699401be114f156faf4492d0bf44885%2Fdf8bc761663f438128520ade58beecee98dedd7f-808x131.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.line_presets`             | `Line` and `Arrow`     | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-19e44555b0d64345459dd8821bd456d3ad6e3a0d%2F6263d875d132106797bb2765fc97a2add5ee9138-806x130.png?alt=media)![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-d05b56197ac0c8637e42f32d46223cc900ad0740%2F132a26998de740aba6e741c24ec90e8600bd39b4-808x133.png?alt=media) |
| `R.attr.link_presets`             | `Link`                 | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-9bc1a976807a181dc7cf9cf40de798c6289aceca%2Fac5e77718da08adc331daeef096af2bdbee86d07-811x131.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.oval_presets`             | `Circle`               | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-d19d66b294c81ba8626dcc2c2e840a14bb7eb288%2F82928f4b1729a62140a9377b5e288edfecae5e00-807x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.rect_presets`             | `Square`               | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-9351f291e72ff6b3c7c8e1c87e6b02645328cd37%2F4499f399097313806324cc904a8a018690e1c34e-806x129.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.signature_presets`        | `Signature`            | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-1b92470347045b6622baeccfe99d314bed6d06a8%2Fd5b532bbb24813236d7f53bc6b59f7857a97b82b-555x126.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.highlight_presets`        | `Highlight`            | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c54ab4f2fa5f963c227bb47771a8cf45e26e67dc%2Ff0e62d5e2a6bff38e5aad266f0e4a5fc40483079-807x131.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.squiggly_presets`         | `Squiggly`             | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-fdfadc07216a47f399ae3686b7358cfa2103da3a%2F4d51beacc3a7140c278b585e304713ea23250fb9-808x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.strikeout_presets`        | `StrikeOut`            | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-edd306032c3557c3fae6ea03310608daa3f961d9%2F87d39a0c15af7b991d772eb6049c689c69042bc8-808x132.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.underline_presets`        | `Underline`            | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-99b3717ae58b2eece1da5a6b75eb120c4e496fed%2F776f0cc44940727942563174595662e94c7a6eb3-805x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.sticky_note_presets`      | `Text`(sticky note)    | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-6735e6ad788aed4b293ba21f1482428dbecae197%2Fdfd964cc420d9b0311274ea4110e310d8e60faa8-808x127.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.callout_presets`          | `Callout`              | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-33f2de7c46529131c1f04ac0e585f6def6345dee%2Fcbeaba19b7b1d816d00fe2917e07ef5593f723f1-809x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.ruler_presets`            | `Ruler`                | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-aabedf60f0efe79568235396ff5e259f68966e62%2F5e7168a4cbe0b31c9b864f8690ca359c16fe2fec-807x131.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.polyline_presets`         | `Polyline`             | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-55a1f1a26534fddaf301b340acfdee65e8aa3e5c%2F82c71e7c243815ed5a72b2af220d857771d9bd2a-809x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.polygon_presets`          | `Polygon`              | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-93634880ce52046cc7b7a49a8925aea0acc21a29%2F37ad60b229e92828cd7f748e763e2bbe2b363677-805x129.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.cloud_presets`            | `Cloud`                | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-622171476f8baca5fe6462b27ffeee4957112635%2Fde69841bee5b141ccc35a04f8bb5fd9e9fb5dbf6-808x130.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.free_highlighter_presets` | `Free Highlighter`     | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-12aa7c9514ff6f002b38db32984155eef23413d4%2F73bd7d966deab4c10a4996bca9f0cba2133dc519-807x131.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.widget_presets`           | `Widget`               | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-9f33e6741228b077f27268611e9c3e62457b6d3a%2F39b109bdb7052c70afa66eecbc915ed4dfff25db-807x132.png?alt=media)                                                                                                                                                                                                                                               |
| `R.attr.other_presets`            | other annotation types | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-19e44555b0d64345459dd8821bd456d3ad6e3a0d%2F6263d875d132106797bb2765fc97a2add5ee9138-806x130.png?alt=media)                                                                                                                                                                                                                                               |

## Customize the icon picker

The icon picker for `Text`(sticky note) annotations allows users to choose their own icon:

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-2ee964cf0e052a0a3807dfb030cc65cf586b6dcc%2F78be95d500da49d0b1c71edff52bfb2ef521c819-460x173.png?alt=media)

Below is the list of icons available for `Text`(sticky note) annotations:

### Default icons table

| Icon name    | Icon                                                                                                                                                                                                                                         |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Comment      | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-35e360ffbcf03b8946014b635d09aa78d27e6dac%2Fe60be08bb0ef4548d85820c58db9e5f34e780abc-66x67.png?alt=media) |
| Help         | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-100673ca4ca12628eb66ab4bb7d7e9a72c4e23fe%2Fb3035525b851a0f338b506ff2b0ad4fa376bd46a-65x62.png?alt=media) |
| InsertCaret  | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-4f65d84a4e925e7c742850b69007878c27406853%2Fcaa3b99c7e1ec43d16e556a9431f6e37db4e0401-71x60.png?alt=media) |
| Star         | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-06ac0f2d066be9cec095547663142a81a69f5f64%2Fdd86d2d3610cdc9c98601b1cbdd799d3ec39f503-67x65.png?alt=media) |
| LightBulb    | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-536238953d72f1f767cb53f2d948e0540ccd8eba%2Fe3d4963a0fc2ae40c3506943ab415dd04e090968-61x61.png?alt=media) |
| NewParagraph | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-54791ef51b7592346f8db66184bcbfa24074a5d5%2F7dd549280c0349d69b7b92cd56b6c80443bf90c6-60x61.png?alt=media) |
| CrossMark    | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-ce5a1b4d08a8911e0db03edaf14b9687518796f2%2F5fd3545ce2b6c4ff046030b97e8a572fbce5b13a-61x56.png?alt=media) |
| CheckMark    | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-5de521175b21c9efb806ceda2cb46441b7546ff7%2F7dddcd4ee50134cff2d4d041f3659f19821ad624-57x56.png?alt=media) |
| LocationPin  | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-c76b9d5b9a042833e7c28c0f7435c1520e47a278%2F2178974f0acde37516a9fd4e53ddca9a592526f4-57x62.png?alt=media) |
| ThumbsUp     | ![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-371e5281617da14ea81ebce74d55e90506c8d73f%2Fde60bff983be3591999ed7783640773e2772c603-66x60.png?alt=media) |

You can also create your own list by using the icons above:

1. To change the icon list, first define a string array list in your `res/values/arrays.xml` file. Each item in the list represents the icon name defined in the table above.

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<string-array name="custom_icons">
    <item>Help</item>
    <item>InsertCaret</item>
</string-array>
```

{% endcode %}
{% endtab %}
{% endtabs %}

1. Then, set your `custom_icons` array to the `sticky_note_icons` attribute in your application theme:

{% tabs %}
{% tab title="XML" %}
{% code lineNumbers="true" %}

```xml
<style name="PDFTronAppTheme" parent="PDFTronAppThemeBase"> <item name="sticky_note_icons">@array/custom_icons</item> </style>
```

{% endcode %}
{% endtab %}
{% endtabs %}

If you want to add a custom icon to the sticky note icon picker, please refer to \[this guide]\(/android/guides/cookbook/customize-sticky-note-icon) for more details.

Hide properties in the annotation style dialog By default, each annotation type will contain it's own set of annotation style properties. You can hide these defined properties by using \`ToolManagerBuilder\` as follows:

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
ToolManagerBuilder tmBuilder = ToolManagerBuilder.from() 
// Hide font and preset properties in the annotation 
// style dialog for Free Text annotation 
.addAnnotStyleProperty(new AnnotStyleProperty(Annot.e_FreeText) 
.setCanShowFont(false) .setCanShowPreset(false) ) 
.setUseDigitalSignature(false) 
.setAutoResizeFreeText(false);
```

{% endcode %}
{% endtab %}
{% endtabs %}

If the property is not defined for a annotation type (for example font property is not defined for rectangle annotations), setting the `CanShow` property will not do anything.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/annotation/customize-color-picker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
