1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
package de.thedevstack.conversationsplus.ui.dialogs;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import de.thedevstack.conversationsplus.R;
/**
* Created by tzur on 29.09.2015.
*/
public class AbstractAlertDialog {
protected AlertDialog.Builder builder;
public AbstractAlertDialog(Context context, String title) {
this.builder = new AlertDialog.Builder(context);
this.builder.setTitle(title);
this.builder.setPositiveButton(R.string.cplus_ok, null);
}
public AbstractAlertDialog(Context context, int titleTextId) {
this(context, context.getString(titleTextId));
}
public void show() {
this.builder.show();
}
public Context getContext() {
return builder.getContext();
}
public AlertDialog.Builder setTitle(int titleId) {
return builder.setTitle(titleId);
}
public AlertDialog.Builder setTitle(CharSequence title) {
return builder.setTitle(title);
}
public AlertDialog.Builder setIcon(int iconId) {
return builder.setIcon(iconId);
}
public AlertDialog.Builder setIcon(Drawable icon) {
return builder.setIcon(icon);
}
public AlertDialog.Builder setMessage(CharSequence message) {
return builder.setMessage(message);
}
public AlertDialog.Builder setMessage(int messageId) {
return builder.setMessage(messageId);
}
public AlertDialog.Builder setIconAttribute(int attrId) {
return builder.setIconAttribute(attrId);
}
public AlertDialog.Builder setPositiveButton(int textId, DialogInterface.OnClickListener listener) {
return builder.setPositiveButton(textId, listener);
}
public AlertDialog.Builder setPositiveButton(CharSequence text, DialogInterface.OnClickListener listener) {
return builder.setPositiveButton(text, listener);
}
public AlertDialog.Builder setNegativeButton(int textId, DialogInterface.OnClickListener listener) {
return builder.setNegativeButton(textId, listener);
}
public AlertDialog.Builder setNegativeButton(CharSequence text, DialogInterface.OnClickListener listener) {
return builder.setNegativeButton(text, listener);
}
public AlertDialog.Builder setNeutralButton(int textId, DialogInterface.OnClickListener listener) {
return builder.setNeutralButton(textId, listener);
}
public AlertDialog.Builder setNeutralButton(CharSequence text, DialogInterface.OnClickListener listener) {
return builder.setNeutralButton(text, listener);
}
public AlertDialog.Builder setCancelable(boolean cancelable) {
return builder.setCancelable(cancelable);
}
public AlertDialog.Builder setOnCancelListener(DialogInterface.OnCancelListener onCancelListener) {
return builder.setOnCancelListener(onCancelListener);
}
public AlertDialog.Builder setOnDismissListener(DialogInterface.OnDismissListener onDismissListener) {
return builder.setOnDismissListener(onDismissListener);
}
public AlertDialog.Builder setOnKeyListener(DialogInterface.OnKeyListener onKeyListener) {
return builder.setOnKeyListener(onKeyListener);
}
public AlertDialog.Builder setAdapter(ListAdapter adapter, DialogInterface.OnClickListener listener) {
return builder.setAdapter(adapter, listener);
}
public AlertDialog.Builder setCursor(Cursor cursor, DialogInterface.OnClickListener listener, String labelColumn) {
return builder.setCursor(cursor, listener, labelColumn);
}
public AlertDialog.Builder setView(View view) {
return builder.setView(view);
}
public AlertDialog.Builder setView(int layoutResId) {
return builder.setView(layoutResId);
}
public AlertDialog.Builder setOnItemSelectedListener(AdapterView.OnItemSelectedListener listener) {
return builder.setOnItemSelectedListener(listener);
}
}
|