Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions) Summary: [Ctors](https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#inhmethods)

# HighlightAnnotation

*** ** * ** ***


`
public

final

class
HighlightAnnotation
`


`


`

`

extends https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.pdf.component.PdfAnnotation](https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation) ||
|   | ↳ | android.graphics.pdf.component.HighlightAnnotation |

<br />

*** ** * ** ***

Represents a highlight annotation in a PDF document.

If the highlight color is not explicitly set using `https://developer.android.com/`,
the default color is yellow.

<br />

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#HighlightAnnotation(java.util.List<android.graphics.RectF>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/RectF> boundsList) ` Creates a new highlight annotation with the specified bounds list. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/RectF>` | ` https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#getBoundsList()() ` Returns the bounding rectangles of the highlight annotation. |
| ` int` | ` https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#getColor()() ` Returns the highlight color of the annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#setBoundsList(java.util.List<android.graphics.RectF>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/RectF> boundsList) ` Sets the bounding rectangles of the highlight annotation. |
| ` void` | ` https://developer.android.com/reference/android/graphics/pdf/component/HighlightAnnotation#setColor(int)(int color) ` Sets the highlight color of the annotation. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation ` |---|---| | ` int` | ` https://developer.android.com/reference/android/graphics/pdf/component/PdfAnnotation#getPdfAnnotationType()() ` Returns the type of the annotation. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### HighlightAnnotation

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public HighlightAnnotation (List<RectF> boundsList)
```

Creates a new highlight annotation with the specified bounds list.


The default highlight color is yellow

<br />

| Parameters ||
|---|---|
| `boundsList` | `List`: The bounding rectangle of the annotation. This value cannot be `null`. <br /> |

## Public methods

### getBoundsList

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public List<RectF> getBoundsList ()
```

Returns the bounding rectangles of the highlight annotation.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/RectF>` | The bounding rectangles. This value cannot be `null`. <br /> |

### getColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public int getColor ()
```

Returns the highlight color of the annotation.

<br />

| Returns ||
|---|---|
| `int` | The highlight color. <br /> |

### setBoundsList

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setBoundsList (List<RectF> boundsList)
```

Sets the bounding rectangles of the highlight annotation. Each rect in the list mBoundsList
represent an absolute position of highlight inside the page of the document

<br />

| Parameters ||
|---|---|
| `boundsList` | `List`: The new bounding rectangles. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the given bounds list is empty |

### setColor

Added in [version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  
Also in [S Extensions 18](https://developer.android.com/sdkExtensions)

```
public void setColor (int color)
```

Sets the highlight color of the annotation.

<br />

| Parameters ||
|---|---|
| `color` | `int`: The new highlight color. <br /> |