Calendar and PagerAdapter - Unlimited Views

后端 未结 2 614
遇见更好的自我
遇见更好的自我 2021-02-02 18:13

In my activity, I\'m using ViewPager to swipe left/right and show month view accordingly. I\'m passing the month and year values from onCreate to the PagerAdapter:<

2条回答
  •  名媛妹妹
    2021-02-02 18:49

    I'm not sure i understand this (never used this viewPager, have always used another HorizontalViewSlider instead), but for your onPageScrollStateChanged() why do you have a special case for focusedPage==0 and focusedPage==2 ?

    if nothing is special about Jan and March, maybe remove everything inside onPageScrollStateChanged() ?

    my guess is that the flickering is from when you call setGridCellAdapter() because that will refresh the page from calling notifyDataSetChanged.

提交回复
热议问题