tommybuonomo / dotsindicator

Three material Dots Indicators for view pagers in Android !
Apache License 2.0
3.44k stars 353 forks source link

I don't understand how make this view in programmaticle. #116

Closed jamal-wia closed 3 years ago

jamal-wia commented 3 years ago

val dotsIndicator = DotsIndicator(parent.context).apply { id = View.generateViewId() layoutParams = LinearLayout.LayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT ).apply { setMargins(0, 8.toDpInt(), 0, 0) } setHorizontalGravity(Gravity.CENTER) setViewPager2(viewPager) }

But don't display anything

jamal-wia commented 3 years ago

I can resolve this problem. You need call in post { }