commit
76dc234b8c
4 changed files with 44 additions and 16 deletions
|
@ -227,12 +227,14 @@ fun SearchField(
|
||||||
onValueChange: (String) -> Unit,
|
onValueChange: (String) -> Unit,
|
||||||
onSubmit: () -> Unit,
|
onSubmit: () -> Unit,
|
||||||
@StringRes label: Int,
|
@StringRes label: Int,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier,
|
||||||
|
enabled: Boolean = true
|
||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
value = value,
|
value = value,
|
||||||
onValueChange = onValueChange,
|
onValueChange = onValueChange,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
|
enabled = enabled,
|
||||||
label = { Text(text = stringResource(id = label)) },
|
label = { Text(text = stringResource(id = label)) },
|
||||||
trailingIcon = {
|
trailingIcon = {
|
||||||
IconButton(onClick = onSubmit) {
|
IconButton(onClick = onSubmit) {
|
||||||
|
|
|
@ -10,10 +10,12 @@ import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Delete
|
import androidx.compose.material.icons.filled.Delete
|
||||||
import androidx.compose.material.icons.filled.Person
|
import androidx.compose.material.icons.filled.Person
|
||||||
|
import androidx.compose.material.icons.filled.Search
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
|
import androidx.compose.ui.modifier.modifierLocalConsumer
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.res.vectorResource
|
import androidx.compose.ui.res.vectorResource
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
|
@ -89,13 +91,32 @@ fun FriendsOverviewScreen(
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = {
|
title = {
|
||||||
// TODO Link to each other
|
// TODO Make search field
|
||||||
SearchField(
|
// SearchField(
|
||||||
value = uiState.queryString,
|
// value = uiState.queryString,
|
||||||
onValueChange = friendsOverviewActions.onQueryStringChange,
|
// onValueChange = friendsOverviewActions.onQueryStringChange,
|
||||||
onSubmit = friendsOverviewActions.onSubmit,
|
// onSubmit = friendsOverviewActions.onSubmit,
|
||||||
label = AppText.search_friends
|
// label = AppText.search_friends,
|
||||||
)
|
// enabled = false
|
||||||
|
// )
|
||||||
|
IconButton(
|
||||||
|
onClick = friendsOverviewActions.onSubmit,
|
||||||
|
// modifier = Modifier.background(
|
||||||
|
// color = MaterialTheme.colors.background
|
||||||
|
// ),
|
||||||
|
) {
|
||||||
|
Row {
|
||||||
|
Text(
|
||||||
|
text = stringResource(id = AppText.click_search_friends),
|
||||||
|
color = MaterialTheme.colors.onPrimary
|
||||||
|
)
|
||||||
|
Icon(
|
||||||
|
imageVector = Icons.Default.Search,
|
||||||
|
contentDescription = stringResource(AppText.search_friends),
|
||||||
|
tint = MaterialTheme.colors.onPrimary
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
IconButton(onClick = popUp) {
|
IconButton(onClick = popUp) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import androidx.compose.material.*
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.ArrowBack
|
import androidx.compose.material.icons.filled.ArrowBack
|
||||||
import androidx.compose.material.icons.filled.Person
|
import androidx.compose.material.icons.filled.Person
|
||||||
|
import androidx.compose.material.icons.filled.Search
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.*
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
@ -82,14 +83,16 @@ fun SearchFriendsScreen(
|
||||||
topBar = {
|
topBar = {
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
title = {
|
title = {
|
||||||
SearchField(
|
// TODO Make search field
|
||||||
value = query,
|
// SearchField(
|
||||||
onValueChange = { newValue ->
|
// value = uiState.queryString,
|
||||||
searchFriendsActions.onQueryStringChange(newValue)
|
// onValueChange = friendsOverviewActions.onQueryStringChange,
|
||||||
query = newValue
|
// onSubmit = friendsOverviewActions.onSubmit,
|
||||||
},
|
// label = AppText.search_friends,
|
||||||
onSubmit = { },
|
// enabled = false
|
||||||
label = AppText.search_friends
|
// )
|
||||||
|
Text(
|
||||||
|
text = stringResource(id = AppText.searching_friends)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
|
|
|
@ -134,6 +134,8 @@
|
||||||
<string name="send_friend_request">Send friend request</string>
|
<string name="send_friend_request">Send friend request</string>
|
||||||
<string name="remove_friend">Remove as friend</string>
|
<string name="remove_friend">Remove as friend</string>
|
||||||
<string name="show_profile">Show profile</string>
|
<string name="show_profile">Show profile</string>
|
||||||
|
<string name="click_search_friends">Click to search friends</string>
|
||||||
|
<string name="searching_friends">Searching friends</string>
|
||||||
|
|
||||||
<!-- ========== Create & edit screens ========== -->
|
<!-- ========== Create & edit screens ========== -->
|
||||||
|
|
||||||
|
|
Reference in a new issue