-
-
Save alparslandev/eb148a5b847bec635dd855b04fd5d90f to your computer and use it in GitHub Desktop.
show
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun showAlertAndOperate(@StringRes stringId: Int, leave: Leave, func: () -> Unit) { | |
leaveDetailsDialogFragment.dismiss() // Close Leave Details Dialog Fragment | |
val text = getString(stringId, leave.User.getNameSurname(), LeaveDate.getDayAndTimeByFormat(leave.CreatedAt, LeaveDate.prettyFormatLongDateTime), leave.Reason.Name) | |
showAlertDialog(text, DialogInterface.OnClickListener {_, which -> | |
if (which == DialogInterface.BUTTON_POSITIVE) { | |
func() | |
/* func() is sent as parameter. | |
When dialog shows up and user tap OK button, func() is fired here */ | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment