Code example for RelativeLayout

Methods: getHeight, getWidth, startAnimation

0
  private void applyRotation(float start, float end) {
    m_IsAnimating = true;
 
    final float centerX = (m_Pivot == PIVOT_LEFT) ? 
        0 : ((m_Pivot == PIVOT_CENTER) ? 
            (m_FrontFace.getWidth() / 2.0f) : m_FrontFace.getWidth()) ;
    final float centerY = (m_Pivot == PIVOT_LEFT) ? 
        0 : ((m_Pivot == PIVOT_CENTER) ? 
            (m_FrontFace.getHeight() / 2.0f) : m_FrontFace.getHeight()) ;
     
    final FlipAnimation rotation = new FlipAnimation(start, end, centerX, centerY, 
        ((m_Direction==DIRECTION_VERTICAL)?false:true));
    rotation.setDuration(m_HalfAnimationDuration);
    rotation.setFillAfter(true);
     
    if (m_InterpolatorType==INTERPOLATOR_LINEAR)
      rotation.setInterpolator(new LinearInterpolator());
    else 
      rotation.setInterpolator(new AccelerateInterpolator());
     
    rotation.setAnimationListener(new HalfWayListener(m_IsFrontFacing));
     
    if (m_IsFrontFacing)
      m_FrontFace.startAnimation(rotation);
    else 
      m_BackFace.startAnimation(rotation);
  } 
	 
  private void runSecondAnimation(boolean frontFace) {