1

I try to set MaterialShowcaseView in ViewPager but it not work . I use this library for showcase https://github.com/deano2390/MaterialShowcaseView

I call presentShowcaseSequence() in onCreate() but it's not working.

Here is my code for it:-

<RelativeLayout
    android:id="@+id/relforswipe"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/examBtnLayout"
    android:layout_below="@+id/exam_toolbar_top"
    android:padding="5dp">

    <android.support.v4.view.ViewPager
        android:id="@+id/examViewPager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</RelativeLayout>

ExamActivity.kt :-

private fun presentShowcaseSequence() {

    val config = ShowcaseConfig()
    config.delay = 500

    val sequence = MaterialShowcaseSequence(this, SHOWCASE_ID)
    sequence.setConfig(config)

    sequence.setOnItemShownListener(object : MaterialShowcaseSequence.OnSequenceItemShownListener {
        override fun onShow(itemView: MaterialShowcaseView, position: Int) {
        }
    })

    sequence.addSequenceItem(
            MaterialShowcaseView.Builder(this)
                    .setTarget(examViewPager)
                    .setDismissText(R.string.next)
                    .setTitleText(R.string.questions)
                    .withRectangleShape()
                    .setContentText(R.string.input_question)
                    .build()
    )
    sequence.start()
}

0 Answers0