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
)
}
}
@@ -347,6 +347,21 @@
app:tint="?android:textColorSecondary"
tools:visibility="visible" />
<ImageView
android:id="@+id/scheduledSend"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginEnd="8dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/scheduled_send_cd"
android:src="@drawable/ic_schedule_send_black_24dp"
android:padding="10dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/messageBackground"
app:layout_constraintEnd_toEndOf="parent"
app:tint="?android:textColorSecondary"
tools:visibility="visible" />
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
@@ -250,6 +250,7 @@
<!--&#x200A; is a special character required at the end of this string to fix it's formatting in the app -->
<string name="scheduled_empty_message_3_timestamp">Sending on December 23rd&#x200A;</string>
<string name="scheduled_compose_cd">Schedule a message</string>
<string name="scheduled_send_cd">Schedule this message</string>
<string name="scheduled_options_title">Scheduled message</string>
<string name="attachment_missing">Missing</string>