feat(settings): 优化更多提示信息的显示方式

This commit is contained in:
Super12138 2025-02-06 22:06:33 +08:00
parent 326f7ff970
commit 746b663e9c
5 changed files with 51 additions and 3 deletions

View file

@ -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
@ -81,6 +82,7 @@ fun SettingsInterface(
description = stringResource(R.string.pref_haptic_feedback_desc),
onCheckedChange = {}
)
SettingsPlainBox(stringResource(R.string.pref_haptic_feedback_more_info))
}
}

View file

@ -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
)
)
}
}

View file

@ -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

View file

@ -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>

View file

@ -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>