Most visited

Recently visited

BrowseFrameLayout

public class BrowseFrameLayout
extends FrameLayout

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


用于管理重叠视图之间焦点行为的ViewGroup。

Summary

Nested classes

interface BrowseFrameLayout.OnChildFocusListener

在BrowseFrameLayout中管理子焦点的界面。

interface BrowseFrameLayout.OnFocusSearchListener

用于在系统焦点查找程序找不到要聚焦的视图时在BrowseFrameLayout中选择焦点视图的界面。

Inherited XML attributes

From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View

Inherited constants

From class android.view.ViewGroup
From class android.view.View

Inherited fields

From class android.view.View

Public constructors

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

Public methods

View focusSearch(View focused, int direction)

在指定的方向查找想要聚焦的最近视图。

BrowseFrameLayout.OnChildFocusListener getOnChildFocusListener()

返回 BrowseFrameLayout.OnChildFocusListener

BrowseFrameLayout.OnFocusSearchListener getOnFocusSearchListener()

返回 BrowseFrameLayout.OnFocusSearchListener

void requestChildFocus(View child, View focused)

当这个父母的孩子需要关注时调用

void setOnChildFocusListener(BrowseFrameLayout.OnChildFocusListener listener)

设置 BrowseFrameLayout.OnChildFocusListener

void setOnFocusSearchListener(BrowseFrameLayout.OnFocusSearchListener listener)

设置 BrowseFrameLayout.OnFocusSearchListener

Protected methods

boolean onRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)

寻找一个后裔打电话 requestFocus()

Inherited methods

From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.view.ViewParent
From interface android.view.ViewManager
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.accessibility.AccessibilityEventSource

Public constructors

BrowseFrameLayout

BrowseFrameLayout (Context context)

Parameters
context Context

BrowseFrameLayout

BrowseFrameLayout (Context context, 
                AttributeSet attrs)

Parameters
context Context
attrs AttributeSet

BrowseFrameLayout

BrowseFrameLayout (Context context, 
                AttributeSet attrs, 
                int defStyle)

Parameters
context Context
attrs AttributeSet
defStyle int

Public methods

focusSearch

View focusSearch (View focused, 
                int direction)

在指定的方向查找想要聚焦的最近视图。

Parameters
focused View: The view that currently has focus
direction int: One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT, or 0 for not applicable.
Returns
View

requestChildFocus

void requestChildFocus (View child, 
                View focused)

当这个父母的孩子需要关注时调用

Parameters
child View: The child of this ViewParent that wants focus. This view will contain the focused view. It is not necessarily the view that actually has focus.
focused View: The view that is a descendant of child that actually has focus

setOnChildFocusListener

void setOnChildFocusListener (BrowseFrameLayout.OnChildFocusListener listener)

设置 BrowseFrameLayout.OnChildFocusListener

Parameters
listener BrowseFrameLayout.OnChildFocusListener

setOnFocusSearchListener

void setOnFocusSearchListener (BrowseFrameLayout.OnFocusSearchListener listener)

设置一个 BrowseFrameLayout.OnFocusSearchListener

Parameters
listener BrowseFrameLayout.OnFocusSearchListener

Protected methods

onRequestFocusInDescendants

boolean onRequestFocusInDescendants (int direction, 
                Rect previouslyFocusedRect)

寻找一个后裔打电话requestFocus() 当它想要在其子女内请求焦点时由requestFocus(int, android.graphics.Rect)调用。 重写此操作可以自定义您的ViewGroup请求中的请求重点。

Parameters
direction int: One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT
previouslyFocusedRect Rect: The rectangle (in this View's coordinate system) to give a finer grained hint about where focus is coming from. May be null if there is no hint.
Returns
boolean Whether focus was taken.

Hooray!