@ NonNull public static SlidrInterface replace ( @ NonNull final View oldScreen , @ NonNull final SlidrConfig config ) { ViewGroup parent = ( ViewGroup ) oldScreen . getParent ( ) ; ViewGroup . LayoutParams params = oldScreen . getLayoutParams ( ) ; parent . removeView ( oldScreen ) ; // Setup the slider panel and attach it final SliderPanel panel = new SliderPanel ( oldScreen . getContext ( ) , oldScreen , config ) ; panel . setId ( R . id . slidable_panel ) ; oldScreen . setId ( R . id . slidable_content ) ; panel . addView ( oldScreen ) ; parent . addView ( panel , 0 , params ) ; // Set the panel slide listener for when it becomes closed or opened panel . setOnPanelSlideListener ( new FragmentPanelSlideListener ( oldScreen , config ) ) ; // Return the lock interface return panel . getDefaultInterface ( ) ; }
Attach a slider mechanism to a fragment view replacing an internal view