package xyz.igorgee.utilities;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.design.widget.Snackbar;
import android.view.View;

public class UIUtilities {
    
    public static void makeSnackbar(View view, int stringID) {
        makeSnackbar(view, stringID, Snackbar.LENGTH_SHORT, null);
    }

    public static void makeSnackbar(View view, String content) {
        makeSnackbar(view, content, Snackbar.LENGTH_SHORT, null);
    }

    public static void makeSnackbar(View view, int stringID, int duration) {
        makeSnackbar(view, stringID, duration, null);
    }

    public static void makeSnackbar(View view, String content, int duration) {
        makeSnackbar(view, content, duration, null);
    }

    public static void makeSnackbar(View view, int stringID, int duration, String confirm) {
        Snackbar.make(view, stringID, duration)
                .setAction(confirm != null ? confirm : "Ok", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {

                    }
                }).show();
    }

    public static void makeSnackbar(View view, String content, int duration, String confirm) {
        Snackbar.make(view, content, duration)
                .setAction(confirm != null ? confirm : "Ok", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {

                    }
                }).show();
    }

    public static void makeAlertDialog(Context context, String message, int iconID) {
        new AlertDialog.Builder(context)
                .setTitle("Image Information")
                .setMessage(message)
                .setPositiveButton("Okay", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setIcon(iconID)
                .show();
    }

    public static void makeAlertDialog(Context context, String message) {
        new AlertDialog.Builder(context)
                .setTitle("Image Information")
                .setMessage(message)
                .setPositiveButton("Okay", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .show();
    }

    public static void makeAlertDialog(Context context, String message,
                                       String positiveButton, String negativeButton,
                                       int iconID) {
        new AlertDialog.Builder(context)
                .setTitle("Image Information")
                .setMessage(message)
                .setPositiveButton(positiveButton, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setNegativeButton(negativeButton, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                    }
                })
                .setIcon(iconID)
                .show();
    }
}

@@ -1571,32 +1571,46 @@
 Context context,
+ String title,
  String message,
@@ -1691,35 +1691,21 @@
 etTitle(
-%22Image Information%22
+title
 )%0A      
@@ -2313,32 +2313,46 @@
 Context context,
+ String title,
  String message)
@@ -2421,35 +2421,21 @@
 etTitle(
-%22Image Information%22
+title
 )%0A      
@@ -3010,32 +3010,46 @@
 Context context,
+ String title,
  String message,
@@ -3258,27 +3258,13 @@
 tle(
-%22Image Information%22
+title
 )%0A  

Add title to AlertDialog constructors