Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Created October 29, 2018 20:28
Show Gist options
  • Save EmmanuelGuther/eb069d7c6d6608f999b353398179d142 to your computer and use it in GitHub Desktop.
Save EmmanuelGuther/eb069d7c6d6608f999b353398179d142 to your computer and use it in GitHub Desktop.
notifyWhitAction waits as a second argument for a function, and for something as simple as closing an activity we are not going to create a function ... we use an anonymous one.
when (layoutEditableMode) {
true -> notifyWithAction(message, (R.string.exit), { fun() = activity?.finish() }, circleImageViewProfessionalProfileEditable)
false -> notifyWithAction(message, R.string.refresh, ::loadData, circleImageViewProfessionalProfile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment