mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-2966 Chats | Fix | Back nagivation fixes
This commit is contained in:
parent
e0392fe01f
commit
89c9ef6ad9
3 changed files with 15 additions and 3 deletions
|
@ -900,6 +900,10 @@ class ChatViewModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
fun onSpaceNameClicked(isSpaceRoot: Boolean) {
|
||||
onBackButtonPressed(isSpaceRoot = isSpaceRoot)
|
||||
}
|
||||
|
||||
fun onSpaceIconClicked() {
|
||||
viewModelScope.launch {
|
||||
commands.emit(ViewModelCommand.OpenWidgets)
|
||||
|
|
|
@ -42,7 +42,8 @@ import com.anytypeio.anytype.presentation.spaces.SpaceIconView
|
|||
fun ChatTopToolbar(
|
||||
header: ChatViewModel.HeaderView,
|
||||
onSpaceIconClicked: () -> Unit,
|
||||
onBackButtonClicked: () -> Unit
|
||||
onBackButtonClicked: () -> Unit,
|
||||
onSpaceNameClicked: () -> Unit
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
@ -65,6 +66,10 @@ fun ChatTopToolbar(
|
|||
)
|
||||
}
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.noRippleClickable { onSpaceNameClicked() }
|
||||
,
|
||||
text = when(header) {
|
||||
is ChatViewModel.HeaderView.Default -> header.title
|
||||
is ChatViewModel.HeaderView.Init -> ""
|
||||
|
@ -72,7 +77,6 @@ fun ChatTopToolbar(
|
|||
color = colorResource(R.color.text_primary),
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
modifier = Modifier.weight(1f),
|
||||
textAlign = TextAlign.Center,
|
||||
style = Title1
|
||||
)
|
||||
|
@ -113,7 +117,8 @@ fun ChatTopToolbarPreview() {
|
|||
showIcon = true
|
||||
),
|
||||
onSpaceIconClicked = {},
|
||||
onBackButtonClicked = {}
|
||||
onBackButtonClicked = {},
|
||||
onSpaceNameClicked = {}
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue