Reputation: 369
I have been searching for a solution on how to make a parallax scrolling UI just like on the Instagram Profile page.
Imageview parallax example
I couldn't find any other clear solution to this. Is there a way to implement this layout?
Of course, there is since Instagram did it already but how :D
Thank you in advance for all your answers.
Upvotes: 1
Views: 695
Reputation: 369
I have implemented a parallax scrolling layout by checking out couple of repos. I saw @evgenkr47's answer after I implemented it but his answer totally right also. Thank you again.
Here is the layout, maybe anyone else also needs it in the future.
Upvotes: 0
Reputation: 21
You can use CoordinationLayout + AppBarLayout + CollapsingToolBarLayout inside ConstraintLayout
For example:
<ConstraintLayout1>
<ToolBar-> profile nickname
<CoordinationLayout>
<AppBarLayout>
<CollapsingToolBarLayout>
<ConstraintLayout2> - hidden part
--Hidden content--
</ConstraintLayout2>
<ConstrainLayout3>
<TabLayout/> - will stick to the toolbar
<FragmentContainerView/>
</ConstrainLayout3>
</CollapsingToolBarLayout>
</AppBarLayout>
</CoordinationLayout>
</ConstraintLayout1>
Upvotes: 2