app/src/main/java/com/zenappse/memorymatcher/GameGridFragment.java
private void flipCard(View cardView, Card cardToFlip) {
        FlipAnimation flipAnimation = new FlipAnimation(cardView);

        if (cardToFlip.isRed()) {
            // Card is red
            flipAnimation.setColorCard(true);
        } else {
            // Card is black
            flipAnimation.setColorCard(false);
        }

        if (cardToFlip.isFlipped()) {
            // Card is flipped over
            flipAnimation.setFlippedState(true);
            flipAnimation.reverse();
        } else {
            // Card is showing it's back face
            flipAnimation.setFlippedState(false);
        }

        cardView.startAnimation(flipAnimation);
    }
/**
     * Method to call to flip a card given the View of the card and the actual Card
     * representation object
     *
     * @param cardView   View that represents the card
     * @param cardToFlip Card object of card to flip
     */
Method to call to flip a card given the View of the card and the actual Card
representation object

@param cardView   View that represents the card
@param cardToFlip Card object of card to flip
Method to call to flip a card given the View of the card and the actual Card representation object @param cardView View that represents the card @param cardToFlip Card object of card to flip
private void flipCard(View cardView, Card cardToFlip) {
        FlipAnimation flipAnimation = new FlipAnimation(cardView);
        if (cardToFlip.isRed()) {
            flipAnimation.setColorCard(true);
        } else {
            flipAnimation.setColorCard(false);
        }
        if (cardToFlip.isFlipped()) {
            flipAnimation.setFlippedState(true);
            flipAnimation.reverse();
        } else {
            flipAnimation.setFlippedState(false);
        }
        cardView.startAnimation(flipAnimation);
    }
private void flipCard ( View cardView , Card cardToFlip ) { FlipAnimation flipAnimation = new FlipAnimation ( cardView ) ; if ( cardToFlip . isRed ( ) ) { flipAnimation . setColorCard ( true ) ; } else { flipAnimation . setColorCard ( false ) ; } if ( cardToFlip . isFlipped ( ) ) { flipAnimation . setFlippedState ( true ) ; flipAnimation . reverse ( ) ; } else { flipAnimation . setFlippedState ( false ) ; } cardView . startAnimation ( flipAnimation ) ; }
Method to call to flip a card given the View of the card and the actual Card
 representation object
Method to call to flip a card given the View of the card and the actual Card representation object
// Card is red // Card is black // Card is flipped over // Card is showing it's back face