package org.gdg.frisbee.android.view;

import android.support.design.widget.Snackbar;
import android.view.View;

/**
 * Created by paresh.mayani on 21-07-2015.
 */
public class ColoredSnackBar {

    private static final int red = 0xfff44336;
    private static final int green = 0xff4caf50;
    private static final int blue = 0xff2195f3;
    private static final int orange = 0xffffc107;

    private ColoredSnackBar() {
    }

    private static View getSnackBarLayout(Snackbar snackbar) {
        if (snackbar != null) {
            return snackbar.getView();
        }
        return null;
    }

    private static Snackbar colorSnackBar(Snackbar snackbar, int colorId) {
        View snackBarView = getSnackBarLayout(snackbar);
        if (snackBarView != null) {
            snackBarView.setBackgroundColor(colorId);
        }

        return snackbar;
    }

    public static Snackbar info(Snackbar snackbar) {
        return colorSnackBar(snackbar, blue);
    }

    public static Snackbar warning(Snackbar snackbar) {
        return colorSnackBar(snackbar, orange);
    }

    public static Snackbar alert(Snackbar snackbar) {
        return colorSnackBar(snackbar, red);
    }

    public static Snackbar confirm(Snackbar snackbar) {
        return colorSnackBar(snackbar, green);
    }
}

@@ -233,13 +233,13 @@
 xfff
+f
 44
-336
+44
 ;%0A  
@@ -281,13 +281,13 @@
 0xff
-4caf5
+99cc0
 0;%0A 
@@ -329,14 +329,14 @@
 0xff
-2195f3
+33b5e5
 ;%0A  

color code same as crouton style