FocusFinder
open class FocusFinder
| kotlin.Any | |
| ↳ | android.view.FocusFinder | 
The algorithm used for finding the next focusable view in a given direction from a view that currently has focus.
Summary
| Public methods | |
|---|---|
| open View! | Find the nearest touchable view to the specified view. | 
| View! | findNextFocus(root: ViewGroup!, focused: View!, direction: Int)Find the next view to take focus in root's descendants, starting from the view that currently is focused. | 
| open View! | findNextFocusFromRect(root: ViewGroup!, focusedRect: Rect!, direction: Int)Find the next view to take focus in root's descendants, searching from a particular rectangle in root's coordinates. | 
| open View! | findNextKeyboardNavigationCluster(: View, : View?, : Int)Find the root of the next keyboard navigation cluster after the current one. | 
| open static FocusFinder! | Get the focus finder for this thread. | 
Public methods
findNearestTouchable
open fun findNearestTouchable(
root: ViewGroup!,
x: Int,
y: Int,
direction: Int,
deltas: IntArray!
): View!
Find the nearest touchable view to the specified view.
| Parameters | |
|---|---|
| root | ViewGroup!: The root of the tree in which to search | 
| x | Int: X coordinate from which to start the search | 
| y | Int: Y coordinate from which to start the search | 
| direction | Int: Direction to look | 
| deltas | IntArray!: Offset from the to the edge of the nearest view. Note that this array may already be populated with values. | 
| Return | |
|---|---|
| View! | The nearest touchable view, or null if none exists. | 
findNextFocus
fun findNextFocus(
root: ViewGroup!,
focused: View!,
direction: Int
): View!
Find the next view to take focus in root's descendants, starting from the view that currently is focused.
| Parameters | |
|---|---|
| root | ViewGroup!: Contains focused. Cannot be null. | 
| focused | View!: Has focus now. | 
| direction | Int: Direction to look. | 
| Return | |
|---|---|
| View! | The next focusable view, or null if none exists. | 
findNextFocusFromRect
open fun findNextFocusFromRect(
root: ViewGroup!,
focusedRect: Rect!,
direction: Int
): View!
Find the next view to take focus in root's descendants, searching from a particular rectangle in root's coordinates.
| Parameters | |
|---|---|
| root | ViewGroup!: Contains focusedRect. Cannot be null. | 
| focusedRect | Rect!: The starting point of the search. | 
| direction | Int: Direction to look. | 
| Return | |
|---|---|
| View! | The next focusable view, or null if none exists. | 
findNextKeyboardNavigationCluster
open fun findNextKeyboardNavigationCluster(
: View,
: View?,
: Int
): View!
Find the root of the next keyboard navigation cluster after the current one.
| Parameters | |
|---|---|
| root | View: The view tree to look inside. Cannot be null | 
| currentCluster | View?: The starting point of the search. Null means the default cluster This value may be null. | 
| direction | Int: Direction to look Value is android.view.View#FOCUS_BACKWARD,android.view.View#FOCUS_FORWARD,android.view.View#FOCUS_LEFT,android.view.View#FOCUS_UP,android.view.View#FOCUS_RIGHT, orandroid.view.View#FOCUS_DOWN | 
| Return | |
|---|---|
| View! | The next cluster, or null if none exists | 
getInstance
open static fun getInstance(): FocusFinder!
Get the focus finder for this thread.
