diff --git a/CHANGELOG.md b/CHANGELOG.md index c00ae83..2af4b8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [1.1.1] - 2023-04-08 + +### New features + +* German translation + +### Bug fixes + +* [#5] Image preview too dark: Removed gradient in large image view + ## [1.1.0] - 2023-03-15 ### New features diff --git a/README.md b/README.md index 1a065c9..ec5978f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,13 @@ It stores your photos in a local folder and your diary within the app. Import an Thank's to [@Cynog](https://github.com/Cynog) for providing the beautiful images in the screenshots! +## Translation + +OneShot is currently available in following languages: + +* English +* German + ## Privacy Your data is yours! diff --git a/app/build.gradle b/app/build.gradle index 2f651f5..1466e25 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "de.ptrlx.oneshot" minSdk 29 targetSdk 32 - versionCode 110 - versionName '1.1.0' + versionCode 111 + versionName '1.1.1' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/domain/util/HappinessType.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/domain/util/HappinessType.kt index 191e151..ba6c1fd 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/domain/util/HappinessType.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/domain/util/HappinessType.kt @@ -18,16 +18,16 @@ enum class HappinessType { } } - fun describe(): String { - return when (this) { - VERY_HAPPY -> "very happy" - HAPPY -> "happy" - NEUTRAL -> "neutral" - SAD -> "sad" - VERY_SAD -> "very sad" - NOT_SPECIFIED -> "" - } - } +// fun describe(): String { +// return when (this) { +// VERY_HAPPY -> "very happy" +// HAPPY -> "happy" +// NEUTRAL -> "neutral" +// SAD -> "sad" +// VERY_SAD -> "very sad" +// NOT_SPECIFIED -> "" +// } +// } fun progress(): Float { return when (this) { diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/DiaryViewModel.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/DiaryViewModel.kt index 36ae7f0..be80f69 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/DiaryViewModel.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/DiaryViewModel.kt @@ -187,11 +187,12 @@ class DiaryViewModel @Inject constructor( ) recentlyDeleteDiaryEntry = null } - } else if (snackbarCause == SnackbarCause.SUCCESS) { - // nothing to do here - } else if (snackbarCause == SnackbarCause.SUCCESS) { - // nothing to do here } +// else if (snackbarCause == SnackbarCause.SUCCESS) { +// nothing to do here +// } else if (snackbarCause == SnackbarCause.ERROR) { +// nothing to do here +// } } is DiaryEvent.WriteDBExport -> { if (entries.isNotEmpty()) { @@ -305,7 +306,7 @@ class DiaryViewModel @Inject constructor( val uri = copyImageUri?.let { fileManager?.copyImage(srcUri = copyImageUri, filename = filename) - }?: run { + } ?: run { fileManager?.createNewImageDummy(filename) } @@ -348,4 +349,4 @@ class DiaryViewModel @Inject constructor( modalBottomSheetShowEvent = true modalBottomSheetHideEvent = false } -} \ No newline at end of file +} diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/MainActivity.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/MainActivity.kt index 08b7526..a885d3e 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/MainActivity.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/MainActivity.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.compose.rememberNavController @@ -57,17 +58,17 @@ class MainActivity : ComponentActivity() { BottomNavigationBar( items = listOf( BottomNavItem( - name = "Home", + name = stringResource(R.string.route_home), route = "home", painter = painterResource(id = R.drawable.ic_baseline_cottage_24) ), BottomNavItem( - name = "Diary", + name = stringResource(R.string.route_diary), route = "diary", painter = painterResource(id = R.drawable.ic_baseline_photo_library_24) ), BottomNavItem( - name = "Statistics", + name = stringResource(R.string.route_statistics), route = "stats", painter = painterResource(id = R.drawable.ic_baseline_leaderboard_24) ), @@ -78,11 +79,12 @@ class MainActivity : ComponentActivity() { ) { _ -> if (viewModel.isSnackbarShowing) { + val context = LocalContext.current LaunchedEffect(viewModel.isSnackbarShowing) { try { when (scaffoldState.snackbarHostState.showSnackbar( - viewModel.snackbarCause.msg(), - actionLabel = viewModel.snackbarCause.actionLabel() + context.getString(viewModel.snackbarCause.msg()), + actionLabel = context.getString(viewModel.snackbarCause.actionLabel()) )) { SnackbarResult.ActionPerformed -> { viewModel.onEvent(DiaryEvent.SnackbarDismissed) diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/AddEditEntry.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/AddEditEntry.kt index e1f214c..a8d7a2e 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/AddEditEntry.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/AddEditEntry.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp @@ -47,13 +48,13 @@ fun AddEntryButton( RoundedButton( modifier = modifier, - text = "Capture today", + text = stringResource(R.string.btn_capture_today), onClick = { viewModel.createNewImageDummy()?.let { launcher.launch(it) } ?: run { val toast = - Toast.makeText(context, "Please set your base location path", Toast.LENGTH_LONG) + Toast.makeText(context, context.getString(R.string.msg_set_base_location), Toast.LENGTH_LONG) toast.show() } } @@ -75,7 +76,7 @@ fun AddEditEntryModalBottomSheetContent( if (!viewModel.currentIsNewEntry) Icon( Icons.Default.Delete, - contentDescription = "delete", + contentDescription = stringResource(R.string.delete), modifier = Modifier .align(Alignment.TopStart) .padding(16.dp) @@ -87,7 +88,7 @@ fun AddEditEntryModalBottomSheetContent( }) Icon( Icons.Default.Done, - contentDescription = "done", + contentDescription = stringResource(R.string.done), modifier = Modifier .align(Alignment.TopEnd) .padding(16.dp) @@ -101,7 +102,7 @@ fun AddEditEntryModalBottomSheetContent( ) { Icon( painter = painterResource(id = R.drawable.ic_baseline_drag_handle_24), - contentDescription = "drag" + contentDescription = stringResource(R.string.drag) ) Spacer(modifier = Modifier.size(18.dp)) diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImageCard.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImageCard.kt index 01a3a36..073a24b 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImageCard.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImageCard.kt @@ -13,6 +13,7 @@ import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp @@ -30,7 +31,6 @@ fun ImageCard( description: String, expandOnClick: Boolean = false ) { - val contentDescription = "Diary entry: $description" var expanded by remember { mutableStateOf(false) } Card( @@ -55,46 +55,47 @@ fun ImageCard( AsyncImage( modifier = Modifier.fillMaxWidth(), model = viewModel.fileManager?.resolveUri(entry.relativePath), - contentDescription = contentDescription, + contentDescription = stringResource(R.string.desc_img_card, description), error = painterResource(R.drawable.ic_baseline_error_24), contentScale = if (!expanded) ContentScale.Crop else ContentScale.FillWidth, ) -// } - Box( - modifier = Modifier - .fillMaxSize() - .background( - brush = Brush.verticalGradient( - colors = listOf( - Color.Transparent, - Color.Black - ), - startY = 300f + if (!expanded) { + Box( + modifier = Modifier + .fillMaxSize() + .background( + brush = Brush.verticalGradient( + colors = listOf( + Color.Transparent, + Color.Black + ), + startY = 300f + ) ) - ) - ) - - Box( - modifier = Modifier - .fillMaxSize() - .padding(12.dp), - contentAlignment = Alignment.BottomStart - ) { - Text( - description, - style = TextStyle(color = Color.White, fontSize = 16.sp), - fontWeight = FontWeight.Bold ) - } - Box( - modifier = Modifier - .fillMaxSize() - .padding(12.dp), - contentAlignment = Alignment.BottomEnd - ) { - Text(entry.happiness.emoticon(), style = TextStyle(fontSize = 16.sp)) + Box( + modifier = Modifier + .fillMaxSize() + .padding(12.dp), + contentAlignment = Alignment.BottomStart + ) { + Text( + description, + style = TextStyle(color = Color.White, fontSize = 16.sp), + fontWeight = FontWeight.Bold + ) + } + + Box( + modifier = Modifier + .fillMaxSize() + .padding(12.dp), + contentAlignment = Alignment.BottomEnd + ) { + Text(entry.happiness.emoticon(), style = TextStyle(fontSize = 16.sp)) + } } } } diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImportImage.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImportImage.kt index 017c50e..72efef2 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImportImage.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/ImportImage.kt @@ -4,6 +4,8 @@ import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import de.ptrlx.oneshot.R import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryEvent import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryViewModel @@ -22,7 +24,7 @@ fun ImportImageButton( RoundedButton( modifier = modifier, - text = "Import image", + text = stringResource(R.string.btn_import_img), onClick = { launcher.launch("image/*") } diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/SetLocation.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/SetLocation.kt index 279f887..58b6ace 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/SetLocation.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/common/SetLocation.kt @@ -7,6 +7,8 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource +import de.ptrlx.oneshot.R import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryEvent import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryViewModel @@ -26,7 +28,7 @@ fun SetLocation( val toast = Toast.makeText( context, - "Please move old images manually to the new folder", + context.getString(R.string.msg_move_old_imgs), Toast.LENGTH_LONG ) toast.show() @@ -37,7 +39,7 @@ fun SetLocation( RoundedButton( modifier = modifier, - text = "Set image file path", + text = stringResource(R.string.btn_set_base_location), onClick = { launcher.launch(viewModel.fileManager?.baseLocation) }, arrow = arrow ) diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeScreen.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeScreen.kt index dc115b5..4897a4f 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeScreen.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeScreen.kt @@ -10,9 +10,11 @@ import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import de.ptrlx.oneshot.R import de.ptrlx.oneshot.feature_diary.domain.model.DiaryEntry import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryEvent import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryViewModel @@ -78,7 +80,11 @@ fun Flashbacks( viewModel: DiaryViewModel ) { val flashbackTitles = - listOf("Yesterday", "Last very happy day", "7 days ago", "14 days ago") + listOf( + stringResource(R.string.yesterday), + stringResource(R.string.last_very_happy_day), + stringResource(R.string.days_ago_7), + stringResource(R.string.days_ago_14)) val stripedFlashbacks = (if (viewModel.flashbacks.size >= 4) (flashbackTitles.mapIndexed { i, title -> Pair( @@ -90,6 +96,7 @@ fun Flashbacks( "Day ${entry?.dayOfYear} of ${entry?.date?.year}", entry, ) + //todo extract string }).filter { it.second != null } else emptyList()) as List> // This cast is not unchecked as .filter will remove null values @@ -98,7 +105,7 @@ fun Flashbacks( Column(modifier = modifier) { Text( modifier = Modifier.padding(start = 8.dp, end = 8.dp), - text = "Flashbacks", + text = stringResource(R.string.flashbacks), style = MaterialTheme.typography.h4, fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeTop.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeTop.kt index 959e514..c50a5c6 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeTop.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/home/HomeTop.kt @@ -10,9 +10,11 @@ import androidx.compose.material.icons.filled.Settings import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import de.ptrlx.oneshot.R /** * Composable for top of home screen. @@ -36,13 +38,13 @@ fun HomeTop( ) { Text( - text = "OneShot", + text = stringResource(R.string.app_name), style = MaterialTheme.typography.h3, fontWeight = FontWeight.Bold ) Icon( - Icons.Default.Settings, contentDescription = "Settings", + Icons.Default.Settings, contentDescription = stringResource(R.string.settings) , modifier = Modifier .size(30.dp) .clickable { @@ -55,7 +57,7 @@ fun HomeTop( } Text( - text = "Remember the happy days!", + text = stringResource(R.string.app_slogan), style = MaterialTheme.typography.body1 ) } diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/Settings.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/Settings.kt index a07c550..03d940f 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/Settings.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/Settings.kt @@ -13,11 +13,13 @@ import androidx.compose.material.* import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.* import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.NavController +import de.ptrlx.oneshot.R import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryEvent import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryViewModel import de.ptrlx.oneshot.feature_diary.presentation.diary.components.common.RoundedButton @@ -75,7 +77,9 @@ fun SettingsButtons( ImportDatabaseButton(viewModel = viewModel) Spacer(modifier = Modifier.size(8.dp)) RoundedButton( - text = "Export database", + text = stringResource( + R.string.export_db + ), onClick = { viewModel.onEvent(DiaryEvent.WriteDBExport) }, arrow = false ) @@ -92,45 +96,42 @@ fun AboutText(modifier: Modifier = Modifier) { Column(modifier = modifier) { Text( - text = "Thank you for using OneShot!", + text = stringResource(R.string.thank_you_text), style = MaterialTheme.typography.h4 ) Spacer(modifier = Modifier.size(8.dp)) Text( - text = "About", + text = stringResource(R.string.about), style = MaterialTheme.typography.h5, fontWeight = FontWeight.Bold ) Text( - text = "OneShot is made to remind you of the special moments. Because every day has at least one. And that's what counts in life! So make it your habit and remember the happy days!", + text = stringResource(R.string.about_text), style = bodyStyle ) Spacer(modifier = Modifier.size(8.dp)) Text( - text = "Privacy", + text = stringResource(R.string.privacy), style = MaterialTheme.typography.h5, fontWeight = FontWeight.Bold ) Text( - text = "Your data is yours! OneShot will not send data to any server without your consent. The app requires currently no internet permission.", + text = stringResource(R.string.privacy_text), style = bodyStyle ) Spacer(modifier = Modifier.size(8.dp)) Text( - text = "License", + text = stringResource(R.string.license), style = MaterialTheme.typography.h5, fontWeight = FontWeight.Bold ) - val gitUrl = "https://github.com/ptrLx/OneShot" + val gitUrl = stringResource(R.string.git_url) val annotatedLicenseText = buildAnnotatedString { - append( - "This app is made with passion and love by ptrLx️. It is free software released under GPLv3 and comes with absolutely no warranty. " - ) - append("Fork me on ") - + append(stringResource(R.string.license_text)) + append(" Fork me on ") withStyle( style = SpanStyle( color = MaterialTheme.colors.primary, @@ -160,14 +161,12 @@ fun AboutText(modifier: Modifier = Modifier) { Spacer(modifier = Modifier.size(8.dp)) Text( - text = "Open Source Licenses", + text = stringResource(R.string.open_source), style = MaterialTheme.typography.h5, fontWeight = FontWeight.Bold ) Text( - text = "Coil - Apache License Version 2.0\n" + - "Dagger - Apache License Version 2.0\n" + - "Accompanist - Apache License Version 2.0", + text = stringResource(R.string.open_source_text), style = bodyStyle ) } @@ -202,7 +201,7 @@ fun ImportDatabaseButton( RoundedButton( modifier = modifier, - text = "Import database", + text = stringResource(R.string.btn_import_db), onClick = { launcher.launch(arrayOf("application/json")) }, arrow = false ) @@ -216,12 +215,12 @@ fun ImportDatabaseButton( }, title = { Text( - "Import database?", + stringResource(R.string.qst_import_db), style = MaterialTheme.typography.h5, color = MaterialTheme.colors.error ) }, - text = { Text("This may overwrite entries in your current diary") }, + text = { Text(stringResource(R.string.warn_import_db)) }, confirmButton = { Button( colors = ButtonDefaults.buttonColors(backgroundColor = MaterialTheme.colors.error), @@ -229,7 +228,7 @@ fun ImportDatabaseButton( showDialog = false viewModel.onEvent(DiaryEvent.ReadDBImport) }) { - Text("OK", color = MaterialTheme.colors.onError) + Text(text = stringResource(R.string.btn_ok), color = MaterialTheme.colors.onError) } }, dismissButton = { @@ -238,7 +237,7 @@ fun ImportDatabaseButton( onClick = { showDialog = false }) { - Text(text = "ABORT", color = MaterialTheme.colors.onBackground) + Text(text = stringResource(R.string.btn_abort), color = MaterialTheme.colors.onBackground) } } ) diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/SettingsTop.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/SettingsTop.kt index 04688d7..d6ba3b8 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/SettingsTop.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/settings/SettingsTop.kt @@ -10,10 +10,12 @@ import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination +import de.ptrlx.oneshot.R /** * Composable for top of settings screen. @@ -26,30 +28,35 @@ fun SettingsTop( modifier: Modifier = Modifier, controller: NavController ) { - Row( - modifier = modifier.fillMaxWidth().padding(top = 8.dp, bottom = 8.dp), - horizontalArrangement = Arrangement.Start, - verticalAlignment = Alignment.CenterVertically - ) { + Row( + modifier = modifier + .fillMaxWidth() + .padding(top = 8.dp, bottom = 8.dp), + horizontalArrangement = Arrangement.Start, + verticalAlignment = Alignment.CenterVertically + ) { - Icon( - Icons.Default.ArrowBack, contentDescription = "back", - modifier = Modifier - .size(50.dp).padding(end = 8.dp) - .clickable { - controller.navigate("home") { - popUpTo(controller.graph.findStartDestination().id) - launchSingleTop = true - } - }, - tint = MaterialTheme.colors.onBackground - ) - Text( - text = "Settings", - style = MaterialTheme.typography.h3, - fontWeight = FontWeight.Bold - ) + Icon( + Icons.Default.ArrowBack, contentDescription = stringResource( + R.string.back + ), + modifier = Modifier + .size(50.dp) + .padding(end = 8.dp) + .clickable { + controller.navigate("home") { + popUpTo(controller.graph.findStartDestination().id) + launchSingleTop = true + } + }, + tint = MaterialTheme.colors.onBackground + ) + Text( + text = stringResource(R.string.settings), + style = MaterialTheme.typography.h3, + fontWeight = FontWeight.Bold + ) - } + } } \ No newline at end of file diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/stats/StatsScreen.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/stats/StatsScreen.kt index a8cbbcd..fdeb83f 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/stats/StatsScreen.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/components/stats/StatsScreen.kt @@ -15,9 +15,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import de.ptrlx.oneshot.R import de.ptrlx.oneshot.feature_diary.domain.util.HappinessType import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryEvent import de.ptrlx.oneshot.feature_diary.presentation.diary.DiaryViewModel @@ -70,6 +72,7 @@ fun StreakCount( ",\nHappiness-Streak of $happinessStreakCount days" else "" }\uD83C\uDF89", + //todo extract string style = MaterialTheme.typography.h5, color = MaterialTheme.colors.primary, fontWeight = FontWeight.Bold @@ -88,7 +91,9 @@ fun StreakCalendar( ) { Text( modifier = Modifier.padding(8.dp), - text = "Last 28 days", + text = stringResource( + R.string.last_28_days + ), style = MaterialTheme.typography.h4, fontWeight = FontWeight.Bold ) @@ -162,7 +167,9 @@ fun HappinessCalendarEntry( color = onColor ) Text( - fontSize = 30.sp, color = onColor, text = (entry?.happiness ?: run { HappinessType.NOT_SPECIFIED }).emoticon() + fontSize = 30.sp, + color = onColor, + text = (entry?.happiness ?: run { HappinessType.NOT_SPECIFIED }).emoticon() ) } } diff --git a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/util/SnackbarCause.kt b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/util/SnackbarCause.kt index 91fe9ff..fd72bf8 100644 --- a/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/util/SnackbarCause.kt +++ b/app/src/main/java/de/ptrlx/oneshot/feature_diary/presentation/diary/util/SnackbarCause.kt @@ -1,23 +1,25 @@ package de.ptrlx.oneshot.feature_diary.presentation.diary.util +import de.ptrlx.oneshot.R + enum class SnackbarCause { DELETE_ENTRY, SUCCESS, ERROR; - fun msg(): String { + fun msg(): Int { return when (this) { - DELETE_ENTRY -> "Entry deleted!" - SUCCESS -> "Success!" - ERROR -> "Error!" + DELETE_ENTRY -> R.string.snackbar_msg_entry_deleted + SUCCESS -> R.string.snackbar_msg_success + ERROR -> R.string.snackbar_msg_error } } - fun actionLabel(): String { + fun actionLabel(): Int { return when (this) { - DELETE_ENTRY -> "UNDO" - SUCCESS -> "DISMISS" - ERROR -> "DISMISS" + DELETE_ENTRY -> R.string.snackbar_action_undo + SUCCESS -> R.string.snackbar_action_dismiss + ERROR -> R.string.snackbar_action_dismiss } } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml new file mode 100644 index 0000000..b4ae61c --- /dev/null +++ b/app/src/main/res/values-de/strings.xml @@ -0,0 +1,43 @@ + + + + Bitte Basisordner festlegen + Kamara öffnen + löschen + fertig + ziehen + Eintrag: %1$s + Bild importieren + Alte Bilder müssen manuell in den neuen Ordner kopiert werden + Basisordner festlegen + Start + Tagebuch + Statistiken + Flashbacks + Vor 14 Tagen + Vor 7 Tagen + Letzter überglücklicher Tag + Gestern + ABBRECHEN + OK + Dies kann Einträge im aktuellen Tagebuch überschreiben + Datenbank importieren? + Datenbank importieren + Open Source Lizenzen + Eintrag gelöscht! + Erfolg! + Fehler! + RÜCKGÄNGIG + VERSTANDEN + Letzten 28 Tage + zurück + Einstellungen + Datenbank exportieren + Danke, dass du OneShot benutzt! + Über + Privatsphäre + Lizenz + Diese App wurde mit Leidenschaft und Liebe von ptrLx erstellt. Sie ist Freie Software unter der GPLv3-Lizenz und bietet keinerlei Garantie. + Deine Daten sind deine! OneShot wird ohne deine Einwilligung niemals Daten zu irgendwelchen Server senden. Aktuell benötigt die App keine Internetberechtigung. + OneShot wurde erstellt, um dich an die schönen Momente im Leben zu erinnern. Denn jeder Tag hat mindestens einen. Und das ist, was im Leben zählt! Also mach es zu deiner Gewohnheit und behalte die glücklichen Tage in Erinnerung! + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ae9dfc1..11a152d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,45 @@ - OneShot + OneShot + Please set your base location path + Capture today + delete + done + drag + Diary entry: %1$s + Import image + Please move old images manually to the new folder + Set image file path + Home + Diary + Statistics + Entry deleted! + Success! + Error! + UNDO + DISMISS + Last 28 days + back + Settings + Export database + Thank you for using OneShot! + About + OneShot is made to remind you of the special moments. Because every day has at least one. And that\'s what counts in life! So make it your habit and remember the happy days! + Privacy + Your data is yours! OneShot will not send data to any server without your consent. The app requires currently no internet permission. + License + "This app is made with passion and love by ptrLx. It is free software released under GPLv3 and comes with absolutely no warranty." + https://github.com/ptrLx/OneShot + Open Source Licenses + Coil - Apache License Version 2.0\nDagger - Apache License Version 2.0\nAccompanist - Apache License Version 2.0 + Import database + Import database? + This may overwrite entries in your current diary + OK + ABORT + Remember the happy days! + Yesterday + Last very happy day + 7 days ago + 14 days ago + Flashbacks \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/111.txt b/fastlane/metadata/android/en-US/changelogs/111.txt new file mode 100644 index 0000000..b5df3ac --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/111.txt @@ -0,0 +1 @@ +Added german translation and removed gradient in large image view. \ No newline at end of file