package com.ae.apps.common.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

/**
 * Utility class to show dialogs
 * 
 * @author Midhun
 * 
 */
public class DialogUtils {

	/**
	 * Displays a basic dialog with a button
	 * 
	 * @param context
	 * @param titleResourceId
	 * @param messageResourceId
	 */
	public static void showWithMessageAndOkButton(final Context context, int titleResourceId, int messageResourceId,
			int buttonResourceId) {
		AlertDialog.Builder builder = new AlertDialog.Builder(context)
			.setCancelable(true)
			.setTitle(titleResourceId)
			.setMessage(messageResourceId)
			.setPositiveButton(buttonResourceId, new DialogInterface.OnClickListener() {

				@Override
				public void onClick(DialogInterface dialog, int which) {
					// We shall dismiss the dialog when the ok is clicked
					dialog.dismiss();
				}
			});
		builder.show();
	}
	
	/**
	 * To display a Material Dialog box, with title, content and a button
	 * 
	 * @param context
	 * @param titleResourceId
	 * @param messageResourceId
	 * @param positiveButtonResourceId
	 */
	public static void showMaterialDialog(final Context context, int titleResourceId, int messageResourceId, 
			int positiveButtonResourceId){
		
	}
}

@@ -1157,16 +1157,20 @@
 Material
+Info
 Dialog(f
@@ -1268,17 +1268,496 @@
 ourceId)
-%7B
+ %7B%0A%09%09android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context)%0A%09%09.setCancelable(true)%0A%09%09.setTitle(titleResourceId)%0A%09%09.setMessage(messageResourceId)%0A%09%09.setPositiveButton(positiveButtonResourceId, new DialogInterface.OnClickListener() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void onClick(DialogInterface dialog, int which) %7B%0A%09%09%09%09// We shall dismiss the dialog when the positive button is clicked%0A%09%09%09%09dialog.dismiss();%0A%09%09%09%7D%0A%09%09%7D);%0A%09builder.show();
 %0A%09%09%0A%09%7D%0A%7D

add method for material dialog