Force selected time to be in the future

This commit is contained in:
Moez Bhatti
2018-06-27 16:33:36 -04:00
parent 81d77eb1d9
commit f175567cde
2 changed files with 6 additions and 0 deletions
@@ -478,6 +478,11 @@ class ComposeViewModel @Inject constructor(
// Set the scheduled time
view.scheduleSelectedIntent
.filter { scheduled ->
(scheduled > System.currentTimeMillis()).also { future ->
if (!future) context.toast(R.string.compose_scheduled_future)
}
}
.autoDisposable(view.scope())
.subscribe { scheduled -> newState { copy(scheduled = scheduled) } }
@@ -89,6 +89,7 @@
<string name="compose_messages_empty">This is the start of your conversation. Say something nice!</string>
<string name="compose_vcard_label">Contact card</string>
<string name="compose_scheduled_for">Scheduled for</string>
<string name="compose_scheduled_future">Selected time must be in the future!</string>
<string name="compose_scheduled_toast">Added to scheduled messages</string>
<string name="compose_hint">Write a message…</string>
<string name="compose_menu_copy">Copy text</string>