FocusFinder
public
class
FocusFinder
extends Object
| java.lang.Object | |
| ↳ | 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 | |
|---|---|
View
|
findNearestTouchable(ViewGroup root, int x, int y, int direction, int[] deltas)
Find the nearest touchable view to the specified view. |
final
View
|
findNextFocus(ViewGroup root, View focused, int direction)
Find the next view to take focus in root's descendants, starting from the view that currently is focused. |
View
|
findNextFocusFromRect(ViewGroup root, Rect focusedRect, int direction)
Find the next view to take focus in root's descendants, searching from a particular rectangle in root's coordinates. |
View
|
findNextKeyboardNavigationCluster(View root, View currentCluster, int direction)
Find the root of the next keyboard navigation cluster after the current one. |
static
FocusFinder
|
getInstance()
Get the focus finder for this thread. |
Inherited methods | |
|---|---|
java.lang.Object
| |
Public methods
findNearestTouchable
View findNearestTouchable (ViewGroup root, int x, int y, int direction, int[] deltas)
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 |
int: Offset from the |
| Returns | |
|---|---|
View |
The nearest touchable view, or null if none exists. |
findNextFocus
View findNextFocus (ViewGroup root, View focused, int direction)
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. |
| Returns | |
|---|---|
View |
The next focusable view, or null if none exists. |
findNextFocusFromRect
View findNextFocusFromRect (ViewGroup root, Rect focusedRect, int direction)
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. |
| Returns | |
|---|---|
View |
The next focusable view, or null if none exists. |
findNextKeyboardNavigationCluster
View findNextKeyboardNavigationCluster (View root, View currentCluster, int direction)
Find the root of the next keyboard navigation cluster after the current one.
| Parameters | |
|---|---|
root |
View: The view tree to look inside. Cannot be nullThis value must never be |
currentCluster |
View: The starting point of the search. Null means the default clusterThis value may be |
direction |
int: Direction to look |
| Returns | |
|---|---|
View |
The next cluster, or null if none exists |
getInstance
FocusFinder getInstance ()
Get the focus finder for this thread.
| Returns | |
|---|---|
FocusFinder |
|
Annotations
Interfaces
- ActionMode.Callback
- ActionProvider.VisibilityListener
- Choreographer.FrameCallback
- CollapsibleActionView
- ContextMenu
- ContextMenu.ContextMenuInfo
- GestureDetector.OnContextClickListener
- GestureDetector.OnDoubleTapListener
- GestureDetector.OnGestureListener
- InputQueue.Callback
- KeyEvent.Callback
- LayoutInflater.Factory
- LayoutInflater.Factory2
- LayoutInflater.Filter
- Menu
- MenuItem
- MenuItem.OnActionExpandListener
- MenuItem.OnMenuItemClickListener
- PixelCopy.OnPixelCopyFinishedListener
- ScaleGestureDetector.OnScaleGestureListener
- SubMenu
- SurfaceHolder
- SurfaceHolder.Callback
- SurfaceHolder.Callback2
- TextureView.SurfaceTextureListener
- View.OnApplyWindowInsetsListener
- View.OnAttachStateChangeListener
- View.OnCapturedPointerListener
- View.OnClickListener
- View.OnContextClickListener
- View.OnCreateContextMenuListener
- View.OnDragListener
- View.OnFocusChangeListener
- View.OnGenericMotionListener
- View.OnHoverListener
- View.OnKeyListener
- View.OnLayoutChangeListener
- View.OnLongClickListener
- View.OnScrollChangeListener
- View.OnSystemUiVisibilityChangeListener
- View.OnTouchListener
- ViewGroup.OnHierarchyChangeListener
- ViewManager
- ViewParent
- ViewStub.OnInflateListener
- ViewTreeObserver.OnDrawListener
- ViewTreeObserver.OnGlobalFocusChangeListener
- ViewTreeObserver.OnGlobalLayoutListener
- ViewTreeObserver.OnPreDrawListener
- ViewTreeObserver.OnScrollChangedListener
- ViewTreeObserver.OnTouchModeChangeListener
- ViewTreeObserver.OnWindowAttachListener
- ViewTreeObserver.OnWindowFocusChangeListener
- Window.Callback
- Window.OnFrameMetricsAvailableListener
- Window.OnRestrictedCaptionAreaChangedListener
- WindowManager
Classes
- AbsSavedState
- ActionMode
- ActionMode.Callback2
- ActionProvider
- Choreographer
- ContextThemeWrapper
- Display
- Display.HdrCapabilities
- Display.Mode
- DragAndDropPermissions
- DragEvent
- FocusFinder
- FrameMetrics
- FrameStats
- GestureDetector
- GestureDetector.SimpleOnGestureListener
- Gravity
- HapticFeedbackConstants
- InputDevice
- InputDevice.MotionRange
- InputEvent
- InputQueue
- KeyboardShortcutGroup
- KeyboardShortcutInfo
- KeyCharacterMap
- KeyCharacterMap.KeyData
- KeyEvent
- KeyEvent.DispatcherState
- LayoutInflater
- MenuInflater
- MotionEvent
- MotionEvent.PointerCoords
- MotionEvent.PointerProperties
- OrientationEventListener
- OrientationListener
- PixelCopy
- PointerIcon
- ScaleGestureDetector
- ScaleGestureDetector.SimpleOnScaleGestureListener
- SearchEvent
- SoundEffectConstants
- Surface
- SurfaceView
- TextureView
- TouchDelegate
- VelocityTracker
- View
- View.AccessibilityDelegate
- View.BaseSavedState
- View.DragShadowBuilder
- View.MeasureSpec
- ViewAnimationUtils
- ViewConfiguration
- ViewDebug
- ViewGroup
- ViewGroup.LayoutParams
- ViewGroup.MarginLayoutParams
- ViewGroupOverlay
- ViewOutlineProvider
- ViewOverlay
- ViewPropertyAnimator
- ViewStructure
- ViewStructure.HtmlInfo
- ViewStructure.HtmlInfo.Builder
- ViewStub
- ViewTreeObserver
- Window
- WindowAnimationFrameStats
- WindowContentFrameStats
- WindowId
- WindowId.FocusObserver
- WindowInsets
- WindowManager.LayoutParams
Enums
Exceptions