Adjusted text to show the user when they have changed their allergen preferences; changed licences text

This commit is contained in:
denizk0461
2023-05-11 14:56:33 +02:00
parent 81765db0db
commit 6dccb287ab
11 changed files with 26 additions and 30 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ android {
resourceConfigurations += ["en", "de"] resourceConfigurations += ["en", "de"]
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L" buildConfigField "long", "BUILD_TIME_MILLIS", "${System.currentTimeMillis()}L"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -11,8 +11,8 @@
"type": "SINGLE", "type": "SINGLE",
"filters": [], "filters": [],
"attributes": [], "attributes": [],
"versionCode": 3, "versionCode": 4,
"versionName": "1.0.0", "versionName": "1.0.1",
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }
], ],
@@ -51,7 +51,7 @@ abstract class AppDatabase : RoomDatabase() {
AppDatabase::class.java, AppDatabase::class.java,
"event_db", "event_db",
).addMigrations(migrationAddNewsToOfferCanteen_19_20) ).addMigrations(migrationAddNewsToOfferCanteen_19_20)
.fallbackToDestructiveMigration() // .fallbackToDestructiveMigration()
.build() .build()
} }
} }
@@ -199,7 +199,10 @@ class SettingsFragment : AppFragment() {
openBottomSheet( openBottomSheet(
getTextSheet( getTextSheet(
getString(R.string.sheet_licences_header), getString(R.string.sheet_licences_header),
getString(R.string.sheet_licences_content), getString(
R.string.sheet_licences_content,
Calendar.getInstance().get(Calendar.YEAR).toString(),
),
) )
) )
} }
@@ -273,7 +276,7 @@ class SettingsFragment : AppFragment() {
"${BuildConfig.VERSION_NAME}-${ "${BuildConfig.VERSION_NAME}-${
if (BuildConfig.DEBUG) if (BuildConfig.DEBUG)
"dev-[${SimpleDateFormat("yyyy-MM-dd, HH:mm:ss.SSS", Locale.GERMANY) "dev-[${SimpleDateFormat("yyyy-MM-dd, HH:mm:ss.SSS", Locale.GERMANY)
.format(Date(BuildConfig.TIMESTAMP))}]" .format(Date(BuildConfig.BUILD_TIME_MILLIS))}]"
else else
"release" "release"
}" }"
@@ -293,13 +296,14 @@ class SettingsFragment : AppFragment() {
} }
/** /**
* Retrieves the text displayed in the allergen config setting to show the user how many * Retrieves the appropriate text to display in the allergen config setting to show the user how
* allergens they have checked. * many allergens they have checked. Text depends on how many allergens have been checked.
* *
* @return localised string with the count of checked allergens inserted * @return localised string with the count of checked allergens inserted
*/ */
private fun getAllergensConfigCountText(): String = getString( private fun getAllergensConfigCountText(): String = when (viewModel.preferenceAllergenConfigCount) {
R.string.allergens_config_subtitle, 0 -> getString(R.string.allergens_config_subtitle_zero)
viewModel.preferenceAllergenConfigCount 1 -> getString(R.string.allergens_config_subtitle_one)
) else -> getString(R.string.allergens_config_subtitle_more, viewModel.preferenceAllergenConfigCount)
}
} }
@@ -1,12 +0,0 @@
package com.denizk0461.weserplaner.model
/**
* Serves to retrieve information about a specified canteen from the database using a single query.
*
* @param openingHours opening hours of the canteen
* @param news news that may be available for the canteen
*/
data class CanteenOfferTuple(
val openingHours: String,
val news: String,
)
@@ -32,7 +32,7 @@ import androidx.room.PrimaryKey
) )
data class OfferCategory( data class OfferCategory(
@PrimaryKey val id: Int, @PrimaryKey val id: Int,
val dateId: Int, /*@ColumnInfo(index = true)*/ val dateId: Int,
val canteenId: Int, /*@ColumnInfo(index = true)*/ val canteenId: Int,
val category: String, val category: String,
) )
@@ -29,7 +29,7 @@ import androidx.room.PrimaryKey
) )
data class OfferItem( data class OfferItem(
@PrimaryKey val itemId: Int, @PrimaryKey val itemId: Int,
val categoryId: Int, /*@ColumnInfo(index = true)*/ val categoryId: Int,
val title: String, val title: String,
val price: String, val price: String,
@ColumnInfo(name = "dietary_preferences") val dietaryPreferences: String, @ColumnInfo(name = "dietary_preferences") val dietaryPreferences: String,
+3 -1
View File
@@ -175,7 +175,9 @@
<string name="settings_highlight_subtitle">Funktioniert nur, wenn Kurse sich nicht überschneiden!</string> <string name="settings_highlight_subtitle">Funktioniert nur, wenn Kurse sich nicht überschneiden!</string>
<string name="allergens_config_title">Verstecke Angebote mit bestimmten Allergenen</string> <string name="allergens_config_title">Verstecke Angebote mit bestimmten Allergenen</string>
<string name="allergens_config_subtitle">Allergene, die Du ausgeschlossen hast: %d</string> <string name="allergens_config_subtitle_zero">Du hast keine Allergene ausgeschlossen</string>
<string name="allergens_config_subtitle_one">Du hast ein Allergen ausgeschlossen</string>
<string name="allergens_config_subtitle_more">Du hast %d Allergene ausgeschlossen</string>
<string name="allergens_config_header">Wähle, welche Allergene Du vermeiden möchtest</string> <string name="allergens_config_header">Wähle, welche Allergene Du vermeiden möchtest</string>
<string name="allergens_config_content">Achtung: bitte verlasse Dich nicht vollständig auf diese Funktion. Stelle immer in der Mensa, die Du besuchst, sicher, dass die Stoffe, auf die Du allergisch reagierst, nicht in deren Angeboten vorhanden sind. Die Allergen-Hinweise einiger Mensen sind online leider unvollständig.</string> <string name="allergens_config_content">Achtung: bitte verlasse Dich nicht vollständig auf diese Funktion. Stelle immer in der Mensa, die Du besuchst, sicher, dass die Stoffe, auf die Du allergisch reagierst, nicht in deren Angeboten vorhanden sind. Die Allergen-Hinweise einiger Mensen sind online leider unvollständig.</string>
<string name="allergens_config_confirmation">Deine Allergene wurden gespeichert.</string> <string name="allergens_config_confirmation">Deine Allergene wurden gespeichert.</string>
+4 -2
View File
@@ -75,7 +75,7 @@
<string name="text_sheet_news_empty">No news are available.</string> <string name="text_sheet_news_empty">No news are available.</string>
<string name="sheet_licences_header">Licences</string> <string name="sheet_licences_header">Licences</string>
<string name="sheet_licences_content" translatable="false">Android developer resources by Google.\nhttps://developer.android.com/\nandroidx.appcompat:appcompat:1.6.1\nandroidx.constraintlayout:constraintlayout:2.1.4\nandroidx.core:core-ktx:1.10.0\nandroidx.fragment:fragment-ktx:1.6.0-beta01\nandroidx.navigation:navigation-fragment-ktx:2.5.3\nandroidx.navigation:navigation-ui-ktx:2.5.3\nandroidx.preference:preference-ktx:1.2.0\nandroidx.room:room-runtime:2.5.1\nandroidx.room:room-compiler:2.5.1\nandroidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01\n\nDesign guidelines, icons, and colour palette by Google.\nhttps://m3.material.io/\ncom.google.android.material:material:1.9.0\n\nAdditional icons by Flaticon.\nhttps://www.flaticon.com/\n\nWeb scraping functionality by Jonathan Hedley.\nhttps://jhy.io/\nhttps://jsoup.org/\norg.jsoup:jsoup:1.15.4\n\nApp developed by Deniz Düzgören.\ndenizk0461@gmail.com\ndeniz7@uni-bremen.de</string> <string name="sheet_licences_content" translatable="false">Android, Material Design Resources © 2014 %1$s Google, licenced under the Apache 2.0 License.\nhttps://developer.android.com\nhttps://material.io\n\nSeveral icons © 2013 %1$s Flaticon, licenced under the Flaticon Basic Free License.\nhttps://www.flaticon.com\n\nLato © 2010 %1$s Łukasz Dziedzic, licenced under the SIL Open Font License.\nhttps://fonts.google.com/specimen/Lato\n\njsoup HTML parser © 2009 %1$s Jonathan Hedley, licenced under the MIT License.\nhttps://jsoup.org\n\nApp developed by Deniz Düzgören.\ndenizk0461@gmail.com\ndeniz7@uni-bremen.de</string>
<string name="title_schedule">Your Schedule</string> <string name="title_schedule">Your Schedule</string>
<string name="title_schedule_short">Schedule</string> <string name="title_schedule_short">Schedule</string>
@@ -179,7 +179,9 @@
<string name="settings_highlight_subtitle">Only works properly if courses don\'t overlap!</string> <string name="settings_highlight_subtitle">Only works properly if courses don\'t overlap!</string>
<string name="allergens_config_title">Hide offers containing certain allergens</string> <string name="allergens_config_title">Hide offers containing certain allergens</string>
<string name="allergens_config_subtitle">Allergens you\'ve excluded: %d</string> <string name="allergens_config_subtitle_zero">You have not excluded any allergens</string>
<string name="allergens_config_subtitle_one">You have excluded one allergen</string>
<string name="allergens_config_subtitle_more">You have excluded %d allergens</string>
<string name="allergens_config_header">Select which allergens you\'d like to avoid</string> <string name="allergens_config_header">Select which allergens you\'d like to avoid</string>
<string name="allergens_config_content">Note: please don\'t entirely rely on this. Always check the notices displayed at the canteen you\'re visiting to confirm substances you may be allergic against are not present in their offerings. Some canteens unfortunately don\'t provide full allergen information online.</string> <string name="allergens_config_content">Note: please don\'t entirely rely on this. Always check the notices displayed at the canteen you\'re visiting to confirm substances you may be allergic against are not present in their offerings. Some canteens unfortunately don\'t provide full allergen information online.</string>
<string name="allergens_config_confirmation">Your allergen settings have been saved.</string> <string name="allergens_config_confirmation">Your allergen settings have been saved.</string>