|
|
@@ -7,6 +7,7 @@ import android.app.Dialog;
|
|
|
import android.content.DialogInterface;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
+import android.support.annotation.StringRes;
|
|
|
import android.support.v7.app.AlertDialog;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
@@ -24,13 +25,28 @@ import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
*/
|
|
|
public class CustomAlertDialog extends TextDialog {
|
|
|
|
|
|
+ @StringRes
|
|
|
+ protected int buttonLabel = R.string.empty_string;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 표시할 buttonLabel 지정
|
|
|
+ *
|
|
|
+ * @param stringId
|
|
|
+ */
|
|
|
+ public void setButtonLabelId(@StringRes int stringId) {
|
|
|
+ this.buttonLabel = stringId;
|
|
|
+ }
|
|
|
+
|
|
|
@NonNull
|
|
|
@Override
|
|
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
|
|
+ if (buttonLabel == R.string.empty_string) {
|
|
|
+ buttonLabel = R.string.confirm;
|
|
|
+ }
|
|
|
// Use the Builder class for convenient dialog construction
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
|
|
builder.setMessage(text)
|
|
|
- .setPositiveButton(R.string.member_confirm, new DialogInterface.OnClickListener() {
|
|
|
+ .setPositiveButton(buttonLabel, new DialogInterface.OnClickListener() {
|
|
|
public void onClick(DialogInterface dialog, int id) {
|
|
|
if (null != getCustomListener()) {
|
|
|
getCustomListener().onDialogResult(CustomAlertDialog.this, new Event.Builder(Event.CONFIRM).build());
|