mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-16 20:10:04 +03:00
Verification: migrate to Epoxy - Cleanup
This commit is contained in:
parent
fc22b7988f
commit
92f26bc20a
4 changed files with 33 additions and 22 deletions
|
@ -60,13 +60,13 @@ class VerificationEmojiCodeController @Inject constructor(
|
|||
}
|
||||
|
||||
private fun buildEmojiItem(state: VerificationEmojiCodeViewState) {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice")
|
||||
notice(stringProvider.getString(R.string.verification_emoji_notice))
|
||||
}
|
||||
|
||||
when (val emojiDescription = state.emojiDescription) {
|
||||
is Success -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice")
|
||||
notice(stringProvider.getString(R.string.verification_emoji_notice))
|
||||
}
|
||||
|
||||
bottomSheetVerificationEmojisItem {
|
||||
id("emojis")
|
||||
emojiRepresentation0(emojiDescription()[0])
|
||||
|
@ -96,17 +96,33 @@ class VerificationEmojiCodeController @Inject constructor(
|
|||
}
|
||||
|
||||
private fun buildDecimal(state: VerificationEmojiCodeViewState) {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice")
|
||||
notice(stringProvider.getString(R.string.verification_code_notice))
|
||||
}
|
||||
when (val decimalDescription = state.decimalDescription) {
|
||||
is Success -> {
|
||||
bottomSheetVerificationNoticeItem {
|
||||
id("notice")
|
||||
notice(stringProvider.getString(R.string.verification_code_notice))
|
||||
}
|
||||
|
||||
bottomSheetVerificationDecimalCodeItem {
|
||||
id("decimal")
|
||||
code(state.decimalDescription.invoke() ?: "")
|
||||
}
|
||||
bottomSheetVerificationDecimalCodeItem {
|
||||
id("decimal")
|
||||
code(state.decimalDescription.invoke() ?: "")
|
||||
}
|
||||
|
||||
buildActions(state)
|
||||
buildActions(state)
|
||||
}
|
||||
is Fail -> {
|
||||
errorWithRetryItem {
|
||||
id("error")
|
||||
text(errorFormatter.toHumanReadable(decimalDescription.error))
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
bottomSheetVerificationWaitingItem {
|
||||
id("waiting")
|
||||
title(stringProvider.getString(R.string.please_wait))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun buildActions(state: VerificationEmojiCodeViewState) {
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
android:id="@+id/itemVerificationDecimalCode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="?riotx_text_primary"
|
||||
android:textSize="28sp"
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/layout_vertical_margin"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/sas_emoji_description_2">
|
||||
android:layout_margin="@dimen/layout_vertical_margin">
|
||||
|
||||
<include
|
||||
android:id="@+id/emoji0"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
app:layout_constraintEnd_toStartOf="@+id/itemVerificationWaitingProgress"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="Waiting for..." />
|
||||
|
||||
<ProgressBar
|
||||
|
|
Loading…
Add table
Reference in a new issue