-
Notifications
You must be signed in to change notification settings - Fork 8
How to use
John Lee edited this page May 3, 2020
·
4 revisions
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setTitle(String title) | .setTitle("Hello") | - | null | Unnecessary |
.setTitle(String title, boolean isBold) | .setTitle("Hello", false) | - | null, true | Unnecessary |
.setContent(String message) | .setContent("This is Simple Dialog :)") | - | null | Message cannot be empty |
.setContent(String message, Integer paddingLeftDp) | .setContent("This is Simple Dialog :)", 3) | - | null, null | Message cannot be empty |
.setPermanentCheck(String preferenceName, String preferenceKey) | .setPermanentCheck(Pref.PREFERENCE_NAME, Pref.KEY_FIRST_WELCOME) | - | null, null | Unnecessary |
.setBtnPermanentCheckText(String message) | .setBtnPermanentCheckText("Don't ask again") | - | "Don't show again" | setPermanentCheck needs to be set |
.setBtnPermanentCheckText(String message, boolean isBold) | .setBtnPermanentCheckText("Don't ask again", true) | - | "Don't show again", false | setPermanentCheck needs to be set |
.setBtnPermanentCheckTextSizeDp(int textSizeDp) | .setBtnPermanentCheckTextSizeDp(11) | - | 13 | setPermanentCheck needs to be set |
.setBtnConfirmText(String message) | .setBtnConfirmText("Confirm") | .setBtnConfirmText( getString(R.string.text_confirm) ) | "Confirm" | Unnecessary (Automatically will be set) |
.setBtnConfirmText(String message, boolean isBold) | .setBtnConfirmText("Confirm", false) | .setBtnConfirmText( getString(R.string.text_confirm), false ) | "Confirm", true | Unnecessary (Automatically will be set) |
.setBtnConfirmTextSizeDp(int textSizeInDp) | .setBtnConfirmTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnConfirmTextColor(Integer color) | .setBtnConfirmTextColor(R.color.btnConfirmColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnConfirmTextColor(String color) | .setBtnConfirmTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onConfirm(BtnCallback callback) | .onConfirm(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
.onConfirm(BtnCallbackWithPermanentCheck callback) | .onConfirm(new SimpleDialog.BtnCallbackWithPermanentCheck() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which, boolean isPermanentChecked) { if( isPermanentChecked ) // Do something } }) | - | null | Unnecessary (If you don't want to show again if checkbox is checked, simply use showIfPermanentValueIsFalse() instead of just show()) |
.setBtnCancelText(String message) | .setBtnCancelText("Cancel") | .setBtnCancelText( getString(R.string.text_cancel) ) | null | Unnecessary |
.setBtnCancelText(String message, boolean isBold) | .setBtnCancelText("Cancel", false) | .setBtnCancelText( getString(R.string.text_cancel), false ) | null, true | Unnecessary |
.setBtnCancelTextSizeDp(int textSizeInDp) | .setBtnCancelTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnCancelTextColor(Integer color) | .setBtnCancelTextColor(R.color.btnCancelColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnCancelTextColor(String color) | .setBtnCancelTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onCancel(BtnCallback callback) | .onCancel(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
-
.setTitle
is unavailable when you use Progress Dialog -
.showProgress
must be set astrue
- CancelButton is default
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setContent(String message) | .setContent("This is Simple Dialog :)") | - | null | Message cannot be empty |
.setContent(String message, Integer paddingLeftDp) | .setContent("This is Simple Dialog :)", 3) | - | null, null | Message cannot be empty |
.showProgress(boolean showProgress) | .showProgress(true) | - | false | Must be set as true, if you want to show Progress Dialog |
.setProgressGIF(Object customProgressGIF) | .setProgressGIF(R.raw.simple_dialog_progress_default) | - | null | Unnecessary ( Use GIF file in raw directory ) |
.setBtnCancelText(String message) | .setBtnCancelText("Cancel") | .setBtnCancelText( getString(R.string.text_cancel) ) | null | Unnecessary |
.setBtnCancelText(String message, boolean isBold) | .setBtnCancelText("Cancel", false) | .setBtnCancelText( getString(R.string.text_cancel), false ) | null, true | Unnecessary |
.setBtnCancelTextSizeDp(int textSizeInDp) | .setBtnCancelTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnCancelTextColor(Integer color) | .setBtnCancelTextColor(R.color.btnCancelColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnCancelTextColor(String color) | .setBtnCancelTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onCancel(BtnCallback callback) | .onCancel(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
- default value for paddingLeftDp is 14
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setContentList(List contentList, @Nullable Int paddingLeftDp) | .setContentList( listOf("AAAA", "BBB", "CC") ) | - | null | contentList cannot be empty |
.onSelect(SelectionCallback callback) | .onSelect(new SelectionCallback { @Override public void onSelect(String option) { // Do something } }) | - | null | See what user have selected |
- Image is not neccessary
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setTitle(String title) | .setTitle("Hello") | - | null | Unnecessary |
.setTitle(String title, boolean isBold) | .setTitle("Hello", false) | - | null, true | Unnecessary |
.setContent(String message) | .setContent("This is Simple Dialog :)") | - | null | Message cannot be empty |
.setContent(String message, Integer paddingLeftDp) | .setContent("This is Simple Dialog :)", 3) | - | null, null | Message cannot be empty |
.setGuideImage(int imageId) | .setGuideImage(R.drawable.image_guide_pinch) | - | null | Unnecessary |
.setGuideImage(int imageId, Integer paddingDp) | .setGuideImage(R.drawable.image_guide_pinch, 10) | - | null, 18 | Unnecessary |
.setGuideImageSizeDp(Integer width, Integer height) | .setGuideImageSizeDp(150, 150) | - | null, null | Unnecessary ( android:scaleType="fitCenter" ) |
.setPermanentCheck(String preferenceName, String preferenceKey) | .setPermanentCheck(Pref.PREFERENCE_NAME, Pref.KEY_FIRST_WELCOME) | - | null, null | Unnecessary |
.setBtnPermanentCheckText(String message) | .setBtnPermanentCheckText("Don't ask again") | - | "Don't show again" | setPermanentCheck needs to be set |
.setBtnPermanentCheckText(String message, boolean isBold) | .setBtnPermanentCheckText("Don't ask again", true) | - | "Don't show again", false | setPermanentCheck needs to be set |
.setBtnPermanentCheckTextSizeDp(int textSizeDp) | .setBtnPermanentCheckTextSizeDp(11) | - | 13 | setPermanentCheck needs to be set |
.setBtnConfirmText(String message) | .setBtnConfirmText("Confirm") | .setBtnConfirmText( getString(R.string.text_confirm) ) | "Confirm" | Unnecessary (Automatically will be set) |
.setBtnConfirmText(String message, boolean isBold) | .setBtnConfirmText("Confirm", false) | .setBtnConfirmText( getString(R.string.text_confirm), false ) | "Confirm", true | Unnecessary (Automatically will be set) |
.setBtnConfirmTextSizeDp(int textSizeInDp) | .setBtnConfirmTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnConfirmTextColor(Integer color) | .setBtnConfirmTextColor(R.color.btnConfirmColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnConfirmTextColor(String color) | .setBtnConfirmTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onConfirm(BtnCallback callback) | .onConfirm(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
.onConfirm(BtnCallbackWithPermanentCheck callback) | .onConfirm(new SimpleDialog.BtnCallbackWithPermanentCheck() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which, boolean isPermanentChecked) { if( isPermanentChecked ) // Do something } }) | - | null | Unnecessary (If you don't want to show again if checkbox is checked, simply use showIfPermanentValueIsFalse() instead of just show()) |
- CustomView is already in ScrollView (If your customView is long enough, it will automatically scroll)
-
PermanentCheckButton
cannot be used withCancelButton
-
.setContent
,.showProgress
are unavailable when you want Custom Dialog
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setTitle(String title) | .setTitle("Hello") | - | null | Unnecessary |
.setTitle(String title, boolean isBold) | .setTitle("Hello", false) | - | null, true | Unnecessary |
.setCustomView(int layoutRes) | .setCustomView(R.layout.brouding_simple_dialog_test_layout_custom) | - | null | Unnecessary |
.setCustomView(View view) | .setCustomView( (View)myCustomView ) | - | null | Unnecessary |
.setPermanentCheck(String preferenceName, String preferenceKey) | .setPermanentCheck(Pref.PREFERENCE_NAME, Pref.KEY_FIRST_WELCOME) | - | null, null | Unnecessary |
.setBtnPermanentCheckText(String message) | .setBtnPermanentCheckText("Don't ask again") | - | "Don't show again" | setPermanentCheck needs to be set |
.setBtnPermanentCheckText(String message, boolean isBold) | .setBtnPermanentCheckText("Don't ask again", true) | - | "Don't show again", false | setPermanentCheck needs to be set |
.setBtnPermanentCheckTextSizeDp(int textSizeDp) | .setBtnPermanentCheckTextSizeDp(11) | - | 13 | setPermanentCheck needs to be set |
.setBtnConfirmText(String message) | .setBtnConfirmText("Confirm") | .setBtnConfirmText( getString(R.string.text_confirm) ) | "Confirm" | Unnecessary (Automatically will be set) |
.setBtnConfirmText(String message, boolean isBold) | .setBtnConfirmText("Confirm", false) | .setBtnConfirmText( getString(R.string.text_confirm), false ) | "Confirm", true | Unnecessary (Automatically will be set) |
.setBtnConfirmTextSizeDp(int textSizeInDp) | .setBtnConfirmTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnConfirmTextColor(Integer color) | .setBtnConfirmTextColor(R.color.btnConfirmColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnConfirmTextColor(String color) | .setBtnConfirmTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onConfirm(BtnCallback callback) | .onConfirm(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
.onConfirm(BtnCallbackWithPermanentCheck callback) | .onConfirm(new SimpleDialog.BtnCallbackWithPermanentCheck() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which, boolean isPermanentChecked) { if( isPermanentChecked ) // Do something } }) | - | null | Unnecessary (If you don't want to show again if checkbox is checked, simply use showIfPermanentValueIsFalse() instead of just show()) |
.setBtnCancelText(String message) | .setBtnCancelText("Cancel") | .setBtnCancelText( getString(R.string.text_cancel) ) | null | Unnecessary |
.setBtnCancelText(String message, boolean isBold) | .setBtnCancelText("Cancel", false) | .setBtnCancelText( getString(R.string.text_cancel), false ) | null, true | Unnecessary |
.setBtnCancelTextSizeDp(int textSizeInDp) | .setBtnCancelTextSizeDp(15) | - | 14 | Unnecessary |
.setBtnCancelTextColor(Integer color) | .setBtnCancelTextColor(R.color.btnCancelColor) | - | R.color.colorPrimary | Unnecessary |
.setBtnCancelTextColor(String color) | .setBtnCancelTextColor("#333333") | - | R.color.colorPrimary | Unnecessary |
.onCancel(BtnCallback callback) | .onCancel(new SimpleDialog.BtnCallback() { @Override public void onClick(@NonNull SimpleDialog dialog, @NonNull SimpleDialog.BtnAction which) { // Do something } }) | - | null | Unnecessary (will be dismissed) |
- All dialogs can use these
Setter | Ex) 1 | Ex) 2 | Default value | Description |
---|---|---|---|---|
.setTag(Object tag) | .setTag(Const.NETWORK_ERROR) | - | null | Unnecessary |
.setCancelable(boolean isCancelable) | .setCancelable(true) | - | false | Unnecessary |
.setCancelableOnTouchOutside(boolean isCancelableOnTouchOutside) | .setCancelableOnTouchOutside(true) | - | false | Unnecessary |
.onDialogCancel(OnDismissListener listener) | .onDialogCancel(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // Do something } }) | - | null | Unnecessary |
.onDialogShow(OnShowListener listener) | .onDialogShow(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { // Do something } }) | - | null | Unnecessary |
.onDialogDismiss(OnDismissListener listener) | .onDialogDismiss(new DialogInterface.OnDismissListener() { @Override public void onDimiss(DialogInterface dialog) { // Do something } }) | - | null | Unnecessary |