public void unfold ( View coverView , View detailsView ) { if ( this . coverView == coverView && this . detailsView == detailsView ) { scrollToPosition ( 1 ) ; // Starting unfold animation return ; } if ( ( this . coverView != null && this . coverView != coverView ) || ( this . detailsView != null && this . detailsView != detailsView ) ) { // Cover or details view is differ - closing details and schedule reopening scheduledCoverView = coverView ; scheduledDetailsView = detailsView ; foldBack ( ) ; return ; } // Enabling children clipping, it will be needed if cover view is bigger then half // of details view, see CoverHolderLayout#onMeasyre() method. ViewGroup parent = ( ViewGroup ) getParent ( ) ; // In old versions we can't know if children clipping is enabled, we'll assume it's enabled origClipChildren = true ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR2 ) { origClipChildren = parent . getClipChildren ( ) ; } parent . setClipChildren ( false ) ; // Initializing foldable views setCoverViewInternal ( coverView ) ; setDetailsViewInternal ( detailsView ) ; setAdapter ( adapter ) ; setState ( STATE_UNFOLDING ) ; scrollToPosition ( 1 ) ; // starting unfold animation }
Starting unfold animation for given views .