Skip to content

Commit

Permalink
feat(settings): 优化更多提示信息的显示方式
Browse files Browse the repository at this point in the history
  • Loading branch information
Super12138 committed Feb 6, 2025
1 parent 326f7ff commit 746b663
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import cn.super12138.todo.logic.model.SortingMethod
import cn.super12138.todo.ui.components.LargeTopAppBarScaffold
import cn.super12138.todo.ui.pages.settings.components.SettingsCategory
import cn.super12138.todo.ui.pages.settings.components.SettingsItem
import cn.super12138.todo.ui.pages.settings.components.SettingsPlainBox
import cn.super12138.todo.ui.pages.settings.components.SettingsRadioDialog
import cn.super12138.todo.ui.pages.settings.components.SettingsRadioOptions
import cn.super12138.todo.ui.pages.settings.components.SwitchSettingsItem
Expand Down Expand Up @@ -81,6 +82,7 @@ fun SettingsInterface(
description = stringResource(R.string.pref_haptic_feedback_desc),
onCheckedChange = {}
)
SettingsPlainBox(stringResource(R.string.pref_haptic_feedback_more_info))
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package cn.super12138.todo.ui.pages.settings.components

import androidx.compose.foundation.layout.Column
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.wrapContentHeight
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Info
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import cn.super12138.todo.R

@Composable
fun SettingsPlainBox(
text: String,
modifier: Modifier = Modifier
) {
Column(
modifier = modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(start = 24.dp, end = 24.dp, bottom = 20.dp),
) {
Icon(
imageVector = Icons.Outlined.Info,
contentDescription = stringResource(R.string.tip_tips)
)
Spacer(Modifier.size(20.dp))
Text(
text = text,
style = MaterialTheme.typography.bodyMedium.copy(
color = MaterialTheme.colorScheme.onSurfaceVariant
)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,7 @@
<string name="pref_sorting_method">排序方式</string>
<string name="pref_category_global_interaction">全局交互</string>
<string name="pref_haptic_feedback">触感反馈</string>
<string name="pref_haptic_feedback_desc">为某些操作提供轻微的震动反馈(须先在系统设置开启)</string>
<string name="pref_haptic_feedback_desc">为某些操作提供轻微的震动反馈</string>
<string name="tip_tips">提示</string>
<string name="pref_haptic_feedback_more_info">使用此项前须先在系统设置中打开触感反馈(通常在“声音与震动”里的“触感反馈”一项)</string>
</resources>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,7 @@
<string name="pref_sorting_method">Sorting Method</string>
<string name="pref_category_global_interaction">Global Interaction</string>
<string name="pref_haptic_feedback">Haptic Feedback</string>
<string name="pref_haptic_feedback_desc">Provide slight vibration feedback for some operations (must be enabled in system settings first)</string>
<string name="pref_haptic_feedback_desc">Provide slight vibration feedback for some operations</string>
<string name="tip_tips">Tips</string>
<string name="pref_haptic_feedback_more_info">Before using this feature, you need to enable haptic feedback in the system settings (usually under the \\\"Sound &amp; Vibration\\\" section in the \\\"Haptic Feedback\\\" option)</string>
</resources>

0 comments on commit 746b663

Please sign in to comment.