mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 02:03:55 +00:00
Hide next button when empty in new message
This commit is contained in:
parent
b775b5aca9
commit
4aa0e55dc6
@ -1,5 +1,6 @@
|
|||||||
package org.thoughtcrime.securesms.conversation.start.newmessage
|
package org.thoughtcrime.securesms.conversation.start.newmessage
|
||||||
|
|
||||||
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@ -111,17 +112,18 @@ private fun EnterAccountId(
|
|||||||
|
|
||||||
Spacer(Modifier.weight(2f))
|
Spacer(Modifier.weight(2f))
|
||||||
|
|
||||||
PrimaryOutlineButton(
|
AnimatedVisibility(state.isNextButtonVisible) {
|
||||||
modifier = Modifier
|
PrimaryOutlineButton(
|
||||||
.align(Alignment.CenterHorizontally)
|
modifier = Modifier
|
||||||
.padding(horizontal = LocalDimensions.current.largeMargin)
|
.align(Alignment.CenterHorizontally)
|
||||||
.fillMaxWidth()
|
.padding(horizontal = LocalDimensions.current.largeMargin)
|
||||||
.contentDescription(R.string.next),
|
.fillMaxWidth()
|
||||||
enabled = state.isNextButtonEnabled,
|
.contentDescription(R.string.next),
|
||||||
onClick = callbacks::onContinue
|
onClick = callbacks::onContinue
|
||||||
) {
|
) {
|
||||||
LoadingArcOr(state.loading) {
|
LoadingArcOr(state.loading) {
|
||||||
Text(stringResource(R.string.next))
|
Text(stringResource(R.string.next))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ internal data class State(
|
|||||||
val error: GetString? = null,
|
val error: GetString? = null,
|
||||||
val loading: Boolean = false
|
val loading: Boolean = false
|
||||||
) {
|
) {
|
||||||
val isNextButtonEnabled: Boolean get() = newMessageIdOrOns.isNotBlank()
|
val isNextButtonVisible: Boolean get() = newMessageIdOrOns.isNotBlank()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal data class Success(val publicKey: String)
|
internal data class Success(val publicKey: String)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user