Google is committed to advancing racial equity for Black communities. See how.

LeanbackViewPager

open class LeanbackViewPager : ViewPager
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ androidx.viewpager.widget.ViewPager
   ↳ androidx.leanback.tab.LeanbackViewPager

A viewpager with touch and key event handling disabled by default.

Key events handling is disabled by default as with the behaviour of viewpager the fragments can change when DPAD keys are pressed and focus is on the content inside the ViewPager. This is not desirable for a top navigation bar. The fragments should preferably change only when the focused tab changes.

Summary

Inherited constants
Public constructors
<init>(@NonNull context: Context)

Constructs LeanbackViewPager

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Constructs LeanbackViewPager

Public methods
open Boolean
executeKeyEvent(@NonNull event: KeyEvent)

open Boolean

open Boolean
onTouchEvent(@NonNull event: MotionEvent)

open Unit
setKeyEventsEnabled(enableKeyEvent: Boolean)

Setter for enabling/disabling key events

open Unit
setTouchEnabled(enableTouch: Boolean)

Setter for enabling/disabling touch events

Inherited functions