Join us on the livestream at Android Dev Summit on 7-8 November 2018, starting at 10AM PDT!
added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0

BrowseFrameLayout

public class BrowseFrameLayout
extends FrameLayout

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ androidx.leanback.widget.BrowseFrameLayout


A ViewGroup for managing focus behavior between overlapping views.

Summary

Nested classes

interface BrowseFrameLayout.OnChildFocusListener

Interface for managing child focus in a BrowseFrameLayout. 

interface BrowseFrameLayout.OnFocusSearchListener

Interface for selecting a focused view in a BrowseFrameLayout when the system focus finder couldn't find a view to focus. 

Inherited constants

Inherited fields

Public constructors

BrowseFrameLayout(Context context)
BrowseFrameLayout(Context context, AttributeSet attrs)
BrowseFrameLayout(Context context, AttributeSet attrs, int defStyle)

Public methods

boolean dispatchKeyEvent(KeyEvent event)
View focusSearch(View focused, int direction)
BrowseFrameLayout.OnChildFocusListener getOnChildFocusListener()

Returns the BrowseFrameLayout.OnChildFocusListener.

BrowseFrameLayout.OnFocusSearchListener getOnFocusSearchListener()

Returns the BrowseFrameLayout.OnFocusSearchListener.

void requestChildFocus(View child, View focused)
void setOnChildFocusListener(BrowseFrameLayout.OnChildFocusListener listener)

Sets a BrowseFrameLayout.OnChildFocusListener.

void setOnDispatchKeyListener(View.OnKeyListener listener)

Sets the View.OnKeyListener on this view.

void setOnFocusSearchListener(BrowseFrameLayout.OnFocusSearchListener listener)

Sets a BrowseFrameLayout.OnFocusSearchListener.

Protected methods

boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)

Inherited methods

Public constructors

BrowseFrameLayout

added in version 1.0.0
public BrowseFrameLayout (Context context)

Parameters
context Context

BrowseFrameLayout

added in version 1.0.0
public BrowseFrameLayout (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

BrowseFrameLayout

added in version 1.0.0
public BrowseFrameLayout (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context

attrs AttributeSet

defStyle int

Public methods

dispatchKeyEvent

public boolean dispatchKeyEvent (KeyEvent event)

Parameters
event KeyEvent

Returns
boolean

focusSearch

public View focusSearch (View focused, 
                int direction)

Parameters
focused View

direction int

Returns
View

getOnChildFocusListener

added in version 1.0.0
public BrowseFrameLayout.OnChildFocusListener getOnChildFocusListener ()

Returns the BrowseFrameLayout.OnChildFocusListener.

Returns
BrowseFrameLayout.OnChildFocusListener

getOnFocusSearchListener

added in version 1.0.0
public BrowseFrameLayout.OnFocusSearchListener getOnFocusSearchListener ()

Returns the BrowseFrameLayout.OnFocusSearchListener.

Returns
BrowseFrameLayout.OnFocusSearchListener

requestChildFocus

public void requestChildFocus (View child, 
                View focused)

Parameters
child View

focused View

setOnChildFocusListener

added in version 1.0.0
public void setOnChildFocusListener (BrowseFrameLayout.OnChildFocusListener listener)

Sets a BrowseFrameLayout.OnChildFocusListener.

Parameters
listener BrowseFrameLayout.OnChildFocusListener

setOnDispatchKeyListener

added in version 1.0.0
public void setOnDispatchKeyListener (View.OnKeyListener listener)

Sets the View.OnKeyListener on this view. This listener would fire only for unhandled KeyEvents. We need to provide an external key listener to handle back button clicks when we are in full screen video mode because View.setOnKeyListener(OnKeyListener) doesn't fire as the focus is not on this view.

Parameters
listener View.OnKeyListener

setOnFocusSearchListener

added in version 1.0.0
public void setOnFocusSearchListener (BrowseFrameLayout.OnFocusSearchListener listener)

Sets a BrowseFrameLayout.OnFocusSearchListener.

Parameters
listener BrowseFrameLayout.OnFocusSearchListener

Protected methods

onRequestFocusInDescendants

protected boolean onRequestFocusInDescendants (int direction, 
                Rect previouslyFocusedRect)

Parameters
direction int

previouslyFocusedRect Rect

Returns
boolean