androidlistenerpanelandroid-sliding

Listener for checking the state of SlidingUpPanel


I want to change the visblity of an item when AndroidSlidingUpPanel is expanded to full screen.Is there any listener which detects whether sliding panel is full screen?I tried using this but didn't worked-

slidingPaneLayout.setOnDragListener(new View.OnDragListener() {
            @Override
            public boolean onDrag(View v, DragEvent event) {
                if(slidingPaneLayout.getPanelHeight()>700)
                belowarrow.setVisibility(View.GONE);
                return true;
            }
        });

Solution

  •  slidingPaneLayout.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
                @Override
                public void onPanelSlide(View view, float v) {
    
                }
    
                @Override
                public void onPanelCollapsed(View view) {
    
                  //here collapse
                }
    
                @Override
                public void onPanelExpanded(View view) {
                    //here it is in fullscreen
                }
    
                @Override
                public void onPanelAnchored(View view) {
    
                }
    
                @Override
                public void onPanelHidden(View view) {
    
                }
            });
    

    Here you go and i hope it will help