Show toast when attachment button is clicked

This commit is contained in:
Moez Bhatti
2017-12-25 18:01:12 -05:00
parent 6d43c8e06f
commit c7a4cfefd9
2 changed files with 5 additions and 0 deletions
@@ -171,6 +171,10 @@ class ComposeViewModel(threadId: Long, body: String)
.withLatestFrom(conversation, { _, conversation -> conversation })
.subscribe { conversation -> deleteConversation.execute(conversation.id) }
// Add an attachment
intents += view.attachIntent
.subscribe { context.makeToast(R.string.compose_attach_unsupported) }
// Enable the send button when there is text input into the new message body, disable otherwise
intents += view.textChangedIntent.subscribe { text ->
newState { it.copy(draft = text.toString(), canSend = text.isNotEmpty()) }