Created
October 14, 2019 14:51
-
-
Save muzafakar/cb199a2c2cc2fc8656fe77cc26a77d4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private lateinit var adpOnBoarding: AdpOnBoarding | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
adpOnBoarding = AdpOnBoarding(supportFragmentManager, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) | |
tlDotsContainer.setupWithViewPager(vpOnBoarding) | |
vpOnBoarding.adapter = adpOnBoarding | |
initOnBoarding() | |
} | |
private fun initOnBoarding() { | |
val walkingOnBoarding = OnBoardingItemFragment().apply { | |
arguments = bundleOf( | |
OnBoardingItemFragment.LOTTIE to R.raw.walking, | |
OnBoardingItemFragment.TEXT to R.string.walking | |
) | |
} | |
val meetingOnBoarding = OnBoardingItemFragment().apply { | |
arguments = bundleOf( | |
OnBoardingItemFragment.LOTTIE to R.raw.meeting, | |
OnBoardingItemFragment.TEXT to R.string.meeting | |
) | |
} | |
adpOnBoarding.addItem(walkingOnBoarding) | |
adpOnBoarding.addItem(meetingOnBoarding) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment