Show scheduled send icon when scheduling a message.

This commit is contained in:
Inhishonor
2025-07-07 16:13:36 -07:00
parent 27b102da36
commit e8c92a1422
4 changed files with 23 additions and 4 deletions
@@ -124,6 +124,7 @@ import kotlinx.android.synthetic.main.compose_activity.scheduleLabel
import kotlinx.android.synthetic.main.compose_activity.scheduledCancel
import kotlinx.android.synthetic.main.compose_activity.scheduledGroup
import kotlinx.android.synthetic.main.compose_activity.scheduledTime
import kotlinx.android.synthetic.main.compose_activity.scheduledSend
import kotlinx.android.synthetic.main.compose_activity.send
import kotlinx.android.synthetic.main.compose_activity.sendAsGroup
import kotlinx.android.synthetic.main.compose_activity.sendAsGroupBackground
@@ -182,7 +183,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
override val scheduleSelectedIntent: Subject<Long> = PublishSubject.create()
override val changeSimIntent by lazy { sim.clicks() }
override val scheduleCancelIntent by lazy { scheduledCancel.clicks() }
override val sendIntent by lazy { send.clicks() }
override val sendIntent by lazy { Observable.merge(send.clicks(), scheduledSend.clicks()) }
override val viewQksmsPlusIntent: Subject<Unit> = PublishSubject.create()
override val backPressedIntent: Subject<Unit> = PublishSubject.create()
override val confirmDeleteIntent: Subject<List<Long>> = PublishSubject.create()
@@ -532,9 +533,10 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
sim.contentDescription = getString(R.string.compose_sim_cd, state.subscription?.displayName)
simIndex.text = state.subscription?.simSlotIndex?.plus(1)?.toString()
// show either send or audio msg record button
send.visibility = if (state.canSend && !state.loading) View.VISIBLE else View.INVISIBLE
// show either send, audio msg record, or sendScheduled button
send.visibility = if (state.canSend && !state.loading && state.scheduled == 0L) View.VISIBLE else View.INVISIBLE
recordAudioMsg.visibility = if (state.canSend && !state.loading) View.INVISIBLE else View.VISIBLE
scheduledSend.visibility = if (state.canSend && (state.scheduled != 0L) && !state.loading) View.VISIBLE else View.INVISIBLE
// if not in editing mode, and there are no non-me participants that can be sent to,
// hide controls that allow constructing a reply and inform user no valid recipients
@@ -834,7 +834,8 @@ class ComposeViewModel @Inject constructor(
.subscribe {
newState {
copy(
canSend = (it.first.isNotBlank() || (it.second > 0)) || (it.third > 0)
canSend = (it.first.isNotBlank() || (it.second > 0)),
scheduled = it.third
)
}
}