Я хочу создать макет, как показано ниже:
A КоординаторLayout, который содержит:
- CollapsingToolbarLayout (содержит ImageView и панель инструментов)
- RecyclerView
- TabLayout
- ViewPager (каждый фрагмент содержит RecyclerView)
Я хочу отвечать на события прокрутки таким образом:
- CollapsingToolbarLayout расширяется и сворачивается при прокрутке
- Панель инструментов располагается сверху, пока TabLayout не достигнет вершины
- После этого панель инструментов прокрутится вверх и TabLayout вернется в начало
У меня возникают проблемы с RecyclerView между CollapsingToolbarLayout и TabLayout. Я могу реализовать этот макет без этого RecyclerView (я ставлю CollapsingToolbarLayout и TabLayout внутри AppBarLayout и ViewPager за его пределами внутри CoordinatorLayout).
Мой вопрос:
- Где я должен поместить этот RecyclerView?
- Какой и где
layout_scrollFlags
иlayout_behavior
следует установить для каждого макета?
Кажется, что AppBarLayout имеет ограниченную высоту. Когда я кладу RecyclerView внутри AppBarLayout, только часть части RecyclerView видна, а также TabLayout исчезает.
Я прочитал много учебников, таких как этот и множество вопросов, таких как этот и этот, но они не помогают мне.