목록ViewPager2 (4)
Foggy day
private fun setViewPager2Height(){ viewPager2.setPageTransformer { page, position -> updatePagerHeightForChild(page, viewPager2) } } private fun updatePagerHeightForChild(view: View, pager: ViewPager2) { view.post { val wMeasureSpec = View.MeasureSpec.makeMeasureSpec(view.width, View.MeasureSpec.EXACTLY) val hMeasureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED) view.me..

6. QuestionFragment Here, i used ViewPager2, RecyclerView, and EventBus. - fragment_survey_question.xml - SurveyQuestionFragment The thing to note here is EventBus. To use EnvetBus, you should add register, unregister, and @Subscribe. Register EventBus in onCreate, unregister onDestroy, and make a method with @Subscribe annotation, parameter. class SurveyQuestionFragment : Fragment(), View.OnCli..

This article is question example using assets file. The purpose of creation is to make a survey Form requires a variety of questions and answers The used things are Assets File(Json), Viewpager2, RecyclerView, Fragment navigation graph, Gson, ViewBinding, Parcelize, EventBus and so on. Video 1. package structure - survey_nav_graph.xml 2. Navigation graph container activity - ViewPagerQuestionBas..
when there is Viewpager2 inside Viewpager2, ViewPager2 inside can't be swiped. You can see explanation of it in Google Doc. developer.android.com/training/animation/vp2-migration#nested-scrollables Support nested scrollable elements ViewPager2 does not natively support nested scroll views in cases where the scroll view has the same orientation as the ViewPager2 object that contains it. For examp..