From a6ae25c5a1f401c732dd2fcb10efbaba62bf559f Mon Sep 17 00:00:00 2001 From: Maxime NATUREL <46314705+mnaturel@users.noreply.github.com> Date: Tue, 7 Mar 2023 10:05:38 +0100 Subject: [PATCH] Hiding the buttons when the search is active --- .../createroom/root/CreateRoomRootScreen.kt | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt index d9b021b9ba..cc1a08b9c4 100644 --- a/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt +++ b/features/createroom/src/main/kotlin/io/element/android/features/createroom/root/CreateRoomRootScreen.kt @@ -19,7 +19,6 @@ package io.element.android.features.createroom.root import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.SearchBarDefaults import androidx.compose.material3.TextButton @@ -76,29 +75,31 @@ fun CreateRoomRootScreen( active = isSearchActive, ) - TextButton( - modifier = Modifier.padding(start = 8.dp, top = 16.dp, end = 8.dp), - onClick = { }) { - Icon( - modifier = Modifier - .padding(end = 16.dp), - resourceId = DrawableR.drawable.ic_group, // TODO ask design for squared icon - contentDescription = "" - ) - Text(text = stringResource(id = StringR.string.new_room)) - } + if (!isSearchActive.value) { + TextButton( + modifier = Modifier.padding(start = 8.dp, top = 16.dp, end = 8.dp), + onClick = { }) { + Icon( + modifier = Modifier + .padding(end = 16.dp), + resourceId = DrawableR.drawable.ic_group, // TODO ask design for squared icon + contentDescription = "" + ) + Text(text = stringResource(id = StringR.string.new_room)) + } - TextButton( - modifier = Modifier.padding(horizontal = 8.dp), - onClick = { } - ) { - Icon( - modifier = Modifier - .padding(end = 16.dp), - resourceId = DrawableR.drawable.ic_share, - contentDescription = "" - ) - Text(text = stringResource(id = StringR.string.invite_people_menu)) + TextButton( + modifier = Modifier.padding(horizontal = 8.dp), + onClick = { } + ) { + Icon( + modifier = Modifier + .padding(end = 16.dp), + resourceId = DrawableR.drawable.ic_share, + contentDescription = "" + ) + Text(text = stringResource(id = StringR.string.invite_people_menu)) + } } } }