From f33b7827939a8b161a3e22f68363b844f7cecfb6 Mon Sep 17 00:00:00 2001 From: Jumpeee Date: Thu, 28 Sep 2023 22:29:06 +0200 Subject: [PATCH] Displaying status of insurances (app version 1.0) --- app/build.gradle.kts | 2 - app/src/main/AndroidManifest.xml | 11 -- .../java/io/fixmyride/database/DatabaseDao.kt | 3 - .../io/fixmyride/enums/ExpirationStatus.kt | 7 + .../main/java/io/fixmyride/models/Vehicle.kt | 8 -- .../ui/components/managevehicle/FormField.kt | 8 +- .../notifications/NotificationItem.kt | 136 ++++++++++++++++-- .../ui/components/settings/Option.kt | 10 +- .../ui/components/settings/OptionButton.kt | 102 ------------- .../fixmyride/ui/screens/AddVehicleScreen.kt | 3 +- .../fixmyride/ui/screens/EditVehicleScreen.kt | 1 + .../io/fixmyride/ui/screens/SettingsScreen.kt | 27 ---- .../io/fixmyride/ui/theme/ColorPalette.kt | 3 +- .../main/java/io/fixmyride/ui/theme/Typing.kt | 19 +-- .../io/fixmyride/ui/widgets/Expirations.kt | 37 ----- .../java/io/fixmyride/utils/DataExchange.kt | 14 -- app/src/main/res/values-pl/strings.xml | 10 +- app/src/main/res/values/strings.xml | 10 +- app/src/main/res/xml/expirations_widget.xml | 9 -- build.gradle.kts | 2 +- 20 files changed, 165 insertions(+), 257 deletions(-) create mode 100644 app/src/main/java/io/fixmyride/enums/ExpirationStatus.kt delete mode 100644 app/src/main/java/io/fixmyride/ui/components/settings/OptionButton.kt delete mode 100644 app/src/main/java/io/fixmyride/ui/widgets/Expirations.kt delete mode 100644 app/src/main/java/io/fixmyride/utils/DataExchange.kt delete mode 100644 app/src/main/res/xml/expirations_widget.xml diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a586676..c26a8e9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -66,8 +66,6 @@ dependencies { implementation("androidx.compose.material3:material3") implementation("androidx.navigation:navigation-compose:2.7.3") implementation("com.google.code.gson:gson:2.10.1") - implementation("androidx.glance:glance-appwidget:1.0.0") - implementation("androidx.glance:glance-material3:1.0.0") testImplementation("junit:junit:4.13.2") androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00")) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5e85d2b..c720e54 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,16 +23,5 @@ - - - - - - - diff --git a/app/src/main/java/io/fixmyride/database/DatabaseDao.kt b/app/src/main/java/io/fixmyride/database/DatabaseDao.kt index 95c2ef8..1ae6541 100644 --- a/app/src/main/java/io/fixmyride/database/DatabaseDao.kt +++ b/app/src/main/java/io/fixmyride/database/DatabaseDao.kt @@ -9,9 +9,6 @@ import io.fixmyride.models.Vehicle @Dao interface DatabaseDao { - @Query("SELECT * FROM vehicle") - suspend fun getData(): List - @Insert(onConflict = OnConflictStrategy.IGNORE) suspend fun addVehicle(vehicle: Vehicle) diff --git a/app/src/main/java/io/fixmyride/enums/ExpirationStatus.kt b/app/src/main/java/io/fixmyride/enums/ExpirationStatus.kt new file mode 100644 index 0000000..b8db89c --- /dev/null +++ b/app/src/main/java/io/fixmyride/enums/ExpirationStatus.kt @@ -0,0 +1,7 @@ +package io.fixmyride.enums + +enum class ExpirationStatus { + ACTIVE, + EXPIRED, + WARNING; +} \ No newline at end of file diff --git a/app/src/main/java/io/fixmyride/models/Vehicle.kt b/app/src/main/java/io/fixmyride/models/Vehicle.kt index 7fbc5bc..b97a7d1 100644 --- a/app/src/main/java/io/fixmyride/models/Vehicle.kt +++ b/app/src/main/java/io/fixmyride/models/Vehicle.kt @@ -26,14 +26,6 @@ data class Vehicle( @TypeConverters(DateConverter::class) val nextInspectionDate: LocalDate, ) { - fun toMap() = mapOf( - "id" to id, - "model" to model, - "registration" to registration, - "tplInsuranceExpiry" to tplInsuranceExpiry, - "collisionInsuranceExpiry" to collisionInsuranceExpiry, - "nextInspectionDate" to nextInspectionDate, - ) companion object { @RequiresApi(Build.VERSION_CODES.O) val EMPTY = Vehicle( diff --git a/app/src/main/java/io/fixmyride/ui/components/managevehicle/FormField.kt b/app/src/main/java/io/fixmyride/ui/components/managevehicle/FormField.kt index f81c2fd..677f019 100644 --- a/app/src/main/java/io/fixmyride/ui/components/managevehicle/FormField.kt +++ b/app/src/main/java/io/fixmyride/ui/components/managevehicle/FormField.kt @@ -44,6 +44,7 @@ fun FormField( initialValue: String? = null, caption: String, placeholder: String, + upperCase: Boolean = false, onInput: (String) -> Unit, ) { val fieldValue = remember { mutableStateOf("") } @@ -68,8 +69,11 @@ fun FormField( TextField( value = fieldValue.value, onValueChange = { - fieldValue.value = it - onInput(it) + fieldValue.value = when (upperCase) { + true -> it.uppercase() + false -> it + } + onInput(fieldValue.value) }, textStyle = Typing.textFieldText, maxLines = 1, diff --git a/app/src/main/java/io/fixmyride/ui/components/notifications/NotificationItem.kt b/app/src/main/java/io/fixmyride/ui/components/notifications/NotificationItem.kt index c710cb3..cf31c1b 100644 --- a/app/src/main/java/io/fixmyride/ui/components/notifications/NotificationItem.kt +++ b/app/src/main/java/io/fixmyride/ui/components/notifications/NotificationItem.kt @@ -2,6 +2,7 @@ package io.fixmyride.ui.components.notifications import android.os.Build import androidx.annotation.RequiresApi +import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -25,10 +26,13 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import io.fixmyride.R import io.fixmyride.database.DatabaseManager +import io.fixmyride.enums.ExpirationStatus +import io.fixmyride.enums.NotificationType import io.fixmyride.models.Notification import io.fixmyride.models.Vehicle import io.fixmyride.ui.components.ExpandButton @@ -78,7 +82,7 @@ fun NotificationItem(notification: Notification) { vehicle.value.model.length > 12 -> { vehicle.value.model .substring(0, 11) - .trim() + "..." + .trim().plus("...") } else -> vehicle.value.model @@ -99,8 +103,90 @@ fun NotificationItem(notification: Notification) { expired = notification.expirations.filter { it < 0 }.size, warnings = notification.expirations.filter { it > 0 }.size, expanded = isExpanded.value, - ) { - isExpanded.value = !isExpanded.value + ) { isExpanded.value = !isExpanded.value } + } + + AnimatedVisibility(isExpanded.value) { + Column { + Spacer(Modifier.height(10.dp)) + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier.fillMaxWidth(), + ) { + @Composable + fun TextWithBackground(text: String) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier.background( + color = ColorPalette.tertiary, + shape = RoundedCornerShape(50.dp), + ) + ) { + Text( + text, + style = Typing.buttonText.copy( + color = ColorPalette.secondary, + fontWeight = FontWeight.Bold, + ), + modifier = Modifier.padding( + horizontal = 7.dp, + vertical = 3.dp, + ), + ) + } + } + + val tplStatus = when { + notification.expirations.contains(NotificationType.TPL_EXPIRED) -> ExpirationStatus.EXPIRED + notification.expirations.contains(NotificationType.TPL_ABOUT_TO_EXPIRE) -> ExpirationStatus.WARNING + else -> ExpirationStatus.ACTIVE + } + Column(horizontalAlignment = Alignment.CenterHorizontally) { + TextWithBackground(stringResource(R.string.tpl_insurance)) + Spacer(Modifier.height(5.dp)) + StatusLabel(tplStatus) + + } + Spacer( + modifier = Modifier + .width(5.dp) + .background( + ColorPalette.tertiary, + shape = RoundedCornerShape(100), + ), + ) + + val ciStatus = when { + notification.expirations.contains(NotificationType.CI_EXPIRED) -> ExpirationStatus.EXPIRED + notification.expirations.contains(NotificationType.CI_ABOUT_TO_EXPIRE) -> ExpirationStatus.WARNING + else -> ExpirationStatus.ACTIVE + } + Column(horizontalAlignment = Alignment.CenterHorizontally) { + TextWithBackground(stringResource(R.string.ci)) + Spacer(Modifier.height(5.dp)) + StatusLabel(ciStatus) + } + Spacer( + modifier = Modifier + .width(5.dp) + .background( + ColorPalette.tertiary, + shape = RoundedCornerShape(100), + ), + ) + + val inspectionStatus = when { + notification.expirations.contains(NotificationType.INSPECTION_EXPIRED) -> ExpirationStatus.EXPIRED + notification.expirations.contains(NotificationType.INSPECTION_UPCOMING) -> ExpirationStatus.WARNING + else -> ExpirationStatus.ACTIVE + } + Column(horizontalAlignment = Alignment.CenterHorizontally) { + TextWithBackground(stringResource(R.string.inspection)) + Spacer(Modifier.height(5.dp)) + StatusLabel(inspectionStatus) + } + } } } } @@ -124,11 +210,11 @@ fun WarningsAndExpand( Box( contentAlignment = Alignment.Center, modifier = Modifier + .clip(RoundedCornerShape(5.dp)) .background( color = ColorPalette.lightRed.copy(alpha = 0.1f), shape = RoundedCornerShape(5.dp), - ) - .clip(RoundedCornerShape(5.dp)) + ), ) { Text( text = "$expired ${if (hasOnlyExpirationsOrWarnings) stringResource(R.string.expirations) else ""}".trim(), @@ -144,16 +230,15 @@ fun WarningsAndExpand( if (!hasOnlyExpirationsOrWarnings) Spacer(Modifier.width(5.dp)) - if (warnings != 0) { Box( contentAlignment = Alignment.Center, modifier = Modifier + .clip(RoundedCornerShape(5.dp)) .background( color = ColorPalette.yellow.copy(alpha = 0.1f), shape = RoundedCornerShape(5.dp), - ) - .clip(RoundedCornerShape(5.dp)) + ), ) { Text( text = "$warnings ${if (hasOnlyExpirationsOrWarnings) stringResource(R.string.warnings) else ""}".trim(), @@ -170,4 +255,39 @@ fun WarningsAndExpand( ExpandButton(expanded) { onClickExpand() } } +} + +@Composable +fun StatusLabel(status: ExpirationStatus) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .background( + color = when (status) { + ExpirationStatus.EXPIRED -> ColorPalette.lightRed.copy(alpha = 0.1f) + ExpirationStatus.WARNING -> ColorPalette.yellow.copy(alpha = 0.1f) + ExpirationStatus.ACTIVE -> ColorPalette.green.copy(alpha = 0.1f) + }, + shape = RoundedCornerShape(5.dp), + ) + .clip(RoundedCornerShape(5.dp)) + ) { + Text( + text = when (status) { + ExpirationStatus.EXPIRED -> stringResource(R.string.expired) + ExpirationStatus.WARNING -> stringResource(R.string.warning) + ExpirationStatus.ACTIVE -> stringResource(R.string.active) + }, + style = when (status) { + ExpirationStatus.EXPIRED -> Typing.expiredText + ExpirationStatus.WARNING -> Typing.warningText + ExpirationStatus.ACTIVE -> Typing.activeText + }, + modifier = Modifier + .padding( + horizontal = 5.dp, + vertical = 2.dp, + ), + ) + } } \ No newline at end of file diff --git a/app/src/main/java/io/fixmyride/ui/components/settings/Option.kt b/app/src/main/java/io/fixmyride/ui/components/settings/Option.kt index df694c2..90e2a59 100644 --- a/app/src/main/java/io/fixmyride/ui/components/settings/Option.kt +++ b/app/src/main/java/io/fixmyride/ui/components/settings/Option.kt @@ -2,10 +2,6 @@ package io.fixmyride.ui.components.settings import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.animateContentSize -import androidx.compose.animation.expandVertically -import androidx.compose.animation.fadeIn -import androidx.compose.animation.fadeOut -import androidx.compose.animation.shrinkVertically import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -55,11 +51,7 @@ fun Option( isExpanded.value = !isExpanded.value } } - AnimatedVisibility( - visible = isExpanded.value, - enter = fadeIn() + expandVertically(), - exit = fadeOut() + shrinkVertically(), - ) { + AnimatedVisibility(visible = isExpanded.value) { content() } } diff --git a/app/src/main/java/io/fixmyride/ui/components/settings/OptionButton.kt b/app/src/main/java/io/fixmyride/ui/components/settings/OptionButton.kt deleted file mode 100644 index dfe59f6..0000000 --- a/app/src/main/java/io/fixmyride/ui/components/settings/OptionButton.kt +++ /dev/null @@ -1,102 +0,0 @@ -package io.fixmyride.ui.components.settings - -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.Row -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.width -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.unit.dp -import io.fixmyride.ui.components.ExpandButton -import io.fixmyride.ui.theme.ColorPalette -import io.fixmyride.ui.theme.Typing - -@Composable -fun OptionButton( - icon: ImageVector, - name: String, - buttonText: String, - description: String, - iconRotate: Float = 0f, - onButtonClick: () -> Unit, -) { - Column { - Spacer(Modifier.height(30.dp)) - - val isExpanded = remember { mutableStateOf(false) } - Box { - Box( - contentAlignment = Alignment.TopStart, - modifier = Modifier.fillMaxSize(), - ) { - IconAndOptionName( - icon, - name, - description, - iconRotate, - isExpanded.value, - ) - } - - Box( - contentAlignment = Alignment.TopEnd, - modifier = Modifier.fillMaxSize(), - ) { - ButtonAndExpand( - buttonText, - isExpanded.value, - onButtonClick, - ) { isExpanded.value = !isExpanded.value } - } - } - } -} - -@Composable -private fun ButtonAndExpand( - buttonText: String, - isExpanded: Boolean, - onButtonClick: () -> Unit, - onClickExpand: () -> Unit, -) { - val borderRadius = RoundedCornerShape(5.dp) - Row { - Box( - contentAlignment = Alignment.Center, - modifier = Modifier - .background( - color = ColorPalette.blue.copy(alpha = 0.1f), - shape = borderRadius, - ) - .clip(borderRadius) - .clickable { onButtonClick() } - ) { - Text( - text = buttonText, - style = Typing.optionButton, - modifier = Modifier - .padding( - horizontal = 5.dp, - vertical = 2.dp, - ), - ) - } - Spacer(Modifier.width(10.dp)) - - ExpandButton(isExpanded) { onClickExpand() } - } -} - diff --git a/app/src/main/java/io/fixmyride/ui/screens/AddVehicleScreen.kt b/app/src/main/java/io/fixmyride/ui/screens/AddVehicleScreen.kt index 2754c46..0238b09 100644 --- a/app/src/main/java/io/fixmyride/ui/screens/AddVehicleScreen.kt +++ b/app/src/main/java/io/fixmyride/ui/screens/AddVehicleScreen.kt @@ -23,8 +23,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavController import io.fixmyride.R -import io.fixmyride.database.DateConverter import io.fixmyride.database.DatabaseManager +import io.fixmyride.database.DateConverter import io.fixmyride.models.Vehicle import io.fixmyride.ui.components.FloatingButton import io.fixmyride.ui.components.UniversalHeader @@ -72,6 +72,7 @@ fun AddVehicleScreen(navCtrl: NavController) { FormField( isError = 1 in emptyFields.value, initialValue = registration.value, + upperCase = true, caption = stringResource(R.string.addvehicle_registration_number_headline), placeholder = stringResource(R.string.addvehicle_registration_number_placeholder), ) { registration.value = it } diff --git a/app/src/main/java/io/fixmyride/ui/screens/EditVehicleScreen.kt b/app/src/main/java/io/fixmyride/ui/screens/EditVehicleScreen.kt index eb8cab9..a358e4f 100644 --- a/app/src/main/java/io/fixmyride/ui/screens/EditVehicleScreen.kt +++ b/app/src/main/java/io/fixmyride/ui/screens/EditVehicleScreen.kt @@ -94,6 +94,7 @@ fun EditVehicleScreen( FormField( isError = 1 in emptyFields.value, initialValue = registration.value, + upperCase = true, caption = stringResource(R.string.addvehicle_registration_number_headline), placeholder = stringResource(R.string.addvehicle_registration_number_placeholder), ) { registration.value = it } diff --git a/app/src/main/java/io/fixmyride/ui/screens/SettingsScreen.kt b/app/src/main/java/io/fixmyride/ui/screens/SettingsScreen.kt index e6906e8..3246dee 100644 --- a/app/src/main/java/io/fixmyride/ui/screens/SettingsScreen.kt +++ b/app/src/main/java/io/fixmyride/ui/screens/SettingsScreen.kt @@ -13,8 +13,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.rounded.ArrowBack -import androidx.compose.material.icons.rounded.ArrowForward import androidx.compose.material.icons.rounded.Email import androidx.compose.material3.Surface import androidx.compose.runtime.Composable @@ -22,7 +20,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource @@ -34,12 +31,9 @@ import io.fixmyride.ui.components.UniversalHeader import io.fixmyride.ui.components.dialogs.SingleValueDialog import io.fixmyride.ui.components.notifications.AuthorInfo import io.fixmyride.ui.components.settings.Option -import io.fixmyride.ui.components.settings.OptionButton import io.fixmyride.ui.components.settings.ValueBox import io.fixmyride.ui.theme.ColorPalette import io.fixmyride.ui.theme.Measurements -import io.fixmyride.utils.DataExchange -import kotlinx.coroutines.launch @RequiresApi(Build.VERSION_CODES.R) @@ -74,7 +68,6 @@ fun SettingsScreen(navCtrl: NavController) { @RequiresApi(Build.VERSION_CODES.R) @Composable private fun AllOptions() { - val coroutineScope = rememberCoroutineScope() val prefs = PrefsManager.getInstance() Option( icon = Icons.Rounded.Email, @@ -152,24 +145,4 @@ private fun AllOptions() { } } } - - OptionButton( - icon = Icons.Rounded.ArrowForward, - name = stringResource(R.string.import_data), - buttonText = stringResource(R.string.import_button), - description = stringResource(R.string.import_data_from_an_existing_file), - iconRotate = 90f, - ) { /* TODO importing data */ } - - OptionButton( - icon = Icons.Rounded.ArrowBack, - name = stringResource(R.string.export_data), - buttonText = stringResource(R.string.export_button), - description = stringResource(R.string.export_data_to_a_file), - iconRotate = 90f, - ) { - coroutineScope.launch { - DataExchange.exportData() - } - } } diff --git a/app/src/main/java/io/fixmyride/ui/theme/ColorPalette.kt b/app/src/main/java/io/fixmyride/ui/theme/ColorPalette.kt index a88a7c9..ad256ea 100644 --- a/app/src/main/java/io/fixmyride/ui/theme/ColorPalette.kt +++ b/app/src/main/java/io/fixmyride/ui/theme/ColorPalette.kt @@ -9,9 +9,8 @@ object ColorPalette { val background = Color(0xFF141414) // Additional colors - val lightRed = Color(0xFFFF7B60) val green = Color(0xFF01DB4B) - val blue = Color(0xFF03A9F4) val yellow = Color(0xFFFFC107) + val lightRed = Color(0xFFFF7B60) } diff --git a/app/src/main/java/io/fixmyride/ui/theme/Typing.kt b/app/src/main/java/io/fixmyride/ui/theme/Typing.kt index 4cc17ea..55e5808 100644 --- a/app/src/main/java/io/fixmyride/ui/theme/Typing.kt +++ b/app/src/main/java/io/fixmyride/ui/theme/Typing.kt @@ -114,15 +114,6 @@ object Typing { lineHeight = 16.sp, ) - /** e.g. settings page for every single option button */ - val optionButton = TextStyle( - color = ColorPalette.blue, - fontFamily = customFont, - fontWeight = FontWeight.Normal, - fontSize = 12.sp, - lineHeight = 16.sp, - ) - /** e.g. notifications for every single vehicle warning text */ val warningText = TextStyle( color = ColorPalette.yellow, @@ -141,6 +132,15 @@ object Typing { lineHeight = 16.sp, ) + /** e.g. notifications for every single vehicle active text */ + val activeText = TextStyle( + color = ColorPalette.green, + fontFamily = customFont, + fontWeight = FontWeight.Normal, + fontSize = 12.sp, + lineHeight = 16.sp, + ) + /** Used only for text field texts */ val textFieldText = TextStyle( color = ColorPalette.secondary, @@ -186,6 +186,7 @@ object Typing { lineHeight = 22.sp, ) + /** Used for value boxes in settings */ val unselectedValueBoxText = TextStyle( color = ColorPalette.secondary, fontFamily = customFont, diff --git a/app/src/main/java/io/fixmyride/ui/widgets/Expirations.kt b/app/src/main/java/io/fixmyride/ui/widgets/Expirations.kt deleted file mode 100644 index 09f54c5..0000000 --- a/app/src/main/java/io/fixmyride/ui/widgets/Expirations.kt +++ /dev/null @@ -1,37 +0,0 @@ -package io.fixmyride.ui.widgets - -import android.content.Context -import androidx.glance.GlanceId -import androidx.glance.GlanceModifier -import androidx.glance.appwidget.GlanceAppWidget -import androidx.glance.appwidget.GlanceAppWidgetReceiver -import androidx.glance.appwidget.provideContent -import androidx.glance.background -import androidx.glance.layout.Column -import androidx.glance.layout.fillMaxSize -import androidx.glance.text.Text -import io.fixmyride.ui.theme.ColorPalette - -private object ExpirationsWidget : GlanceAppWidget() { - override suspend fun provideGlance(context: Context, id: GlanceId) { - - // In this method, load data needed to render the AppWidget. - // Use `withContext` to switch to another thread for long running - // operations. - provideContent { - Column( - modifier = GlanceModifier - .fillMaxSize() - .background(color = ColorPalette.background), - ) { - Text("Sup'") - } - } - } - -} - -object ExpirationsReceiver : GlanceAppWidgetReceiver() { - override val glanceAppWidget: GlanceAppWidget - get() = ExpirationsWidget -} diff --git a/app/src/main/java/io/fixmyride/utils/DataExchange.kt b/app/src/main/java/io/fixmyride/utils/DataExchange.kt deleted file mode 100644 index 6b107e0..0000000 --- a/app/src/main/java/io/fixmyride/utils/DataExchange.kt +++ /dev/null @@ -1,14 +0,0 @@ -package io.fixmyride.utils - -/** Provides functions for importing and exporting data to/from files */ -object DataExchange { - /** Used for importing data from previously exported file */ - suspend fun importData() { - // TODO - } - - /** Used for exporting data to a file */ - suspend fun exportData() { - - } -} \ No newline at end of file diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 180e4cc..1d4de3d 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -38,12 +38,6 @@ Nie Wybierz z galerii Nie masz żadnych powiadomień - Importuj dane - Importuj - Importuj dane z pliku. - Eksportuj dane - Eksportuj - Eksportuj dane do pliku. Edytuj pojazd Usunąć pojazd? Czy napewno chcesz usunąć pojazd? @@ -60,4 +54,8 @@ dni wygaśnięcia ostrzeżenia + wygasło + ostrzeżenie + aktywny + Przegląd \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1c9ea40..b56bfdc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,12 +38,6 @@ No Choose from gallery You have no notifications - Import data - Import - Import data from an existing file. - Export data - Export - Export data to a file. Edit vehicle Delete vehicle? Are you sure you want to delete the vehicle? @@ -60,4 +54,8 @@ days expirations warnings + expired + warning + active + Inspection \ No newline at end of file diff --git a/app/src/main/res/xml/expirations_widget.xml b/app/src/main/res/xml/expirations_widget.xml deleted file mode 100644 index ba5e76c..0000000 --- a/app/src/main/res/xml/expirations_widget.xml +++ /dev/null @@ -1,9 +0,0 @@ - - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 976613c..7dff90b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ buildscript { } // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.1.1" apply false + id("com.android.application") version "8.1.2" apply false id("org.jetbrains.kotlin.android") version "1.8.10" apply false id("com.google.devtools.ksp") version "1.8.10-1.0.9" apply false }