protected ArrayList<Integer> calculateHeightsForAnimationParts(int titleViewHeight,int contentViewHeight,int additionalFlipsCount){
  ArrayList<Integer> partHeights=new ArrayList<>();
  int additionalPartsTotalHeight=contentViewHeight - titleViewHeight * 2;
  if (additionalPartsTotalHeight < 0)   throw new IllegalStateException("Content View height is too small");
  partHeights.add(titleViewHeight);
  partHeights.add(titleViewHeight);
  if (additionalPartsTotalHeight == 0)   return partHeights;
  if (additionalFlipsCount != 0) {
    int additionalPartHeight=additionalPartsTotalHeight / additionalFlipsCount;
    int remainingHeight=additionalPartsTotalHeight % additionalFlipsCount;
    if (additionalPartHeight + remainingHeight > titleViewHeight)     throw new IllegalStateException("Additional flips count is too small");
    for (int i=0; i < additionalFlipsCount; i++)     partHeights.add(additionalPartHeight + (i == 0 ? remainingHeight : 0));
  }
 else {
    int partsCount=additionalPartsTotalHeight / titleViewHeight;
    int restPartHeight=additionalPartsTotalHeight % titleViewHeight;
    for (int i=0; i < partsCount; i++)     partHeights.add(titleViewHeight);
    if (restPartHeight > 0)     partHeights.add(restPartHeight);
  }
  return partHeights;
}

protected ArrayList < Integer > calculateHeightsForAnimationParts ( int titleViewHeight , int contentViewHeight , int additionalFlipsCount ) { ArrayList < Integer > partHeights = new ArrayList < > ( ) ; int additionalPartsTotalHeight = contentViewHeight - titleViewHeight * 2 ; if ( additionalPartsTotalHeight < 0 ) throw new IllegalStateException ( "Content View height is too small" ) ; partHeights . add ( titleViewHeight ) ; partHeights . add ( titleViewHeight ) ; if ( additionalPartsTotalHeight == 0 ) return partHeights ; if ( additionalFlipsCount != 0 ) { int additionalPartHeight = additionalPartsTotalHeight / additionalFlipsCount ; int remainingHeight = additionalPartsTotalHeight % additionalFlipsCount ; if ( additionalPartHeight + remainingHeight > titleViewHeight ) throw new IllegalStateException ( "Additional flips count is too small" ) ; for ( int i = 0 ; i < additionalFlipsCount ; i ++ ) partHeights . add ( additionalPartHeight + ( i == 0 ? remainingHeight : 0 ) ) ; } else { int partsCount = additionalPartsTotalHeight / titleViewHeight ; int restPartHeight = additionalPartsTotalHeight % titleViewHeight ; for ( int i = 0 ; i < partsCount ; i ++ ) partHeights . add ( titleViewHeight ) ; if ( restPartHeight > 0 ) partHeights . add ( restPartHeight ) ; } return partHeights ; }
calculate heights for animation parts with some logic todo : add detailed descriptions for logic
