Refine modify favorites dialog layout
This commit is contained in:
1 parent
bfbceefef2
commit
68155e6a6b
4 files changed
+12
-27
No files matched your search
@@ -21,7 +21,7 @@ fun CircularLayout(
|
||||
modifier = modifier,
|
||||
content = content,
|
||||
) { measurables, constraints ->
|
||||
val radiusPx = constraints.maxWidth * 0.35
|
||||
val radiusPx = constraints.maxWidth * 0.4
|
||||
val itemConstraints = constraints.copy(minWidth = 0, minHeight = 0)
|
||||
val placeables = measurables.map { measurable -> measurable.measure(itemConstraints) }
|
||||
val outPlaceables = if (placeFirstItemInCenter) placeables.drop(1) else placeables
|
||||
|
||||
@@ -41,8 +41,6 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
@@ -251,7 +249,6 @@ class DialogState {
|
||||
@StringRes title: Int,
|
||||
@StringRes hint: Int,
|
||||
maxChar: Int,
|
||||
adjustTextPosition: Boolean = true,
|
||||
): Pair<Int, String> = showNoButton(false) {
|
||||
Column {
|
||||
Text(text = stringResource(id = title), modifier = Modifier.padding(horizontal = 16.dp).padding(top = 16.dp), style = MaterialTheme.typography.titleMedium)
|
||||
@@ -263,8 +260,7 @@ class DialogState {
|
||||
TextField(
|
||||
value = note,
|
||||
onValueChange = { note = it },
|
||||
modifier = Modifier.fillMaxWidth(0.4F),
|
||||
textStyle = TextStyle(fontFamily = FontFamily.Monospace),
|
||||
modifier = Modifier.fillMaxWidth(0.45F).aspectRatio(1F),
|
||||
label = { Text(text = stringResource(id = hint)) },
|
||||
trailingIcon = {
|
||||
if (note.isNotEmpty()) {
|
||||
@@ -280,7 +276,6 @@ class DialogState {
|
||||
textAlign = TextAlign.End,
|
||||
)
|
||||
},
|
||||
maxLines = 6,
|
||||
shape = ShapeDefaults.ExtraSmall,
|
||||
colors = TextFieldDefaults.colors(
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
@@ -293,24 +288,14 @@ class DialogState {
|
||||
.fillMaxWidth(0.2F),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
if (index == 0 && adjustTextPosition) {
|
||||
Text(
|
||||
text = text,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 2,
|
||||
textAlign = TextAlign.Center,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
Icon(imageVector = icon, contentDescription = null, tint = AlertDialogDefaults.iconContentColor)
|
||||
} else {
|
||||
Icon(imageVector = icon, contentDescription = null, tint = AlertDialogDefaults.iconContentColor)
|
||||
Text(
|
||||
text = text,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 2,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
}
|
||||
Icon(imageVector = icon, contentDescription = null, tint = AlertDialogDefaults.iconContentColor)
|
||||
Text(
|
||||
text = text,
|
||||
textAlign = TextAlign.Center,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 2,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@
|
||||
<string name="default_favorites_collection">默认收藏夹</string>
|
||||
<string name="default_favorites_warning">启用此项将无法添加收藏备注</string>
|
||||
<string name="let_me_select">让我选择</string>
|
||||
<string name="favorite_note">备注</string>
|
||||
<string name="favorite_note">收藏备注</string>
|
||||
<string name="collections">收藏夹</string>
|
||||
<string name="need_sign_in">需要登录</string>
|
||||
<!-- Progress Scene -->
|
||||
|
||||
@@ -477,7 +477,7 @@
|
||||
<string name="default_favorites_collection">Default favorites collection</string>
|
||||
<string name="default_favorites_warning">You won\'t be able to add favorite notes if you enable this</string>
|
||||
<string name="let_me_select">Let me select</string>
|
||||
<string name="favorite_note">Note</string>
|
||||
<string name="favorite_note">Favorite Note</string>
|
||||
<string name="collections">Collections</string>
|
||||
<string name="need_sign_in">Signing in is required</string>
|
||||
<!-- Progress Scene -->
|
||||
|
||||
Reference in new issue
Block a user