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.util.DraggableItem
import com.anytypeio.anytype.core_ui.foundation.util.dragContainer
import com.anytypeio.anytype.core_ui.foundation.util.rememberDragDropState
import com.anytypeio.anytype.core_ui.views.BodyBold
import com.anytypeio.anytype.core_ui.views.BodySemiBold
import com.anytypeio.anytype.core_ui.views.Relations3
import com.anytypeio.anytype.core_ui.views.Title1
import com.anytypeio.anytype.core_utils.insets.EDGE_TO_EDGE_MIN_SDK
@ -345,7 +346,7 @@ fun VaultSpaceCard(
) {
Text(
text = title.ifEmpty { stringResource(id = R.string.untitled) },
style = BodyBold,
style = BodySemiBold,
color = colorResource(id = R.color.text_primary),
maxLines = 1,
overflow = TextOverflow.Ellipsis

View file

@ -61,6 +61,14 @@ val HeadlineSubheading =
//Content/Body/Bold
val BodyBold = TextStyle(
fontFamily = fontInterBold,
fontWeight = FontWeight.W700,
fontSize = 17.sp,
lineHeight = 24.sp,
letterSpacing = (-0.024).em
)
val BodySemiBold = TextStyle(
fontFamily = fontInterSemibold,
fontWeight = FontWeight.W600,
fontSize = 17.sp,

View file

@ -4,16 +4,7 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,10.75C13.795,10.75 15.25,9.183 15.25,7.25C15.25,5.317 13.795,3.75 12,3.75C10.205,3.75 8.75,5.317 8.75,7.25C8.75,9.183 10.205,10.75 12,10.75ZM12,12.25C8.686,12.25 6,14.936 6,18.25C6,19.355 6.895,20.25 8,20.25H16C17.105,20.25 18,19.355 18,18.25C18,14.936 15.314,12.25 12,12.25Z"
android:pathData="M13.25,6.25C13.25,8.183 11.795,9.75 10,9.75C8.205,9.75 6.75,8.183 6.75,6.25C6.75,4.317 8.205,2.75 10,2.75C11.795,2.75 13.25,4.317 13.25,6.25ZM10,11.25C6.686,11.25 4,13.936 4,17.25C4,18.355 4.895,19.25 6,19.25H11.132C10.729,18.507 10.5,17.655 10.5,16.75C10.5,14.781 11.584,13.065 13.188,12.166C12.265,11.586 11.172,11.25 10,11.25ZM20,17C20,19.209 18.209,21 16,21C13.791,21 12,19.209 12,17C12,14.791 13.791,13 16,13C18.209,13 20,14.791 20,17ZM15.25,18.75C15.25,19.164 15.586,19.5 16,19.5C16.414,19.5 16.75,19.164 16.75,18.75V17.75H17.75C18.164,17.75 18.5,17.414 18.5,17C18.5,16.586 18.164,16.25 17.75,16.25H16.75V15.25C16.75,14.836 16.414,14.5 16,14.5C15.586,14.5 15.25,14.836 15.25,15.25V16.25H14.25C13.836,16.25 13.5,16.586 13.5,17C13.5,17.414 13.836,17.75 14.25,17.75H15.25V18.75Z"
android:fillColor="@color/glyph_button"
android:fillType="evenOdd"/>
<path
android:pathData="M18,18m-4.75,0a4.75,4.75 0,1 1,9.5 0a4.75,4.75 0,1 1,-9.5 0"
android:strokeWidth="1.5"
android:fillColor="@color/glyph_button"
android:strokeColor="#ffffff"/>
<path
android:pathData="M17.25,19.75C17.25,20.164 17.586,20.5 18,20.5C18.414,20.5 18.75,20.164 18.75,19.75V18.75H19.75C20.164,18.75 20.5,18.414 20.5,18C20.5,17.586 20.164,17.25 19.75,17.25H18.75V16.25C18.75,15.836 18.414,15.5 18,15.5C17.586,15.5 17.25,15.836 17.25,16.25V17.25H16.25C15.836,17.25 15.5,17.586 15.5,18C15.5,18.414 15.836,18.75 16.25,18.75H17.25V19.75Z"
android:fillColor="@color/shape_primary"
android:fillType="evenOdd"/>
</vector>

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)

View file

@ -1955,8 +1955,8 @@ Please provide specific details of your needs here.</string>
<string name="field_menu_add_to_type">Add to the current type</string>
<string name="field_menu_remove_from_object">Remove from the object</string>
<string name="space_settings_space_name_hint">Name</string>
<string name="space_settings_space_description_hint">Description</string>
<string name="space_settings_space_name_hint">Add a name</string>
<string name="space_settings_space_description_hint">Add a description</string>
<string name="space_settings_section_collaboration">Collaboration</string>
<string name="space_settings_section_content_model">Content Model</string>
<string name="space_settings_section_preferences">Preferences</string>

View file

@ -37,6 +37,7 @@ import com.anytypeio.anytype.core_ui.foundation.Divider
import com.anytypeio.anytype.core_ui.views.BodyBold
import com.anytypeio.anytype.core_ui.views.BodyCallout
import com.anytypeio.anytype.core_ui.views.BodyRegular
import com.anytypeio.anytype.core_ui.views.BodySemiBold
import com.anytypeio.anytype.core_ui.views.Relations2
import com.anytypeio.anytype.payments.R
import com.anytypeio.anytype.payments.models.TierAnyName
@ -79,7 +80,7 @@ fun AnyNameView(
modifier = Modifier.fillMaxWidth(),
text = stringResource(id = R.string.payments_tier_details_name_title),
color = colorResource(id = R.color.text_primary),
style = BodyBold,
style = BodySemiBold,
textAlign = TextAlign.Start
)
Spacer(modifier = Modifier.height(6.dp))

View file

@ -45,6 +45,7 @@ import androidx.compose.ui.unit.dp
import com.anytypeio.anytype.core_models.membership.MembershipErrors
import com.anytypeio.anytype.core_ui.foundation.noRippleThrottledClickable
import com.anytypeio.anytype.core_ui.views.BodyBold
import com.anytypeio.anytype.core_ui.views.BodySemiBold
import com.anytypeio.anytype.core_ui.views.HeadlineTitle
import com.anytypeio.anytype.core_ui.views.PreviewTitle1Regular
import com.anytypeio.anytype.payments.R
@ -113,7 +114,7 @@ private fun ModalCodeContent(
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp),
text = stringResource(id = com.anytypeio.anytype.localization.R.string.payments_code_title),
style = BodyBold,
style = BodySemiBold,
color = colorResource(
id = R.color.text_primary
),

View file

@ -23,6 +23,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.anytypeio.anytype.core_ui.R
import com.anytypeio.anytype.core_ui.views.BodyBold
import com.anytypeio.anytype.core_ui.views.BodySemiBold
import com.anytypeio.anytype.core_ui.views.Relations2
@Composable
@ -60,7 +61,7 @@ fun InfoCard(
.verticalScroll(rememberScrollState()),
text = title,
color = colorResource(id = R.color.text_primary),
style = BodyBold,
style = BodySemiBold,
textAlign = TextAlign.Center
)
Text(