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

DROID-1471 Onboarding | Fix | Placeholder colors (#131)

This commit is contained in:
Evgenii Kozlov 2023-07-05 18:26:36 +02:00 committed by GitHub
parent f5eaa4989b
commit 02b321c299
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 13 deletions

View file

@ -224,11 +224,11 @@
<dialog
android:id="@+id/logoutWarningScreen"
android:name="com.anytypeio.anytype.ui.settings.LogoutWarningFragment"></dialog>
android:name="com.anytypeio.anytype.ui.settings.LogoutWarningFragment"/>
<dialog
android:id="@+id/deleteAccountWarningScreen"
android:name="com.anytypeio.anytype.ui.auth.account.DeleteAccountWarning"></dialog>
android:name="com.anytypeio.anytype.ui.auth.account.DeleteAccountWarning"/>
<fragment
android:id="@+id/createAccountScreen"

View file

@ -253,7 +253,7 @@ private fun Header(
Dragger()
}
Box(modifier = modifier.padding(top = 12.dp, bottom = 28.dp)) {
ProfileTileBlock()
ProfileTitleBlock()
}
Box(modifier = modifier.padding(bottom = 16.dp)) {
ProfileImageBlock(
@ -300,7 +300,7 @@ fun ProfileNameBlock(
onValueChange = {
nameValue.value = it
},
modifier = Modifier.padding(top = 4.dp, end = 20.dp),
modifier = Modifier.fillMaxWidth().padding(top = 4.dp, end = 20.dp),
enabled = true,
textStyle = TextStyle(
fontSize = 22.sp,
@ -325,7 +325,7 @@ fun ProfileNameBlock(
enabled = true,
isError = false,
placeholder = {
Text(text = "Account name")
Text(text = stringResource(R.string.account_name))
},
colors = TextFieldDefaults.outlinedTextFieldColors(
textColor = colorResource(id = R.color.text_primary),
@ -335,6 +335,7 @@ fun ProfileNameBlock(
focusedBorderColor = Color.Transparent,
unfocusedBorderColor = Color.Transparent,
placeholderColor = colorResource(id = R.color.text_tertiary),
cursorColor = colorResource(id = R.color.orange)
),
contentPadding = PaddingValues(
start = 0.dp,
@ -353,7 +354,7 @@ fun ProfileNameBlock(
}
@Composable
fun ProfileTileBlock() {
fun ProfileTitleBlock() {
Text(
text = stringResource(R.string.profile),
style = Title1,

View file

@ -50,7 +50,7 @@ fun MainSettingScreen(
onFileStorageClick: () -> Unit
) {
Column(Modifier.fillMaxSize()) {
Header(
SpaceHeader(
modifier = Modifier.align(Alignment.CenterHorizontally),
workspace = workspace,
onSpaceIconClick = onSpaceIconClick,
@ -123,7 +123,7 @@ private fun Settings(
}
@Composable
private fun Header(
private fun SpaceHeader(
modifier: Modifier = Modifier,
workspace: MainSettingsViewModel.WorkspaceAndAccount,
onSpaceIconClick: () -> Unit,
@ -146,7 +146,10 @@ private fun Header(
}
}
workspace.space?.name?.let {
NameBlock(name = it, onNameSet = onNameSet)
SpaceNameBlock(
name = it,
onNameSet = onNameSet
)
}
}
is MainSettingsViewModel.WorkspaceAndAccount.Idle -> {}

View file

@ -63,7 +63,7 @@ fun Section(modifier: Modifier = Modifier, title: String) {
@OptIn(FlowPreview::class)
@Composable
fun NameBlock(
fun SpaceNameBlock(
modifier: Modifier = Modifier,
name: String,
onNameSet: (String) -> Unit
@ -177,7 +177,8 @@ fun SpaceImageBlock(
}
) {
Box(
modifier = Modifier.align(Alignment.Center)
modifier = Modifier
.align(Alignment.Center)
.size(gradientSize)
.clip(RoundedCornerShape(32.dp))
.background(gradient)
@ -234,13 +235,15 @@ fun SettingsTextField(
value = value,
visualTransformation = visualTransformation,
innerTextField = innerTextField,
placeholder = null,
label = null,
leadingIcon = null,
trailingIcon = null,
singleLine = true,
enabled = true,
isError = false,
placeholder = {
Text(text = stringResource(id = R.string.space_name))
},
interactionSource = remember { MutableInteractionSource() },
colors = TextFieldDefaults.outlinedTextFieldColors(
textColor = colorResource(id = R.color.text_primary),
@ -249,7 +252,7 @@ fun SettingsTextField(
errorBorderColor = Color.Transparent,
focusedBorderColor = Color.Transparent,
unfocusedBorderColor = Color.Transparent,
placeholderColor = colorResource(id = R.color.glyph_active),
placeholderColor = colorResource(id = R.color.text_tertiary),
cursorColor = colorResource(id = R.color.orange)
),
contentPadding = PaddingValues(),

View file

@ -66,4 +66,5 @@
<string name="remote_storage">Remote storage</string>
<string name="contact_us">Contact us</string>
<string name="get_more_space">Get more space</string>
<string name="account_name">Account name</string>
</resources>