1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-3375 Settings | Design | Design review fixes (#2270)

This commit is contained in:
Evgenii Kozlov 2025-04-09 17:11:25 +02:00 committed by GitHub
parent 0c7f01adb1
commit def7a08d95
Signed by: github
GPG key ID: B5690EEEBB952194
9 changed files with 35 additions and 42 deletions

View file

@ -61,6 +61,7 @@ import com.anytypeio.anytype.core_ui.foundation.noRippleThrottledClickable
import com.anytypeio.anytype.core_ui.views.BodyBold
import com.anytypeio.anytype.core_ui.views.BodyCalloutRegular
import com.anytypeio.anytype.core_ui.views.BodyRegular
import com.anytypeio.anytype.core_ui.views.BodySemiBold
import com.anytypeio.anytype.core_ui.views.Caption1Regular
import com.anytypeio.anytype.core_ui.views.PreviewTitle1Regular
import com.anytypeio.anytype.core_ui.widgets.ListWidgetObjectIcon
@ -135,11 +136,6 @@ fun DefaultTypeItem(
style = PreviewTitle1Regular,
color = colorResource(id = R.color.text_primary),
)
ListWidgetObjectIcon(
modifier = Modifier,
iconSize = 20.dp,
icon = icon
)
Text(
modifier = Modifier.padding(start = 8.dp),
text = name.take(10),
@ -150,7 +146,7 @@ fun DefaultTypeItem(
)
Image(
painter = painterResource(id = R.drawable.ic_disclosure_8_24),
contentDescription = "Members icon",
contentDescription = null,
modifier = Modifier.size(24.dp)
)
}
@ -322,15 +318,11 @@ fun BaseButton(
Text(
modifier = Modifier
.wrapContentSize()
.background(
color = colorResource(id = R.color.transparent_active),
shape = CircleShape
)
.padding(horizontal = 6.dp),
text = "$count",
textAlign = TextAlign.Center,
style = Caption1Regular,
color = colorResource(id = R.color.text_white),
style = BodyRegular,
color = colorResource(id = R.color.text_secondary),
)
}
Image(
@ -372,13 +364,13 @@ fun NewSpaceNameInputField(
Column(modifier = modifier) {
Text(
text = stringResource(id = R.string.space_name),
style = BodyCalloutRegular.copy(color = colorResource(id = R.color.text_primary)),
text = stringResource(id = R.string.name),
style = Caption1Regular.copy(color = colorResource(id = R.color.text_primary)),
color = colorResource(id = R.color.text_secondary)
)
NewSettingsTextField(
value = nameValue.value,
textStyle = BodyBold.copy(color = colorResource(id = R.color.text_primary)),
textStyle = BodySemiBold.copy(color = colorResource(id = R.color.text_primary)),
onValueChange = {
nameValue.value = it
},
@ -400,6 +392,7 @@ fun NewSpaceDescriptionBlock(
description: String,
isEditEnabled: Boolean,
onDescriptionSet: (String) -> Unit = {},
allowEmptyValue: Boolean = true
) {
val descriptionValue = remember { mutableStateOf(description) }
@ -414,16 +407,14 @@ fun NewSpaceDescriptionBlock(
.debounce(300L)
.dropWhile { input -> input == description }
.distinctUntilChanged()
.filter { it.isNotEmpty() }
.collect { query ->
onDescriptionSet(query)
}
.filter { if (allowEmptyValue) true else it.isNotEmpty() }
.collect { query -> onDescriptionSet(query) }
}
Column(modifier = modifier) {
Text(
text = stringResource(id = R.string.space_settings_space_description_hint),
style = BodyCalloutRegular,
text = stringResource(id = R.string.description),
style = Caption1Regular,
color = colorResource(id = R.color.text_secondary)
)
NewSettingsTextField(
@ -450,7 +441,7 @@ fun NewSettingsTextField(
onValueChange: (String) -> Unit,
visualTransformation: VisualTransformation = VisualTransformation.None,
keyboardActions: KeyboardActions = KeyboardActions.Default,
textStyle: TextStyle = BodyBold,
textStyle: TextStyle = BodySemiBold,
placeholderText: String,
isEditEnabled: Boolean
) {
@ -653,8 +644,7 @@ fun AutoCreateWidgetItem(
checkedBorderColor = Color.Transparent,
uncheckedBorderColor = Color.Transparent,
checkedTrackColor = colorResource(R.color.palette_system_amber_50),
uncheckedTrackColor = colorResource(R.color.palette_system_amber_50),
uncheckedThumbColor = colorResource(R.color.glyph_white)
uncheckedTrackColor = colorResource(R.color.shape_secondary)
)
)

View file

@ -46,6 +46,7 @@ import com.anytypeio.anytype.presentation.spaces.UiEvent
import com.anytypeio.anytype.presentation.spaces.UiSpaceSettingsItem
import com.anytypeio.anytype.presentation.spaces.UiSpaceSettingsState
import com.anytypeio.anytype.ui_settings.R
import timber.log.Timber
@Composable
fun SpaceSettingsContainer(
@ -508,7 +509,6 @@ private fun EditDescriptionField(
initialInput: String,
onSaveFieldValueClicked: (String) -> Unit
) {
var fieldInput by remember { mutableStateOf(initialInput) }
Scaffold(
@ -527,7 +527,7 @@ private fun EditDescriptionField(
.noRippleClickable {
onSaveFieldValueClicked(fieldInput)
},
text = "Done",
text = stringResource(R.string.done),
style = PreviewTitle1Medium,
color = if (fieldInput != initialInput) {
colorResource(id = R.color.text_primary)