BasicViewPagerAppBarView

@RequiresApi(value = 23)
abstract class BasicViewPagerAppBarView @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null) : ViewPagerAppBarView

Abstract base class that extends ViewPagerAppBarView to provide enhanced management of paged suggestions or actions within an expanded AppBar.

This class adds the following key features:

  • Indicator management: Handles adding, removing, and initializing the indicator that reflects the current page in the ViewPager2.

  • Animated item removal: Supports removing items (pages) with optional animation. If animated, the view transitions to the next available page before removing the current one.

  • Indicator synchronization: Keeps the indicator state in sync with the ViewPager2's current page, even during animated item removals.

Subclasses must implement the removeItem method to define how items are actually removed from the underlying data set and view.

Parameters

context

The context in which the view is running, providing access to resources, themes, and more.

attributeSet

The set of XML attributes used to inflate the view, or null if created programmatically.

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context, attributeSet: AttributeSet? = null)

Functions

Link copied to clipboard
Link copied to clipboard
fun initIndicator(count: Int)
Link copied to clipboard
fun moveNextAndRemove(viewPager: ViewPager2, index: Int)
Link copied to clipboard
fun removeIndicator(position: Int)
Link copied to clipboard
abstract fun removeItem(index: Int)
fun removeItem(index: Int, animate: Boolean)