Buggy code:
public class PlaylistViewHolderExpanderHelper { private Context mContext ; private ItemCursorAdapter mAdapter ; private int mExpandedHeight ; private AnimatorSet mAnimatorSet = new AnimatorSet ( ) ; private LinkedList < Animator > mAnimatorCollection = new LinkedList < > ( ) ; private int mSmallButtonSize ; private int mLargeButtonSize ; private LayoutParams paramsRecyclerView ; private RelativeLayout . LayoutParams paramsBackground ; private ViewGroup . LayoutParams paramsButton ; private static int offset = 200 ; public static PlaylistViewHolder expandedView = null ; public static RelativeLayoutWithBackground expandedLayout = null ; public PlaylistViewHolderExpanderHelper ( @ NonNull Context argContext , @ NonNull ItemCursorAdapter argAdapter , int argExpandedHeight ) { } public void expand ( final PlaylistViewHolder viewHolder , final boolean isAnimated , final boolean forceRefresh ) { } public void newAnimator ( ) { } public void playAnimator ( ) { } public void collapse ( final PlaylistViewHolder viewHolder , final boolean isAnimated ) { } private int caclButtonOffset ( PlayerLinearLayout argPlayer ) { } private void expand ( final PlaylistViewHolder viewHolder ) { final PlayerLinearLayout player = viewHolder . playerLinearLayout ; final RelativeLayoutWithBackground layoutWithBackground = viewHolder . mLayout ; final ImageView layoutBackground = viewHolder . mItemBackground ; final int imageStartHeight = layoutBackground . getHeight ( ) ; layoutWithBackground . measure ( MATCH_PARENT , WRAP_CONTENT ) ; int initialMeasuredHeight = layoutWithBackground . getMeasuredHeight ( ) ; player . measure ( MATCH_PARENT , WRAP_CONTENT ) ; int initialPlayerMeasuredHeight = player . getMeasuredHeight ( ) ; player . requestLayout ( ) ; player . setVisibility ( VISIBLE ) ; caclButtonOffset ( player ) ; int c = ( viewHolder . mPlayPauseButton . getBottom ( ) ) - ( viewHolder . mPlayPauseButton . getTop ( ) ) ; <START_BUG> PlaylistViewHolderExpanderHelper . offset = imageStartHeight - c ; <END_BUG> final int targtetHeight = initialPlayerMeasuredHeight + imageStartHeight ; mExpandedHeight = targtetHeight ; layoutBackground . getLayoutParams ( ) . height = viewHolder . mMainContainer . getMeasuredHeight ( ) ; int duration = getDuration ( targtetHeight ) ; if ( ( PlaylistViewHolderExpanderHelper . minHeight ) < 0 ) { PlaylistViewHolderExpanderHelper . minHeight = imageStartHeight ; PlaylistViewHolderExpanderHelper . maxHeight = targtetHeight ; } final PlaylistViewHolderExpanderHelper . Incrementer inc = new PlaylistViewHolderExpanderHelper . Incrementer ( ) ; final PlaylistViewHolderExpanderHelper . Incrementer buttonInc = new PlaylistViewHolderExpanderHelper . Incrementer ( ) ; final PlaylistViewHolderExpanderHelper . Incrementer buttonTrans = new PlaylistViewHolderExpanderHelper . Incrementer ( ) ; ObjectAnimator animator ; ObjectAnimator buttonAnimator ; ObjectAnimator buttonTransAnimator = ObjectAnimator . ofInt ( buttonTrans , "interp" , 0 , PlaylistViewHolderExpanderHelper . offset ) ; if ( ( PlaylistViewHolderExpanderHelper . minHeight ) > 0 ) { Log . d ( "PlaylistViewHolderExpanderHelper" , ( "expand<seq2seq4repair_space>goal<seq2seq4repair_space>=><seq2seq4repair_space>" + ( PlaylistViewHolderExpanderHelper . maxHeight ) ) ) ; animator = ObjectAnimator . ofInt ( inc , "interp" , PlaylistViewHolderExpanderHelper . minHeight , PlaylistViewHolderExpanderHelper . maxHeight ) ; } else { animator = ObjectAnimator . ofInt ( inc , "interp" , imageStartHeight , initialMeasuredHeight ) ; PlaylistViewHolderExpanderHelper . minHeight = imageStartHeight ; PlaylistViewHolderExpanderHelper . maxHeight = initialMeasuredHeight ; } animator . setDuration ( duration ) ; buttonTransAnimator . setDuration ( duration ) ; final RecyclerView . LayoutParams paramsT1 = ( ( RecyclerView . LayoutParams ) ( viewHolder . mLayout . getLayoutParams ( ) ) ) ; final RelativeLayout . LayoutParams paramsT2 = ( ( RelativeLayout . LayoutParams ) ( viewHolder . mItemBackground . getLayoutParams ( ) ) ) ; final ViewGroup . LayoutParams paramsButton = viewHolder . mPlayPauseButton . getLayoutParams ( ) ; buttonAnimator = ObjectAnimator . ofInt ( buttonInc , "interp" , mSmallButtonSize , mLargeButtonSize ) ; buttonAnimator . setDuration ( duration ) ; buttonAnimator . addUpdateListener ( getButtonUpdateListener ( viewHolder , paramsButton , buttonInc , buttonTrans ) ) ; animator . addUpdateListener ( getUpdateListener ( viewHolder , inc , paramsT1 , paramsT2 ) ) ; animator . addListener ( new Animator . AnimatorListener ( ) { @ Override public void onAnimationStart ( Animator animator ) { } @ Override public void onAnimationEnd ( Animator animator ) { mExpandedHeight = PlaylistViewHolderExpanderHelper . maxHeight ; Log . d ( "PlaylistViewHolderExpanderHelper" , ( ( ( "END<seq2seq4repair_space>animator" + ( viewHolder . episode . getTitle ( ) ) ) + "<seq2seq4repair_space>new<seq2seq4repair_space>Height:" ) + ( viewHolder . mLayout . getLayoutParams ( ) . height ) ) ) ; viewHolder . mAdapter . toggleItem ( viewHolder . episode . getId ( ) ) ; } @ Override public void onAnimationCancel ( Animator animator ) { } @ Override public void onAnimationRepeat ( Animator animator ) { } } ) ; mAnimatorCollection . add ( animator ) ; mAnimatorCollection . add ( buttonAnimator ) ; mAnimatorCollection . add ( buttonTransAnimator ) ; PlaylistViewHolderExpanderHelper . expandedView = viewHolder ; PlaylistViewHolderExpanderHelper . expandedLayout = layoutWithBackground ; } private static int minHeight = - 1 ; private static int maxHeight = - 1 ; private void collapse ( final PlaylistViewHolder viewHolder ) { } private AnimatorUpdateListener getButtonUpdateListener ( @ NonNull final PlaylistViewHolder viewHolder , @ NonNull final ViewGroup . LayoutParams paramsButton , @ NonNull final PlaylistViewHolderExpanderHelper . Incrementer buttonInc , @ NonNull final PlaylistViewHolderExpanderHelper . Incrementer buttonTransInc ) { } private AnimatorUpdateListener getUpdateListener ( @ NonNull final PlaylistViewHolder viewHolder , @ NonNull final PlaylistViewHolderExpanderHelper . Incrementer inc , @ NonNull final RecyclerView . LayoutParams paramsRecyclerView , @ NonNull final RelativeLayout . LayoutParams paramsBackground ) { } private int getDuration ( int argHeight ) { } class Incrementer { private int mInterp = - 1 ; public void setInterp ( int newInterp ) { } public int getInterp ( ) { } } }

Fix:
PlaylistViewHolderExpanderHelper . offset = ( imageStartHeight - c ) + ( ( player . getPaddingTop ( ) ) // 2 ) ;