package com.andela.iworkout.utilities;


import android.content.Context;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.Toast;

/**
 * author: Kehinde Ogunde
 */
public class MsgBox {
    private static Toast toast;
    private static Snackbar snackbar;

    public static void show(Context context, String message) {
        if (toast != null) {
            toast.cancel();
        }

        toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
        toast.show();
    }

    public static void show(View view, String message, String action, View.OnClickListener clickListener) {
        if (snackbar != null) {
            snackbar.dismiss();
        }

        snackbar = Snackbar.make(view, message, Snackbar.LENGTH_LONG).setAction(action, clickListener);
        snackbar.show();
    }
}

@@ -132,13 +132,124 @@
 oid.
-view.
+support.v7.app.AlertDialog;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.widget.Text
 View
@@ -280,16 +280,47 @@
 Toast;%0A%0A
+import com.andela.iworkout.R;%0A%0A
 /**%0A * a
@@ -985,11 +985,639 @@
 );%0A    %7D
+%0A%0A    public static AlertDialog show(Context context, String message, View.OnClickListener listener, boolean cancelable) %7B%0A        AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);%0A        View dialogView = LayoutInflater.from(context).inflate(R.layout.completed_pushup, null);%0A        dialogBuilder.setView(dialogView);%0A        dialogBuilder.setCancelable(cancelable);%0A%0A        TextView messageView = (TextView) dialogView.findViewById(R.id.message);%0A        messageView.setText(message);%0A        dialogView.findViewById(R.id.gotit).setOnClickListener(listener);%0A        return dialogBuilder.create();%0A    %7D
 %0A%7D%0A

Add dialog popup to MsgBox class