Last active
April 17, 2018 13:29
-
-
Save Audhil/32ddc0c07dfc1cc8c9585079578644c6 to your computer and use it in GitHub Desktop.
AlertDialogs with Extn funcs blog_5
This file contains hidden or 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
class SomeFragment : Fragment() { | |
private var notesDialog: AlertDialog? = null | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
showDialog() | |
} | |
// showing dialog | |
fun showDialog() { | |
if (notesDialog == null) | |
//////////////////////////////////////////////////////////////// | |
// making Alert dialog - admire beauty of kotlin | |
//////////////////////////////////////////////////////////////// | |
notesDialog = showNotesAlertDialog { | |
cancelable = false | |
closeIconClickListener { | |
showVLog("Notes Dialog close icon clicked") | |
} | |
doneIconClickListener { | |
showVLog("Notes Dialog done icon clicked") | |
} | |
} | |
// and showing | |
notesDialog?.show() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment