Merge pull request #3832 from element-hq/feature/bma/waitingtoMatch
Disable button during the "verifying" step.
This commit is contained in:
commit
cf9dbc60f6
16 changed files with 62 additions and 54 deletions
|
|
@ -10,9 +10,7 @@ package io.element.android.features.verifysession.impl.incoming
|
|||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.runtime.Composable
|
||||
|
|
@ -35,6 +33,7 @@ import io.element.android.libraries.designsystem.components.PageTitle
|
|||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.designsystem.theme.components.Button
|
||||
import io.element.android.libraries.designsystem.theme.components.InvisibleButton
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.designsystem.theme.components.TextButton
|
||||
import io.element.android.libraries.designsystem.theme.components.TopAppBar
|
||||
|
|
@ -166,8 +165,7 @@ private fun IncomingVerificationBottomMenu(
|
|||
enabled = false,
|
||||
showProgress = true,
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
} else {
|
||||
VerificationBottomMenu {
|
||||
|
|
@ -194,8 +192,7 @@ private fun IncomingVerificationBottomMenu(
|
|||
enabled = false,
|
||||
showProgress = true,
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
} else {
|
||||
VerificationBottomMenu {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,8 @@ import androidx.compose.foundation.clickable
|
|||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.runtime.Composable
|
||||
|
|
@ -44,6 +42,7 @@ import io.element.android.libraries.designsystem.preview.ElementPreview
|
|||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.designsystem.theme.components.Button
|
||||
import io.element.android.libraries.designsystem.theme.components.CircularProgressIndicator
|
||||
import io.element.android.libraries.designsystem.theme.components.InvisibleButton
|
||||
import io.element.android.libraries.designsystem.theme.components.OutlinedButton
|
||||
import io.element.android.libraries.designsystem.theme.components.Text
|
||||
import io.element.android.libraries.designsystem.theme.components.TextButton
|
||||
|
|
@ -282,8 +281,7 @@ private fun VerifySelfSessionBottomMenu(
|
|||
text = stringResource(CommonStrings.action_start_verification),
|
||||
onClick = { eventSink(VerifySelfSessionViewEvents.RequestVerification) },
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
}
|
||||
is Step.Canceled -> {
|
||||
|
|
@ -293,8 +291,7 @@ private fun VerifySelfSessionBottomMenu(
|
|||
text = stringResource(CommonStrings.action_done),
|
||||
onClick = onCancelClick,
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
}
|
||||
is Step.Ready -> {
|
||||
|
|
@ -320,8 +317,7 @@ private fun VerifySelfSessionBottomMenu(
|
|||
showProgress = true,
|
||||
enabled = false,
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
}
|
||||
is Step.Verifying -> {
|
||||
|
|
@ -335,17 +331,22 @@ private fun VerifySelfSessionBottomMenu(
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
text = positiveButtonTitle,
|
||||
showProgress = isVerifying,
|
||||
enabled = !isVerifying,
|
||||
onClick = {
|
||||
if (!isVerifying) {
|
||||
eventSink(VerifySelfSessionViewEvents.ConfirmVerification)
|
||||
}
|
||||
},
|
||||
)
|
||||
TextButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResource(R.string.screen_session_verification_they_dont_match),
|
||||
onClick = { eventSink(VerifySelfSessionViewEvents.DeclineVerification) },
|
||||
)
|
||||
if (isVerifying) {
|
||||
InvisibleButton()
|
||||
} else {
|
||||
TextButton(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
text = stringResource(R.string.screen_session_verification_they_dont_match),
|
||||
onClick = { eventSink(VerifySelfSessionViewEvents.DeclineVerification) },
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
is Step.Completed -> {
|
||||
|
|
@ -355,8 +356,7 @@ private fun VerifySelfSessionBottomMenu(
|
|||
text = stringResource(CommonStrings.action_continue),
|
||||
onClick = onContinueClick,
|
||||
)
|
||||
// Placeholder so the 1st button keeps its vertical position
|
||||
Spacer(modifier = Modifier.height(48.dp))
|
||||
InvisibleButton()
|
||||
}
|
||||
}
|
||||
is Step.Skipped -> return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue