Skip to content

Commit

Permalink
fix: optimize title font size
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Info committed Nov 5, 2023
1 parent 9e1508e commit 2ed008b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun CampusCardInfoCard(
modifier = Modifier.padding(vertical = 8.dp),
color = MaterialTheme.colorScheme.primary,
text = text,
style = MaterialTheme.typography.displaySmall,
style = MaterialTheme.typography.headlineLarge,
textAlign = TextAlign.Center,
maxLines = 1,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand All @@ -33,8 +33,11 @@ fun ElectricityStatusCard(
balance: LoadResult<ElectricityBalance?>,
) {
val context = LocalContext.current
val subtitle = remember(balance) {
prompt(context, if (balance is LoadResult.Loading) null else LocalDateTime.now())
val subtitle = rememberSaveable(balance) {
prompt(
context,
if (balance is LoadResult.Ready && balance.data != null) LocalDateTime.now() else null
)
}

GlanceCard(
Expand Down Expand Up @@ -73,7 +76,7 @@ fun ElectricityStatusCard(
modifier = Modifier.padding(vertical = 8.dp),
color = MaterialTheme.colorScheme.primary,
text = text,
style = MaterialTheme.typography.displaySmall,
style = MaterialTheme.typography.headlineLarge,
textAlign = TextAlign.Center,
)
}
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/kotlin/com/zjutjh/ijh/ui/component/GlanceCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ internal fun GlanceCard(
IconText(
icon = icon,
text = " | $title",
style = MaterialTheme.typography.headlineMedium,
style = MaterialTheme.typography.headlineSmall,
fontWeight = FontWeight.Bold,
)
else Text(
text = title,
style = MaterialTheme.typography.headlineMedium,
style = MaterialTheme.typography.headlineSmall,
fontWeight = FontWeight.Bold,
maxLines = 1,
)
Expand All @@ -65,7 +65,6 @@ internal fun GlanceCard(
Text(
text = subtitle,
style = MaterialTheme.typography.titleSmall,
color = MaterialTheme.colorScheme.outline,
maxLines = 1,
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<string name="lib_account">图书馆账号</string>
<string name="yxy_account">易校园账号</string>
<string name="about">关于</string>
<string name="about_text">客户端由 [dev] 开发,服务由 [serv] 提供。</string>
<string name="about_text">[dev] 开发,并基于 [serv] 服务。</string>
<string name="app_widget_schedule_description">今日课程</string>
<string name="more">更多</string>
<string name="balance">余额</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<string name="lib_account">Library Account</string>
<string name="yxy_account">YXY Account</string>
<string name="about">About</string>
<string name="about_text">Client is developed by [dev], \nService is provided by [serv].</string>
<string name="about_text">Developer: [dev];\nServices provider: [serv].</string>
<string name="app_developer" translatable="false">IInfo</string>
<string name="service_provider" translatable="false">WeJH</string>
<string name="developer_url" translatable="false">https://github.com/I-Info</string>
Expand Down

0 comments on commit 2ed008b

Please sign in to comment.