VerticalGridFragment

Added in 1.1.0
Deprecated in 1.1.0

class VerticalGridFragment : BaseFragment


A fragment for creating leanback vertical grids.

Renders a vertical grid of objects given a VerticalGridPresenter and an ObjectAdapter.

Summary

Public constructors

Public functions

ObjectAdapter?

Returns the object adapter.

VerticalGridPresenter?

Returns the grid presenter.

OnItemViewClickedListener?

Returns the item clicked listener.

View?
onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

Sets the object adapter for the fragment.

Unit

Sets the grid presenter.

Unit

Sets an item clicked listener.

Unit

Sets an item selection listener.

Unit

Sets the selected item position.

Protected functions

Any

Create entrance transition.

Unit
runEntranceTransition(entranceTransition: Any?)

Run entrance transition.

Inherited functions

From androidx.leanback.app.BaseFragment
ProgressBarManager!

Returns the ProgressBarManager.

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

Unit

Callback when entrance transition is ended.

Unit

Callback when entrance transition is prepared.

Unit

Callback when entrance transition is started.

Unit
onViewCreated(view: View, savedInstanceState: Bundle?)

This function is deprecated.

Unit

Enables entrance transition.

Unit

When fragment finishes loading data, it should call startEntranceTransition() to execute the entrance transition. startEntranceTransition() will start transition only if both two conditions are satisfied:

From androidx.leanback.app.BrandedFragment
Drawable?

Returns the badge drawable used in the fragment title.

Int

Returns the color used to draw the search affordance.

SearchOrbView.Colors?

Returns the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

CharSequence?

Returns the title text for the fragment.

View?

Returns the view that implements TitleViewAdapter.Provider.

TitleViewAdapter?

Returns the TitleViewAdapter implemented by title view.

Unit
installTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup,
    savedInstanceState: Bundle?
)

Inflate title view and add to parent.

Boolean

Returns true/false to indicate the visibility of TitleView.

View
onInflateTitleView(
    inflater: LayoutInflater,
    parent: ViewGroup?,
    savedInstanceState: Bundle?
)

Called by installTitleView to inflate title view.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

Sets the drawable displayed in the fragment title.

Unit

Sets a click listener for the search affordance.

Unit

Sets the color used to draw the search affordance.

Unit

Sets the androidx.leanback.widget.SearchOrbView.Colors used to draw the search affordance.

Unit

Sets title text for the fragment.

Unit
setTitleView(titleView: View?)

Sets the view that implemented TitleViewAdapter.

Unit
showTitle(flags: Int)

Changes title view's components visibility and shows title.

Unit

Shows or hides the title view.

From android.app.Fragment
Unit
dump(
    prefix: String!,
    fd: FileDescriptor!,
    writer: PrintWriter!,
    args: Array<String!>!
)

This function is deprecated.

Boolean
equals(o: Any!)

This function is deprecated.

Activity!

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Bundle!

This function is deprecated.

FragmentManager!

This function is deprecated.

Context!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

FragmentManager!

This function is deprecated.

Any!

This function is deprecated.

Int

This function is deprecated.

LayoutInflater!

This function is deprecated.

LoaderManager!

This function is deprecated.

Fragment!

This function is deprecated.

Transition!

This function is deprecated.

Resources!

This function is deprecated.

Boolean

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

Transition!

This function is deprecated.

String!
getString(resId: Int)

This function is deprecated.

String!

This function is deprecated.

Fragment!

This function is deprecated.

Int

This function is deprecated.

CharSequence!
getText(resId: Int)

This function is deprecated.

Boolean

This function is deprecated.

View!

This function is deprecated.

Int

This function is deprecated.

java-static Fragment!
instantiate(context: Context!, fname: String!)

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Boolean

This function is deprecated.

Unit
onActivityCreated(savedInstanceState: Bundle!)

This function is deprecated.

Unit
onActivityResult(requestCode: Int, resultCode: Int, data: Intent!)

This function is deprecated.

Unit
onAttach(context: Context!)

This function is deprecated.

Unit
onAttachFragment(childFragment: Fragment!)

This function is deprecated.

Unit

