Add time limited indication for verification request.
This commit is contained in:
parent
5f1141f9d1
commit
b71d3fe91d
4 changed files with 35 additions and 4 deletions
|
|
@ -36,5 +36,9 @@ data class IncomingVerificationState(
|
||||||
data object Canceled : Step
|
data object Canceled : Step
|
||||||
data object Completed : Step
|
data object Completed : Step
|
||||||
data object Failure : Step
|
data object Failure : Step
|
||||||
|
|
||||||
|
val isTimeLimited: Boolean
|
||||||
|
get() = this is Initial ||
|
||||||
|
this is Verifying
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
|
@ -140,10 +142,18 @@ private fun IncomingVerificationHeader(step: Step, request: VerificationRequest.
|
||||||
}
|
}
|
||||||
Step.Failure -> R.string.screen_session_verification_request_failure_subtitle
|
Step.Failure -> R.string.screen_session_verification_request_failure_subtitle
|
||||||
}
|
}
|
||||||
|
val timeLimitMessage = if (step.isTimeLimited) {
|
||||||
|
stringResource(CommonStrings.a11y_time_limited_action_required)
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
PageTitle(
|
PageTitle(
|
||||||
|
modifier = Modifier.semantics(mergeDescendants = true) {
|
||||||
|
contentDescription = timeLimitMessage
|
||||||
|
},
|
||||||
iconStyle = iconStyle,
|
iconStyle = iconStyle,
|
||||||
title = stringResource(id = titleTextId),
|
title = stringResource(id = titleTextId),
|
||||||
subtitle = stringResource(id = subtitleTextId)
|
subtitle = stringResource(id = subtitleTextId),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -187,7 +197,9 @@ private fun ContentInitial(
|
||||||
}
|
}
|
||||||
is VerificationRequest.Incoming.User -> {
|
is VerificationRequest.Incoming.User -> {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().padding(top = 24.dp),
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(top = 24.dp),
|
||||||
) {
|
) {
|
||||||
VerificationUserProfileContent(
|
VerificationUserProfileContent(
|
||||||
userId = request.details.senderProfile.userId,
|
userId = request.details.senderProfile.userId,
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,11 @@ data class OutgoingVerificationState(
|
||||||
data class Verifying(val data: SessionVerificationData, val state: AsyncData<Unit>) : Step
|
data class Verifying(val data: SessionVerificationData, val state: AsyncData<Unit>) : Step
|
||||||
data object Completed : Step
|
data object Completed : Step
|
||||||
data object Exit : Step
|
data object Exit : Step
|
||||||
|
|
||||||
|
val isTimeLimited: Boolean
|
||||||
|
get() = this is Initial ||
|
||||||
|
this is AwaitingOtherDeviceResponse ||
|
||||||
|
this is Ready ||
|
||||||
|
this is Verifying
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import androidx.compose.ui.semantics.contentDescription
|
||||||
|
import androidx.compose.ui.semantics.semantics
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import io.element.android.compound.theme.ElementTheme
|
import io.element.android.compound.theme.ElementTheme
|
||||||
|
|
@ -180,11 +182,18 @@ private fun OutgoingVerificationHeader(step: Step, request: VerificationRequest.
|
||||||
}
|
}
|
||||||
is Step.Exit -> return
|
is Step.Exit -> return
|
||||||
}
|
}
|
||||||
|
val timeLimitMessage = if (step.isTimeLimited) {
|
||||||
|
stringResource(CommonStrings.a11y_time_limited_action_required)
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
PageTitle(
|
PageTitle(
|
||||||
|
modifier = Modifier.semantics(mergeDescendants = true) {
|
||||||
|
contentDescription = timeLimitMessage
|
||||||
|
},
|
||||||
iconStyle = iconStyle,
|
iconStyle = iconStyle,
|
||||||
title = stringResource(id = titleTextId),
|
title = stringResource(id = titleTextId),
|
||||||
subtitle = stringResource(id = subtitleTextId)
|
subtitle = stringResource(id = subtitleTextId),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue