@@ -0,0 +1,3953 @@
+package com.ood.waterball.teampathy.Controllers.MyUtils.Dialogs;%0A%0Aimport android.content.Context;%0Aimport android.content.DialogInterface;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.v7.app.AlertDialog;%0Aimport android.view.View;%0Aimport android.widget.Button;%0A%0A%0Apublic class PostingDialog extends AlertDialog.Builder %7B%0A    private Context context;%0A    private int confirmBTNid;%0A    private int cancelBTNid;%0A    private int confirmStrid;%0A    private int cancelStrid;%0A    private View view;%0A    private AlertDialog dialog;%0A    private int cancelDialogContentStringId;%0A    private int iconId;%0A    private View.OnClickListener confirmBtnListener;%0A    private View.OnClickListener cancelBtnListener;%0A%0A    public PostingDialog(@NonNull Context context) %7B%0A        super(context);%0A        this.context = context;%0A    %7D%0A%0A    public AlertDialog.Builder setConfirmButtonId(int confirmBTNid) %7B%0A        this.confirmBTNid = confirmBTNid;%0A        return this;%0A    %7D%0A%0A    public AlertDialog.Builder setCancelButtonId(int cancelBTNid) %7B%0A        this.cancelBTNid = cancelBTNid;%0A        return this;%0A    %7D%0A%0A    public AlertDialog.Builder setCancelDialogContentStringId(int cancelDialogContentStringId) %7B%0A        this.cancelDialogContentStringId = cancelDialogContentStringId;%0A        return this;%0A    %7D%0A%0A    public AlertDialog.Builder setConfirmStringId(int confirmStrid) %7B%0A        this.confirmStrid = confirmStrid;%0A        return this;%0A    %7D%0A%0A    public AlertDialog.Builder setCancelStringId(int cancelStrid) %7B%0A        this.cancelStrid = cancelStrid;%0A        return this;%0A    %7D%0A%0A    public AlertDialog.Builder setIcon(int iconId) %7B%0A        this.iconId = iconId;%0A        return super.setIcon(iconId);%0A    %7D%0A%0A    @Override%0A    public AlertDialog.Builder setView(View view) %7B%0A        this.view = view;%0A        return super.setView(view);%0A    %7D%0A%0A    @Override%0A    public AlertDialog create() %7B%0A        dialog = super.create();%0A        setButtonsListener();%0A        return dialog;%0A    %7D%0A%0A    protected void setButtonsListener()%7B%0A        Button confirmButton = (Button) view.findViewById(confirmBTNid);%0A        Button cancelButton = (Button) view.findViewById(cancelBTNid);%0A        if (confirmBtnListener == null)%0A            confirmButton.setOnClickListener(new View.OnClickListener() %7B%0A                @Override%0A                public void onClick(View view) %7B%0A                    dialog.dismiss();%0A                %7D%0A            %7D);%0A        if ( cancelBtnListener == null )%0A            cancelButton.setOnClickListener(new View.OnClickListener() %7B%0A                @Override%0A                public void onClick(View view) %7B%0A                    AlertDialog.Builder builder = new AlertDialog.Builder(context);%0A                    if ( iconId != 0 )%0A                        builder.setIcon(iconId);%0A                    if ( cancelDialogContentStringId != 0 )%0A                        builder.setTitle(cancelDialogContentStringId);%0A                    if ( confirmStrid != 0 )%0A                        builder.setPositiveButton(context.getString(confirmStrid), new DialogInterface.OnClickListener() %7B%0A                            @Override%0A                            public void onClick(DialogInterface dialogInterface, int i) %7B%0A                                dialog.dismiss();%0A                            %7D%0A                        %7D);%0A                    if ( cancelStrid != 0 )%0A                        builder.setNegativeButton(context.getString(cancelStrid), new DialogInterface.OnClickListener() %7B%0A                            @Override%0A                            public void onClick(DialogInterface dialogInterface, int i) %7B%7D%0A                        %7D).show();%0A                %7D%0A            %7D);%0A    %7D%0A%0A    protected void setConfirmButtonListener(View.OnClickListener listener)%7B%0A        this.confirmBtnListener = listener;%0A    %7D%0A%0A    protected void setCancelButtonListener(View.OnClickListener listener)%7B%0A        this.cancelBtnListener = listener;%0A    %7D%0A%0A%0A%7D%0A

add posting dialog