package com.example.sadievrenseker.myapplication;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.AppCompatDrawableManager;
import android.widget.Button;

/**
 * Created by sadievrenseker on 2/15/17.
 */

public class myCard extends Button {
    int id;
    boolean isFlipped= false;
    public myCard(Context c, int id){
        super(c);
        this.id =id;
        Drawable bg,fg=null;
        bg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.back);
        if(id %8 == 1)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c1);
        if(id %8 == 2)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c2);
        if(id %8 == 3)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c3);
        if(id %8 == 4)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c4);
        if(id %8 == 5)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c5);
        if(id %8 == 6)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c6);
        if(id %8 == 7)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c7);
        if(id %8 == 0)
            fg = AppCompatDrawableManager.get().getDrawable(c,R.drawable.c8);
        setBackground(fg);
    }
}
