From c7a4cfefd9d9e753d6b364784e641531ee0ca416 Mon Sep 17 00:00:00 2001 From: Moez Bhatti Date: Mon, 25 Dec 2017 18:01:12 -0500 Subject: [PATCH] Show toast when attachment button is clicked --- .../com/moez/QKSMS/presentation/compose/ComposeViewModel.kt | 4 ++++ qksms/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/qksms/src/main/java/com/moez/QKSMS/presentation/compose/ComposeViewModel.kt b/qksms/src/main/java/com/moez/QKSMS/presentation/compose/ComposeViewModel.kt index 88bb8aad..349450fa 100644 --- a/qksms/src/main/java/com/moez/QKSMS/presentation/compose/ComposeViewModel.kt +++ b/qksms/src/main/java/com/moez/QKSMS/presentation/compose/ComposeViewModel.kt @@ -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()) } diff --git a/qksms/src/main/res/values/strings.xml b/qksms/src/main/res/values/strings.xml index ec6144f2..32e21aa3 100644 --- a/qksms/src/main/res/values/strings.xml +++ b/qksms/src/main/res/values/strings.xml @@ -21,6 +21,7 @@ Optimizing database, this might take a minute… + MMS support will be added shortly! Write a message… Sending…