mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
Add button to add participants
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
eb75f488c5
commit
29d5293587
@ -20,8 +20,10 @@ import androidx.compose.material3.ExperimentalMaterial3Api
|
|||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.material3.TextButton
|
||||||
import androidx.compose.material3.TopAppBar
|
import androidx.compose.material3.TopAppBar
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@ -54,6 +56,7 @@ fun AppBar(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
|
if (!isSearchActive) {
|
||||||
IconButton(onClick = onEnableSearch) {
|
IconButton(onClick = onEnableSearch) {
|
||||||
Icon(Icons.Filled.Search, contentDescription = stringResource(R.string.search_icon))
|
Icon(Icons.Filled.Search, contentDescription = stringResource(R.string.search_icon))
|
||||||
}
|
}
|
||||||
@ -73,6 +76,7 @@ fun AppBar(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
)
|
)
|
||||||
if (isSearchActive) {
|
if (isSearchActive) {
|
||||||
Row {
|
Row {
|
||||||
@ -84,6 +88,18 @@ fun AppBar(
|
|||||||
},
|
},
|
||||||
onDisableSearch = onDisableSearch
|
onDisableSearch = onDisableSearch
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (searchQuery.isNotEmpty() && isAddParticipants) {
|
||||||
|
TextButton(
|
||||||
|
modifier = Modifier.align(Alignment.CenterVertically),
|
||||||
|
onClick = {
|
||||||
|
onDisableSearch()
|
||||||
|
onUpdateSearchQuery("")
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Text(text = "Add")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,10 @@ import com.nextcloud.talk.R
|
|||||||
@Composable
|
@Composable
|
||||||
fun SearchComponent(text: String, onTextChange: (String) -> Unit, onDisableSearch: () -> Unit) {
|
fun SearchComponent(text: String, onTextChange: (String) -> Unit, onDisableSearch: () -> Unit) {
|
||||||
val keyboardController = LocalSoftwareKeyboardController.current
|
val keyboardController = LocalSoftwareKeyboardController.current
|
||||||
|
|
||||||
TextField(
|
TextField(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(MaterialTheme.colorScheme.background)
|
.background(MaterialTheme.colorScheme.background)
|
||||||
.fillMaxWidth()
|
.fillMaxWidth(0.85f)
|
||||||
.height(60.dp),
|
.height(60.dp),
|
||||||
value = text,
|
value = text,
|
||||||
onValueChange = { onTextChange(it) },
|
onValueChange = { onTextChange(it) },
|
||||||
|
Loading…
Reference in New Issue
Block a user