This function is deprecated.

Boolean

This function is deprecated.

Unit
onCreate(savedInstanceState: Bundle!)

This function is deprecated.

Animator!
onCreateAnimator(transit: Int, enter: Boolean, nextAnim: Int)

This function is deprecated.

Unit
onCreateContextMenu(
    menu: ContextMenu!,
    v: View!,
    menuInfo: ContextMenu.ContextMenuInfo!
)

This function is deprecated.

Unit
onCreateOptionsMenu(menu: Menu!, inflater: MenuInflater!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

LayoutInflater!
onGetLayoutInflater(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onInflate(attrs: AttributeSet!, savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit
onMultiWindowModeChanged(
    isInMultiWindowMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onPictureInPictureModeChanged(
    isInPictureInPictureMode: Boolean,
    newConfig: Configuration!
)

This function is deprecated.

Unit

This function is deprecated.

Unit
onRequestPermissionsResult(
    requestCode: Int,
    permissions: Array<String!>!,
    grantResults: IntArray!
)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
onTrimMemory(level: Int)

This function is deprecated.

Unit
onViewCreated(view: View!, savedInstanceState: Bundle!)

This function is deprecated.

Unit
onViewStateRestored(savedInstanceState: Bundle!)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
requestPermissions(permissions: Array<String!>!, requestCode: Int)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setMenuVisibility(menuVisible: Boolean)

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit

This function is deprecated.

Unit
setTargetFragment(fragment: Fragment!, requestCode: Int)

This function is deprecated.

Unit
setUserVisibleHint(isVisibleToUser: Boolean)

This function is deprecated.

Boolean

This function is deprecated.

Unit

This function is deprecated.

Unit
startActivityForResult(intent: Intent!, requestCode: Int)

This function is deprecated.

Unit
startIntentSenderForResult(
    intent: IntentSender!,
    requestCode: Int,
    fillInIntent: Intent!,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle!
)

This function is deprecated.

Unit

This function is deprecated.

String!

This function is deprecated.

Unit

This function is deprecated.

Public constructors

VerticalGridFragment

Added in 1.1.0
Deprecated in 1.1.0
VerticalGridFragment()

Public functions

getAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun getAdapter(): ObjectAdapter?

Returns the object adapter.

getGridPresenter

Added in 1.1.0
Deprecated in 1.1.0
fun getGridPresenter(): VerticalGridPresenter?

Returns the grid presenter.

getOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun getOnItemViewClickedListener(): OnItemViewClickedListener?

Returns the item clicked listener.

onCreateView

Added in 1.1.0
Deprecated in 1.1.0
fun onCreateView(
    inflater: LayoutInflater!,
    container: ViewGroup?,
    savedInstanceState: Bundle!
): View?

onDestroyView

fun onDestroyView(): Unit

onStart

fun onStart(): Unit

setAdapter

Added in 1.1.0
Deprecated in 1.1.0
fun setAdapter(adapter: ObjectAdapter?): Unit

Sets the object adapter for the fragment.

setGridPresenter

Added in 1.1.0
Deprecated in 1.1.0
fun setGridPresenter(gridPresenter: VerticalGridPresenter): Unit

Sets the grid presenter.

setOnItemViewClickedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewClickedListener(listener: OnItemViewClickedListener?): Unit

Sets an item clicked listener.

setOnItemViewSelectedListener

Added in 1.1.0
Deprecated in 1.1.0
fun setOnItemViewSelectedListener(listener: OnItemViewSelectedListener?): Unit

Sets an item selection listener.

setSelectedPosition

Added in 1.1.0
Deprecated in 1.1.0
fun setSelectedPosition(position: Int): Unit

Sets the selected item position.

Protected functions

createEntranceTransition

protected fun createEntranceTransition(): Any

Create entrance transition. Subclass can override to load transition from resource or construct manually. Typically app does not need to override the default transition that browse and details provides.

runEntranceTransition

protected fun runEntranceTransition(entranceTransition: Any?): Unit

Run entrance transition. Subclass may use TransitionManager to perform go(Scene) or beginDelayedTransition(). App should not override the default implementation of browse and details fragment.