Skip to content

Commit

Permalink
优化UI显示
Browse files Browse the repository at this point in the history
  • Loading branch information
hefengbao committed Mar 19, 2024
1 parent 012818b commit 3683f29
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ fun SimpleSearchScaffold(
}
),
cursorBrush = SolidColor(MaterialTheme.colorScheme.primary),
textStyle = textStyle,
textStyle = textStyle.copy(
color = MaterialTheme.colorScheme.onBackground
),
decorationBox = { innerTextField ->
Row(
modifier = modifier
Expand All @@ -92,7 +94,13 @@ fun SimpleSearchScaffold(
modifier = modifier.weight(1f)
) {
if (value.isEmpty())
Text(text = hint, color = Color.Gray, style = textStyle)
Text(
text = hint,
color = MaterialTheme.colorScheme.onBackground.copy(
alpha = .5f
),
style = textStyle
)

innerTextField()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.hefengbao.jingmo.ui.screen.settings

import android.annotation.SuppressLint
import android.widget.Toast
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
Expand Down Expand Up @@ -303,7 +303,9 @@ private fun DataScreen(
)
}

Divider(modifier = modifier.padding(horizontal = 16.dp))
if (index != menus.lastIndex) {
Divider(modifier = modifier.padding(horizontal = 16.dp))
}
}
}
}
Expand Down Expand Up @@ -341,6 +343,7 @@ private fun TipDialog() {
}
}

@SuppressLint("DefaultLocale")
@Composable
private fun Item(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -387,12 +390,8 @@ private fun Item(
)
}

if (progress != 100f) {
CircularProgressIndicator(
progress = progress,
strokeWidth = 2.dp,
modifier = modifier.size(24.dp)
)
if (progress > 0 && progress != 100f) {
Text(text = "${String.format("%.2f", progress * 100)}%")
}
}
Spacer(modifier = modifier.width(16.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private fun ImportScreen(
onBackClick = onBackClick,
title = "导入数据",
actions = {
IconButton(onClick = { uriHandler.openUri("https://www.baidu.com") }) {
IconButton(onClick = { uriHandler.openUri("https://mp.weixin.qq.com/s/VT4zx-2vnrwuVZ2Eq5yGCg") }) {
Icon(imageVector = Icons.AutoMirrored.Filled.HelpOutline, contentDescription = "")
}
}
Expand Down

0 comments on commit 3683f29

Please sign in to comment.