mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3375 New settings | Enhancement | Settings as fullscreen fragment + Navigation to remote storage + Delete space UX + other misc. fixes (#2161)
This commit is contained in:
parent
0475183585
commit
29c43b0cfc
8 changed files with 114 additions and 92 deletions
|
@ -84,7 +84,8 @@ fun NewSpaceIcon(
|
|||
}
|
||||
},
|
||||
text = stringResource(R.string.space_settings_icon_title),
|
||||
style = Caption1Medium
|
||||
style = Caption1Medium,
|
||||
color = colorResource(R.color.text_secondary)
|
||||
)
|
||||
MaterialTheme(
|
||||
shapes = MaterialTheme.shapes.copy(medium = RoundedCornerShape(10.dp))
|
||||
|
|
|
@ -235,6 +235,16 @@ fun SpaceInfoItem(
|
|||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun RemoteStorageItem(
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
BaseButton(
|
||||
modifier = modifier,
|
||||
title = stringResource(id = R.string.remote_storage),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun DeleteSpaceItem(
|
||||
modifier: Modifier = Modifier
|
||||
|
|
|
@ -5,7 +5,6 @@ import androidx.compose.foundation.Image
|
|||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
|
@ -135,6 +134,7 @@ fun NewSpaceSettingsScreen(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
is UiSpaceSettingsItem.Name -> {
|
||||
item {
|
||||
NewSpaceNameInputField(
|
||||
|
@ -149,8 +149,7 @@ fun NewSpaceSettingsScreen(
|
|||
.animateItem()
|
||||
.noRippleClickable {
|
||||
showEditTitle = true
|
||||
}
|
||||
,
|
||||
},
|
||||
name = item.name,
|
||||
isEditEnabled = false
|
||||
)
|
||||
|
@ -171,8 +170,7 @@ fun NewSpaceSettingsScreen(
|
|||
.animateItem()
|
||||
.noRippleClickable {
|
||||
showEditDescription = true
|
||||
}
|
||||
,
|
||||
},
|
||||
isEditEnabled = false,
|
||||
description = initialDescription
|
||||
)
|
||||
|
@ -192,6 +190,7 @@ fun NewSpaceSettingsScreen(
|
|||
is UiSpaceSettingsItem.Chat -> {
|
||||
// TODO
|
||||
}
|
||||
|
||||
is UiSpaceSettingsItem.DefaultObjectType -> {
|
||||
item {
|
||||
DefaultTypeItem(
|
||||
|
@ -199,8 +198,7 @@ fun NewSpaceSettingsScreen(
|
|||
.fillMaxWidth()
|
||||
.animateItem()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable { uiEvent(UiEvent.OnDefaultObjectTypeClicked(item.id)) }
|
||||
,
|
||||
.clickable { uiEvent(UiEvent.OnDefaultObjectTypeClicked(item.id)) },
|
||||
name = item.name,
|
||||
icon = item.icon
|
||||
)
|
||||
|
@ -213,6 +211,8 @@ fun NewSpaceSettingsScreen(
|
|||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.animateItem()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable { uiEvent(UiEvent.OnDeleteSpaceClicked) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -224,8 +224,7 @@ fun NewSpaceSettingsScreen(
|
|||
.fillMaxWidth()
|
||||
.animateItem()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable { uiEvent(UiEvent.OnSpaceMembersClicked) }
|
||||
,
|
||||
.clickable { uiEvent(UiEvent.OnSpaceMembersClicked) },
|
||||
item = item
|
||||
)
|
||||
}
|
||||
|
@ -244,6 +243,7 @@ fun NewSpaceSettingsScreen(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
UiSpaceSettingsItem.Fields -> {
|
||||
item {
|
||||
FieldsItem(
|
||||
|
@ -257,9 +257,19 @@ fun NewSpaceSettingsScreen(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
is UiSpaceSettingsItem.RemoteStorage -> {
|
||||
// TODO
|
||||
item {
|
||||
RemoteStorageItem(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.animateItem()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable { uiEvent(UiEvent.OnRemoteStorageClick) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
is UiSpaceSettingsItem.Section -> {
|
||||
item {
|
||||
SpaceSettingsSection(
|
||||
|
@ -284,7 +294,6 @@ fun NewSpaceSettingsScreen(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
is UiSpaceSettingsItem.Wallpapers -> {
|
||||
item {
|
||||
WallpaperItem(
|
||||
|
@ -293,9 +302,8 @@ fun NewSpaceSettingsScreen(
|
|||
.animateItem()
|
||||
.clip(RoundedCornerShape(16.dp))
|
||||
.clickable {
|
||||
uiEvent(UiEvent.OnWallpaperClicked)
|
||||
}
|
||||
,
|
||||
uiEvent(UiEvent.OnSelectWallpaperClicked)
|
||||
},
|
||||
item = item
|
||||
)
|
||||
}
|
||||
|
@ -390,7 +398,11 @@ private fun EditNameField(
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
containerColor = colorResource(id = R.color.background_secondary),
|
||||
topBar = {
|
||||
Box(modifier = Modifier.fillMaxWidth().height(48.dp)) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(48.dp)
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterEnd)
|
||||
|
@ -433,8 +445,7 @@ private fun EditNameField(
|
|||
width = 2.dp,
|
||||
color = colorResource(id = R.color.palette_system_amber_50)
|
||||
)
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp)
|
||||
,
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp),
|
||||
name = fieldInput,
|
||||
onNameSet = { newName ->
|
||||
fieldInput = newName
|
||||
|
@ -458,7 +469,11 @@ private fun EditDescriptionField(
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
containerColor = colorResource(id = R.color.background_secondary),
|
||||
topBar = {
|
||||
Box(modifier = Modifier.fillMaxWidth().height(48.dp)) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(48.dp)
|
||||
) {
|
||||
Text(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterEnd)
|
||||
|
@ -501,8 +516,7 @@ private fun EditDescriptionField(
|
|||
width = 2.dp,
|
||||
color = colorResource(id = R.color.palette_system_amber_50)
|
||||
)
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp)
|
||||
,
|
||||
.padding(vertical = 12.dp, horizontal = 16.dp),
|
||||
description = fieldInput,
|
||||
isEditEnabled = true,
|
||||
onDescriptionSet = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue