How to collapse/expand a view based on scroll direction?

前端 未结 4 1858
一整个雨季
一整个雨季 2020-12-11 04:39

I have a View and a RecyclerView housed in a LinearLayout. What I want to achieve is something like this:

https://material.google.com/patterns/scrolling-techniques.h

4条回答
  •  没有蜡笔的小新
    2020-12-11 04:40

    You have to use Coordinator Layout with the CollapsingToolbarLayout

    
    
    
    
         //HERE you should take a look what you want your collapse bar do.
    
            
    
            
        
    
    
    
    
        
    
    
    

    Obs: the comments will give errors if you put on a xml file. Is on propose so you will remember to read hahahah

提交回复
热议问题