Merge pull request #3970 from element-hq/feature/fga/knock_reason_field_update

change : knock message supporting text display number of characters
This commit is contained in:
ganfra 2024-11-29 16:35:21 +01:00 committed by GitHub
commit 8612da9713
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 69 additions and 46 deletions

View file

@ -48,8 +48,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import java.util.Optional
private const val MAX_KNOCK_MESSAGE_LENGTH = 500
class JoinRoomPresenter @AssistedInject constructor(
@Assisted private val roomId: RoomId,
@Assisted private val roomIdOrAlias: RoomIdOrAlias,

View file

@ -18,6 +18,8 @@ import io.element.android.libraries.matrix.api.core.RoomIdOrAlias
import io.element.android.libraries.matrix.api.room.RoomType
import io.element.android.libraries.matrix.ui.model.InviteSender
internal const val MAX_KNOCK_MESSAGE_LENGTH = 500
@Immutable
data class JoinRoomState(
val contentState: ContentState,

View file

@ -40,17 +40,6 @@ open class JoinRoomStateProvider : PreviewParameterProvider<JoinRoomState> {
aJoinRoomState(
contentState = aLoadedContentState(joinAuthorisationStatus = JoinAuthorisationStatus.CanJoin)
),
aJoinRoomState(
contentState = aLoadedContentState(
joinAuthorisationStatus = JoinAuthorisationStatus.CanKnock,
topic = "lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt" +
" ut labore et dolore magna aliqua ut enim ad minim veniam quis nostrud exercitation ullamco" +
" laboris nisi ut aliquip ex ea commodo consequat duis aute irure dolor in reprehenderit in" +
" voluptate velit esse cillum dolore eu fugiat nulla pariatur excepteur sint occaecat cupidatat" +
" non proident sunt in culpa qui officia deserunt mollit anim id est laborum",
numberOfMembers = 888,
)
),
aJoinRoomState(
contentState = aLoadedContentState(joinAuthorisationStatus = JoinAuthorisationStatus.IsInvited(null))
),
@ -81,6 +70,29 @@ open class JoinRoomStateProvider : PreviewParameterProvider<JoinRoomState> {
isDm = true,
)
),
aJoinRoomState(
contentState = aLoadedContentState(
joinAuthorisationStatus = JoinAuthorisationStatus.CanKnock,
topic = "lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt" +
" ut labore et dolore magna aliqua ut enim ad minim veniam quis nostrud exercitation ullamco" +
" laboris nisi ut aliquip ex ea commodo consequat duis aute irure dolor in reprehenderit in" +
" voluptate velit esse cillum dolore eu fugiat nulla pariatur excepteur sint occaecat cupidatat" +
" non proident sunt in culpa qui officia deserunt mollit anim id est laborum",
numberOfMembers = 888,
)
),
aJoinRoomState(
knockMessage = "Let me in please!",
contentState = aLoadedContentState(
joinAuthorisationStatus = JoinAuthorisationStatus.CanKnock,
topic = "lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod tempor incididunt" +
" ut labore et dolore magna aliqua ut enim ad minim veniam quis nostrud exercitation ullamco" +
" laboris nisi ut aliquip ex ea commodo consequat duis aute irure dolor in reprehenderit in" +
" voluptate velit esse cillum dolore eu fugiat nulla pariatur excepteur sint occaecat cupidatat" +
" non proident sunt in culpa qui officia deserunt mollit anim id est laborum",
numberOfMembers = 888,
)
),
aJoinRoomState(
contentState = aLoadedContentState(
name = "A knocked Room",

View file

@ -390,13 +390,18 @@ private fun DefaultLoadedContent(
)
} else if (contentState.joinAuthorisationStatus is JoinAuthorisationStatus.CanKnock) {
Spacer(modifier = Modifier.height(24.dp))
val supportingText = if (knockMessage.isNotEmpty()) {
"${knockMessage.length}/$MAX_KNOCK_MESSAGE_LENGTH"
} else {
stringResource(R.string.screen_join_room_knock_message_description)
}
TextField(
value = knockMessage,
onValueChange = onKnockMessageUpdate,
maxLines = 3,
minLines = 3,
modifier = Modifier.fillMaxWidth(),
supportingText = stringResource(R.string.screen_join_room_knock_message_description)
supportingText = supportingText
)
}
}

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:916516ede645eaff617b40e6cf50acf2ba1e583827d778d22e9a012fe367fe7a
size 106146
oid sha256:a9d0338485aabe5296754868ce2fcd5097d914eea28298ec11c16f7161ae2341
size 111617

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6eee1185065c82f90cf53d7b9fd62e6de72d907606099b0536b6305ea9537f2
size 117250
oid sha256:45040e44ee78a5103ebf1a3963c24f1a201485affa3f24d8f707e4f99be6cafd
size 112406

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6eee1185065c82f90cf53d7b9fd62e6de72d907606099b0536b6305ea9537f2
size 117250

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a9d0338485aabe5296754868ce2fcd5097d914eea28298ec11c16f7161ae2341
size 111617
oid sha256:3463e70cd08f4d884f8bfafe7d66c5b75ac1fc05bf70cf1478a9f11def071069
size 111151

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3463e70cd08f4d884f8bfafe7d66c5b75ac1fc05bf70cf1478a9f11def071069
size 111151
oid sha256:70c33e148a040ec24287f9ca48353a76e8167015f24d8249bff405e9cc9f16ff
size 118640

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70c33e148a040ec24287f9ca48353a76e8167015f24d8249bff405e9cc9f16ff
size 118640
oid sha256:9b3e666dc4693d7c096dd5c0168770f72be41c41797a93e7c728a20b587ddaba
size 92658

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b3e666dc4693d7c096dd5c0168770f72be41c41797a93e7c728a20b587ddaba
size 92658
oid sha256:9af5a8c8a529eb5f8ea40e9c8028ce2c0ca4b352ef80b2778fa5122cc6bfa937
size 96826

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9af5a8c8a529eb5f8ea40e9c8028ce2c0ca4b352ef80b2778fa5122cc6bfa937
size 96826
oid sha256:084e303ed61e399ddbefda7e54cadb69545eb0db9493185aa48a3db7ba69fb04
size 112515

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:084e303ed61e399ddbefda7e54cadb69545eb0db9493185aa48a3db7ba69fb04
size 112515
oid sha256:916516ede645eaff617b40e6cf50acf2ba1e583827d778d22e9a012fe367fe7a
size 106146

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a9f9d59037ba084e60e6324e066736bc08c0b52319664d67eb84779df6806ce4
size 91377
oid sha256:88584b1d4a4876e68e2972f9bbd03156127ee9b552de1ec20a9057d8f6cb1828
size 101296

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07458d183bae7ecfb7ee61bb6f2e0abb9a4399dd373068002fec3722f575e754
size 102438
oid sha256:cafbd46dbff04191aeabb2ea403d99728972c1854116022e545b4ca6be7bc675
size 102209

View file

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07458d183bae7ecfb7ee61bb6f2e0abb9a4399dd373068002fec3722f575e754
size 102438

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88584b1d4a4876e68e2972f9bbd03156127ee9b552de1ec20a9057d8f6cb1828
size 101296
oid sha256:b1e7887e1120c852e5a9086dba35fd8e52485d0e285c2e3724687ffa71babd45
size 96405

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1e7887e1120c852e5a9086dba35fd8e52485d0e285c2e3724687ffa71babd45
size 96405
oid sha256:c3d75eca5904d605b91becebca60199f7e60e6f2bec6b9a945ce8d130cfd7e47
size 104802

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3d75eca5904d605b91becebca60199f7e60e6f2bec6b9a945ce8d130cfd7e47
size 104802
oid sha256:e97d78225215b0b5e13f369485e7503d020baa7d157cb1c6826d18759d580c6e
size 78221

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e97d78225215b0b5e13f369485e7503d020baa7d157cb1c6826d18759d580c6e
size 78221
oid sha256:95f818f0426868414b0ef5cb525254ad67811ec777c31a435072fb2236914f22
size 82448

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:95f818f0426868414b0ef5cb525254ad67811ec777c31a435072fb2236914f22
size 82448
oid sha256:050785374d848e773941d858848e34f5d1753fcdada4dcef548a98eb5e78c31a
size 99409

View file

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:050785374d848e773941d858848e34f5d1753fcdada4dcef548a98eb5e78c31a
size 99409
oid sha256:a9f9d59037ba084e60e6324e066736bc08c0b52319664d67eb84779df6806ce4
size 91377