Vp2IndicatorView

class Vp2IndicatorView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_Vp2IndicatorView_Style, defStyleRes: Int = R.style.BaseVp2Indicator) : View

Vp2IndicatorView.

<com.ave.vastgui.tools.view.vp2indicatorview.Vp2IndicatorView
android:id="@+id/vp2indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="20dp"
app:indicator_item_count="3"

Since

0.2.0

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_Vp2IndicatorView_Style, defStyleRes: Int = R.style.BaseVp2Indicator)

Properties

Link copied to clipboard
private val mBitmapPaint: Paint
Link copied to clipboard

The bitmap when indicator is selected.

Link copied to clipboard

The height of mBitmapSelected and mBitmapUnSelected.

Link copied to clipboard

The width of mBitmapSelected and mBitmapUnSelected.

Link copied to clipboard

The bitmap when indicator is unselected.

Link copied to clipboard

Indicator selected color.

Link copied to clipboard

Indicator unselected color.

Link copied to clipboard

The current position of the indicator.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The radius of the indicator circle in pixels.

Link copied to clipboard

The count of the indicator item.

Link copied to clipboard

The indicator item distance in pixels.

Link copied to clipboard

The height of the indicator view.

Link copied to clipboard

The width of the indicator view.

Link copied to clipboard

Indicator style. By default the value is CIRCLE.

Link copied to clipboard
private val mSelectedPaint: Paint
Link copied to clipboard
private val mUnSelectedPaint: Paint
Link copied to clipboard
private var mViewPager2: ViewPager2?

The ViewPager2 that the Vp2IndicatorView will attach to.

Functions

Link copied to clipboard

Set the ViewPager2 that the Vp2IndicatorView will attach to.

Link copied to clipboard
protected open override fun onDraw(canvas: Canvas)
Link copied to clipboard
protected open override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
fun setBitmapSize(@IntRange(from = 0) width: Int, @IntRange(from = 0) height: Int)

Set the size of mBitmapSelected and mBitmapUnSelected.

Link copied to clipboard

Set current selected indicator item position.

Link copied to clipboard
fun setIndicatorCircleRadius(@FloatRange(from = 0.0) radius: Float)

Set indicator circle radius.

Link copied to clipboard
fun setIndicatorItemCount(@IntRange(from = 0) count: Int)

Set indicator item count.

Link copied to clipboard
fun setIndicatorItemDistance(@FloatRange(from = 0.0) distance: Float)

Set the distance of the indicator item.

Link copied to clipboard

Set indicator style.

Link copied to clipboard

Set selected bitmap, now supports BitmapDrawable , VectorDrawable , VectorDrawableCompat

Link copied to clipboard

Set indicator selected color.

Link copied to clipboard

Set Unselected bitmap, now supports BitmapDrawable , VectorDrawable , VectorDrawableCompat

Link copied to clipboard

Set indicator unselected color.

Link copied to clipboard
private fun verifyItemCount()

Verifies that the indicator item count.