Merge branch 'dev' into update_zh_TW

# Conflicts:
#	app/src/main/res/values-zh-rTW/strings.xml
This commit is contained in:
Shun Min Chang
2025-10-31 00:13:33 +08:00
4 changed files with 67 additions and 41 deletions

View File

@@ -17,29 +17,35 @@
package org.nsh07.pomodoro.ui.timerScreen
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.material3.AlertDialogDefaults
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.foundation.layout.size
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme.colorScheme
import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import org.nsh07.pomodoro.R
import org.nsh07.pomodoro.ui.theme.TomatoTheme
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -47,42 +53,57 @@ fun AlarmDialog(
modifier: Modifier = Modifier,
stopAlarm: () -> Unit
) {
BasicAlertDialog(
Dialog(
onDismissRequest = stopAlarm,
modifier = modifier
properties = DialogProperties(
usePlatformDefaultWidth = false,
decorFitsSystemWindows = false
)
) {
Surface(
modifier = Modifier
.wrapContentWidth()
.wrapContentHeight()
.clickable(onClick = stopAlarm),
shape = MaterialTheme.shapes.extraLarge,
tonalElevation = AlertDialogDefaults.TonalElevation,
Box(
contentAlignment = Alignment.Center,
modifier = modifier
.fillMaxSize()
.background(colorScheme.primaryContainer)
.clickable(onClick = stopAlarm)
) {
Column(modifier = Modifier.padding(24.dp)) {
Icon(
painter = painterResource(R.drawable.alarm),
contentDescription = stringResource(R.string.alarm),
modifier = Modifier.align(Alignment.CenterHorizontally)
)
Spacer(Modifier.height(16.dp))
Text(
text = stringResource(R.string.stop_alarm_question),
style = typography.headlineSmall,
modifier = Modifier.align(Alignment.CenterHorizontally)
)
Spacer(Modifier.height(16.dp))
Text(
text = stringResource(R.string.stop_alarm_dialog_text)
)
Spacer(modifier = Modifier.height(24.dp))
TextButton(
onClick = stopAlarm,
modifier = Modifier.align(Alignment.End),
) {
Text(stringResource(R.string.stop_alarm))
CompositionLocalProvider(LocalContentColor provides colorScheme.onPrimaryContainer) {
Column(modifier = Modifier.padding(24.dp)) {
Icon(
painter = painterResource(R.drawable.alarm),
contentDescription = stringResource(R.string.alarm),
modifier = Modifier
.align(Alignment.CenterHorizontally)
.size(40.dp)
)
Spacer(Modifier.height(16.dp))
Text(
text = stringResource(R.string.stop_alarm_question),
style = typography.headlineSmall,
modifier = Modifier.align(Alignment.CenterHorizontally)
)
Spacer(Modifier.height(16.dp))
Text(
text = stringResource(R.string.stop_alarm_dialog_text),
textAlign = TextAlign.Center
)
Spacer(modifier = Modifier.height(24.dp))
Button(
onClick = stopAlarm,
modifier = Modifier.align(Alignment.End),
) {
Text(stringResource(R.string.stop_alarm))
}
}
}
}
}
}
@Preview
@Composable
fun AlarmDialogPreview() {
TomatoTheme {
AlarmDialog(stopAlarm = {})
}
}

View File

@@ -66,7 +66,7 @@
<string name="dnd_desc">Activer le mode ne pas déranger pendant un minuteur de concentration</string>
<string name="dynamic_color">Couleur dynamique</string>
<string name="dynamic_color_desc">Adapter les couleurs à celles de votre fond d\'écran</string>
<string name="tomato_foss_desc">Toutes les fonctionnalités sont déverrouillées dans cette version. Si mon application a fait une différence dans votre vie, veuillez envisager de me soutenir en faisant un don de %1$s.</string>
<string name="tomato_foss_desc">Toutes les fonctionnalités sont déverrouillées dans cette version. Si mon application a fait une différence dans votre vie, veuillez envisager de me soutenir en faisant un don sur %1$s.</string>
<string name="app_name_plus">Tomato+</string>
<string name="get_plus">Obtenir Tomato+</string>
<string name="tomato_foss">Tomato FOSS</string>

View File

@@ -64,4 +64,9 @@
<string name="sound">声音</string>
<string name="dnd">勿扰模式</string>
<string name="dnd_desc">运行「专注」计时器时打开勿扰</string>
<string name="get_plus">获取 Tomato+</string>
<string name="dynamic_color">动态颜色</string>
<string name="dynamic_color_desc">采用壁纸主题色</string>
<string name="tomato_foss">Tomato FOSS</string>
<string name="tomato_foss_desc">所有功能在此版本中处于解锁状态。如果我的应用让你的生活有所不同,请考虑在 %1$s 上捐款支持我。</string>
</resources>

View File

@@ -32,7 +32,7 @@
<string name="pause">暫停</string>
<string name="paused">已暫停</string>
<string name="play">開始</string>
<string name="pomodoro_info">一個「循環」是由多個番茄工作階段組成,包含專注時間、短休息與長休息。每個循環的最後一段休息都是長休息。</string>
<string name="pomodoro_info">「循環」是一系列番茄工作階段的組合,包含專注時間、短休息與長休息。每個循環的最後一段休息都是長休息。</string>
<string name="productivity_analysis">生產力分析</string>
<string name="productivity_analysis_desc">分析一天中不同時段的專注時長</string>
<string name="restart">重新開始</string>
@@ -64,7 +64,7 @@
<string name="durations">時長</string>
<string name="sound">聲音</string>
<string name="dnd">請勿打擾</string>
<string name="dnd_desc">執行專注計時器時開啟請勿打擾模式</string>
<string name="dnd_desc">執行專注計時器時自動開啟請勿打擾模式</string>
<string name="app_name_plus">Tomato+</string>
<string name="get_plus">取得 Tomato+</string>
<string name="dynamic_color">動態配色</string>