Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IFocusState

interface IFocusState
Extends com.amazon.apmf.IStandard Interface for managing focus state of the Views.

Methods

setFocusable()

void setFocusable(IView* view, bool focusable)
Sets whether this View can receive focus. Setting focusable = false will also ensure that this View is not focusable in touch mode.

Parameters

view
IView* — Required The View for which the focusability is being set.
focusable
bool — Required true if this View can receive focus, false otherwise.

isFocusable()

bool isFocusable(IView* view)
Gets whether this View can receive focus.

Parameters

view
IView* — Required The View for which to check focusability on.

Returns

bool True if the specified View can take focus, or False otherwise.

setFocusableInTouchMode()

void setFocusableInTouchMode(IView* view, bool focusable)
Sets whether this View can receive focus while in touch mode.

Parameters

view
IView* — Required The View for which the focusability is being set.
focusable
bool — Required true if this View can receive focus while in touch mode, false otherwise

isFocusableInTouchMode()

bool isFocusableInTouchMode(IView* view)
Gets whether this View can receive focus while in touch mode.

Parameters

view
IView* — Required The View for which to check focusability on.

Returns

bool true if this View can receive focus while in touch mode, false otherwise

isFocused()

bool isFocused(IView* view)
Evaluate whether the current View has focus or not.

Parameters

view
IView* — Required The View to check focus on.

Returns

bool True if the specified View has focus, or False otherwise.

setDescendantFocusability()

void setDescendantFocusability(IView* view, DescendantFocusability descendantFocusability)
Set descendant focusability of this View. This defines the relationship between this View and its descendants when searching for a View to take focus in requestFocus(view, direction, previouslyFocusedRect).

Parameters

view
IView* — Required The View for which to set descendant focusability.
descendantFocusability
DescendantFocusability — Required One of DescendantFocusability enum value.

getDescendantFocusability()

DescendantFocusability getDescendantFocusability(IView* view)
Gets descendant focusability of this View. The descendant focusability defines the relationship between this View and its descendants when searching for a View to take focus in requestFocus(view, direction, previouslyFocusedRect).

Parameters

view
IView* — Required The View for which to get descendant focusability.

Returns

DescendantFocusability One of DescendantFocusability value.

hasFocus()

bool hasFocus(IView* view)
Evaluate whether the current View or one of its descendants has focus.

Parameters

view
IView* — Required The View for which to check if it has focus or contains a focused descendant View.

Returns

bool True if the specified View has or contains focus, otherwise false.

findFocus()

IView? findFocus(IView* view)
Find the View in the hierarchy rooted at this View that currently has focus.

Parameters

view
IView* — Required The View hierarchy root to find a focused View in.

Returns

IView? The return value is optional and might be absent. The View that currently has focus, or nullptr if no focused View can be found.
Last modified on October 29, 2026