Show toolbar when view pager is swiped. [CoordinatorLayout]

前端 未结 2 1230
长情又很酷
长情又很酷 2021-01-22 19:49

in my app I am using a viewpager with 3 fragments. In two of those I have recuclerviews. I took advatngage of the new Coordinator layout and made my toolbar hides/shows when scr

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-22 20:09

    You should be able to do this using the ViewPager.OnPageChangedListener and based on the page u are on which u can get from the onPageSelected(int position) method that is part of the listener. Hope this is what u are looking for.

提交回复
热议问题