public void animateHeart ( View imageLovedOn , View imageLovedOff , boolean on ) { imageLovedOn . setVisibility ( View . VISIBLE ) ; imageLovedOff . setVisibility ( View . VISIBLE ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . HONEYCOMB_MR1 ) { viewPropertyStartCompat ( imageLovedOff . animate ( ) . scaleX ( on ? 0 : 1 ) . scaleY ( on ? 0 : 1 ) . alpha ( on ? 0 : 1 ) ) ; viewPropertyStartCompat ( imageLovedOn . animate ( ) . scaleX ( on ? 1 : 0 ) . scaleY ( on ? 1 : 0 ) . alpha ( on ? 1 : 0 ) ) ; } }
helper method to animate the heart view