Collapsing ToolBar Layout with viewpager

前端 未结 5 1129
旧时难觅i
旧时难觅i 2021-02-02 12:43

I am using CollapsingBarLayout with viewpager and the fragments of viewpager are having listview, gridview.

Here is my code:

    

        
5条回答
  •  灰色年华
    2021-02-02 13:22

    i have achieved this i will put my code with the library used firstly this is the layout file

    
    
    
    
        
    
        
    
            
    
        
    
        
    
            
    
        
    
    
    
    
    
    
    
        
    
        
    
            
    
                
    
                
    
                    
                
    
                
    
                    
                
    
                
    
                
    
            
    
            
    
                
                
                
                
                
                
                
                
                
    
                
                
    
                    
    
                        
    
                            
                        
    
                        
    
                            
                        
    
                        
    
                            
                        
    
                        
    
                            
                        
    
                    
    
                    
                
            
    
        
    
    
    

    and in the java code you should add this

      StikkyHeaderBuilder.ListViewBuilder.stickTo(mListView)
                    .setHeader(R.id.header, (ViewGroup) contentView)
                    .minHeightHeaderDim(R.dimen.min_height_textheader_materiallike)
                    .animator(new ParallaxStikkyAnimator())
                    .attatch_Acitivty(Attractions.this)
                    .castTo("Attractions")
                    .build();
    

    and here is the library used

    but i have modified this library to work as i want

    the modification is add method in stcikylistview builder to know the activity used and pass a delegate for scrolling i used this because i added a blur for images in the viewpager

    and her is my modification

    i will upload the modified version of the library here you are https://drive.google.com/file/d/0BxdN8PyW5nmHMmFFeFY2aW9zdlk/view?usp=sharing

提交回复
热议问题