Skip to content

Instantly share code, notes, and snippets.

@Arunshaik2001
Created November 6, 2022 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Arunshaik2001/bc874b555e503417130c141e11ba8695 to your computer and use it in GitHub Desktop.
Save Arunshaik2001/bc874b555e503417130c141e11ba8695 to your computer and use it in GitHub Desktop.
Button(onClick = {
val result = validateData(
titleInputValue,
descriptionInputValue,
titleError,
descriptionError,
localDateTime,
mContext
)
if (!result) {
return@Button
}
val title = titleInputValue.value.text
val description = descriptionInputValue.value.text
val startTimeInMillis =
localDateTime!!.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()
val reminderType = remindTypeState.value.toString()
val intent = Intent()
intent.action = Intent.ACTION_SEND
intent.data =
Uri.parse("remindme://reminder?title=${title}&description=${description}&startTimeInMillis=${startTimeInMillis}&reminderType=${reminderType}")
mContext.startActivity(intent)
}) {
Text(text = "Set Reminder")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment