Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/view/ScrollCaptureTarget#pubctors) \| [Methods](https://developer.android.com/reference/android/view/ScrollCaptureTarget#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/ScrollCaptureTarget#inhmethods)

# ScrollCaptureTarget

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/ScrollCaptureTarget "View this page in Kotlin") \|Java


`
public

final

class
ScrollCaptureTarget
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.ScrollCaptureTarget |

<br />

*** ** * ** ***

A target collects the set of contextual information for a ScrollCaptureHandler discovered during
a `https://developer.android.com/reference/android/view/View#dispatchScrollCaptureSearch(android.graphics.Rect,%20android.graphics.Point,%20java.util.function.Consumer<android.view.ScrollCaptureTarget>)`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#ScrollCaptureTarget(android.view.View,%20android.graphics.Rect,%20android.graphics.Point,%20android.view.ScrollCaptureCallback)(https://developer.android.com/reference/android/view/View scrollTarget, https://developer.android.com/reference/android/graphics/Rect localVisibleRect, https://developer.android.com/reference/android/graphics/Point positionInWindow, https://developer.android.com/reference/android/view/ScrollCaptureCallback callback) ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/ScrollCaptureCallback` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getCallback()() ` |
| ` https://developer.android.com/reference/android/view/View` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getContainingView()() ` |
| ` int` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getHint()() ` |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getLocalVisibleRect()() ` Returns the visible bounds of the containing view. |
| ` https://developer.android.com/reference/android/graphics/Point` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getPositionInWindow()() ` |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#getScrollBounds()() ` |
| ` void` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#setScrollBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect scrollBounds) ` Sets the scroll bounds rect to the intersection of provided rect and the current bounds of the `containing view`. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/view/ScrollCaptureTarget#updatePositionInWindow()() ` Refresh the local visible bounds and its offset within the window, based on the current state of the `containing view`. |

| ### Inherited methods |
|---|---|
| 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

### ScrollCaptureTarget

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ScrollCaptureTarget (View scrollTarget, 
                Rect localVisibleRect, 
                Point positionInWindow, 
                ScrollCaptureCallback callback)
```

<br />

<br />

| Parameters ||
|---|---|
| `scrollTarget` | `View`: This value cannot be `null`. <br /> |
| `localVisibleRect` | `Rect`: This value cannot be `null`. <br /> |
| `positionInWindow` | `Point`: This value cannot be `null`. <br /> |
| `callback` | `ScrollCaptureCallback`: This value cannot be `null`. <br /> |

## Public methods

### getCallback

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public ScrollCaptureCallback getCallback ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/ScrollCaptureCallback` | the `https://developer.android.com/reference/android/view/ScrollCaptureCallback` for this target. This value cannot be `null`. <br /> |

### getContainingView

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public View getContainingView ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/View` | the `containing view` for this `https://developer.android.com/reference/android/view/ScrollCaptureCallback` This value cannot be `null`. <br /> |

### getHint

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getHint ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | the hint that the `containing view` had during the scroll capture search. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/view/View#SCROLL_CAPTURE_HINT_AUTO` - `https://developer.android.com/reference/android/view/View#SCROLL_CAPTURE_HINT_EXCLUDE` - `https://developer.android.com/reference/android/view/View#SCROLL_CAPTURE_HINT_INCLUDE` - `https://developer.android.com/reference/android/view/View#SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS` |

**See also:**

- `https://developer.android.com/reference/android/view/View#getScrollCaptureHint()`

### getLocalVisibleRect

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Rect getLocalVisibleRect ()
```

Returns the visible bounds of the containing view.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | the visible bounds of the `containing view` in view-local coordinates. This value cannot be `null`. <br /> |

### getPositionInWindow

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Point getPositionInWindow ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Point` | the position of the visible bounds of the containing view within the window. This value cannot be `null`. <br /> |

### getScrollBounds

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Rect getScrollBounds ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | the `scroll bounds` for this `https://developer.android.com/reference/android/view/ScrollCaptureCallback` This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/ScrollCaptureCallback#onScrollCaptureSearch(android.os.CancellationSignal,%20java.util.function.Consumer<android.graphics.Rect>)`

### setScrollBounds

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setScrollBounds (Rect scrollBounds)
```

Sets the scroll bounds rect to the intersection of provided rect and the current bounds of
the `containing view`.

<br />

| Parameters ||
|---|---|
| `scrollBounds` | `Rect`: This value may be `null`. <br /> |

### toString

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### updatePositionInWindow

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void updatePositionInWindow ()
```

Refresh the local visible bounds and its offset within the window, based on the current
state of the `containing view`.


This method must be called on the thread that originally created
this UI element. This is typically the
[main thread](https://developer.android.com/reference/android/os/Looper#getMainLooper()) of your app.

<br />