Skip to content

Commit

Permalink
fix: Empty price fix, libs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lastaapps committed Nov 14, 2022
1 parent a938d96 commit 18a50c2
Show file tree
Hide file tree
Showing 23 changed files with 98 additions and 163 deletions.
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
*.iml
.gradle
/local.properties
/.idea/artifacts/
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/deploymentTargetDropDown.xml
.DS_Store
/build
/captures
Expand Down
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions .idea/compiler.xml

This file was deleted.

30 changes: 0 additions & 30 deletions .idea/gradle.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/misc.xml

This file was deleted.

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ android {
applicationId = App.APP_ID

//have to be specified explicitly for FDroid to work
versionCode = 1020200 // 1x major . 2x minor . 2x path . 2x build diff
versionName = "1.2.2"
versionCode = 1020300 // 1x major . 2x minor . 2x path . 2x build diff
versionName = "1.2.3"
require(versionCode == App.VERSION_CODE)
require(versionName == App.VERSION_NAME)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ private fun InitMenzaRow(
ExposedDropdownMenuBox(
expanded = expanded,
onExpandedChange = { onExpanded(!expanded) },
modifier = modifier,
) {
TextField(
readOnly = true,
Expand All @@ -110,7 +109,7 @@ private fun InitMenzaRow(
label = { Text(stringResource(R.string.settings_init_menza_behaviour)) },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded) },
colors = ExposedDropdownMenuDefaults.textFieldColors(),
modifier = Modifier.menuAnchor(),
modifier = modifier.menuAnchor(),
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down Expand Up @@ -141,7 +140,6 @@ private fun PreferredMenza(
modifier: Modifier = Modifier
) {
ExposedDropdownMenuBox(
modifier = modifier,
expanded = expanded,
onExpandedChange = { onExpanded(!expanded) },
) {
Expand All @@ -153,7 +151,7 @@ private fun PreferredMenza(
label = { Text(stringResource(R.string.settings_init_menza_select_title)) },
trailingIcon = { ExposedDropdownMenuDefaults.TrailingIcon(expanded) },
colors = ExposedDropdownMenuDefaults.textFieldColors(),
modifier = Modifier.menuAnchor(),
modifier = modifier.menuAnchor(),
)
ExposedDropdownMenu(
expanded = expanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ suspend fun SettingsStore.setPriceType(priceType: PriceType) {
edit { it[priceTypeKey] = priceType.id }
}

fun Dish.getPrice(type: PriceType): Price {
fun Dish.getPrice(type: PriceType): Price? {
return when (type) {
PriceType.Discounted -> this.priceStudent
else -> this.priceNormal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,18 @@ private fun DishImageWithBadge(

@Composable
private fun DishBadge(dish: Dish, priceType: PriceType, modifier: Modifier = Modifier) {
Surface(
modifier,
color = MaterialTheme.colorScheme.tertiary,
shape = MaterialTheme.shapes.medium,
) {
Text(
text = "${dish.getPrice(priceType).price}",
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(2.dp)
)
dish.getPrice(priceType)?.let { price ->
Surface(
modifier,
color = MaterialTheme.colorScheme.tertiary,
shape = MaterialTheme.shapes.medium,
) {
Text(
text = "${price.price}",
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(2.dp)
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private fun PriceView(dish: Dish, modifier: Modifier = Modifier) {
Row(modifier) {
Text(text = dish.amount?.amount ?: "")
Text(
text = "${dish.priceStudent.price} / ${dish.priceNormal.price}",
text = "${dish.priceStudent?.price ?: "???"} / ${dish.priceNormal?.price ?: "???"}",
textAlign = TextAlign.End,
modifier = Modifier.weight(1f),
)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ group = App.GROUP
version = App.VERSION_NAME

plugins {
val gradleVersion = "7.3.0"
val gradleVersion = "7.3.1"
id(Plugins.APPLICATION) version gradleVersion apply false
id(Plugins.LIBRARY) version gradleVersion apply false
id(Plugins.KOTLIN_ANDROID) version Versions.KOTLIN apply false
Expand All @@ -37,7 +37,7 @@ plugins {
id(Plugins.KSP) version Versions.KSP apply false
id(Plugins.ABOUT_LIBRARIES) version Versions.ABOUT_LIBRARIES apply false

id("com.github.ben-manes.versions") version "0.42.0"
id("com.github.ben-manes.versions") version "0.44.0"
}

tasks.register("clean", Delete::class) {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ object App {
const val APP_ID = "$GROUP.menza"

// needs to be also updated in app/build.gradle
const val VERSION_CODE = 1020200 // 1x major . 2x minor . 2x path . 2x build diff
const val VERSION_NAME = "1.2.2"
const val VERSION_CODE = 1020300 // 1x major . 2x minor . 2x path . 2x build diff
const val VERSION_NAME = "1.2.3"
const val IS_ALPHA = false
const val IS_BETA = false

Expand Down
32 changes: 16 additions & 16 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ object Versions {
const val DESUGAR = "1.2.2"

//JetBrains
const val KOTLIN = "1.7.20"
const val KOTLIN = "1.7.21"
const val KOTLIN_LANGUAGE_VERSION = "1.7"
const val KSP = "$KOTLIN-1.0.6"
const val KSP = "$KOTLIN-1.0.8"
const val COROUTINES = "1.6.4"
const val SERIALIZATION = "1.4.0"
const val KTOR = "2.1.2"
const val SERIALIZATION = "1.4.1"
const val KTOR = "2.1.3"

//androidx
const val ACTIVITY = "1.6.0"
const val ACTIVITY = "1.6.1"
const val ANNOTATION = "1.4.0"
const val APPCOMPAT = "1.6.0-rc01"
const val APP_SEARCH = "1.1.0-alpha01"
Expand All @@ -51,8 +51,8 @@ object Versions {
const val EMOJI = "1.2.0-alpha04"
const val FRAGMENT = "1.5.0-rc01"
const val HILT = "1.0.0"
const val LIFECYCLE = "2.6.0-alpha02"
const val NAVIGATION = "2.5.2"
const val LIFECYCLE = "2.6.0-alpha03"
const val NAVIGATION = "2.5.3"
const val PREFERENCES = "1.2.0-rc01"
const val RECYCLER_VIEW = "1.3.0-alpha02"
const val ROOM = "2.4.2"
Expand All @@ -61,34 +61,34 @@ object Versions {
const val SWIPE_REFRESH_LAYOUT = "1.2.0-alpha01"
const val TRACING = "1.1.0"
const val VECTOR_DRAWABLES = "1.2.0-beta01"
const val WINDOW_MANAGER = "1.1.0-alpha03"
const val WINDOW_MANAGER = "1.1.0-alpha04"
const val WORK = "2.8.0-alpha02"


//compose
const val COMPOSE = "1.3.0-rc01"
const val COMPOSE_COMPILER = "1.3.2"
const val COMPOSE_MATERIAL_3 = "1.0.0-rc01"
const val COMPOSE = "1.3.1"
const val COMPOSE_COMPILER = "1.4.0-alpha02"
const val COMPOSE_MATERIAL_3 = "1.0.1"
const val CONSTRAINTLAYOUT_COMPOSE = "1.0.1"
const val VIEWMODEL_COMPOSE = LIFECYCLE
const val HILT_NAVIGATION_COMPOSE = "1.0.0"

//google
const val GOOGLE_MATERIAL = "1.6.1"
const val GOOGLE_MATERIAL = "1.7.0"
const val PLAY_SERVICES = "1.8.1"
const val PLAY_SERVICES_LOCATION = "20.0.0"
const val MLKIT_BARCODE = "17.0.2"
const val ACCOMPANIST = "0.26.5-rc"
const val ACCOMPANIST = "0.27.0"

//firebase
const val FIREBASE_BOM = "31.1.0"

//others
const val ABOUT_LIBRARIES = "10.5.0"
const val ABOUT_LIBRARIES = "10.5.1"
const val COIL = "2.2.2"
const val KM_LOGGING = "1.1.1"
const val KODEIN = "7.14.0"
const val KOTEST = "5.5.0"
const val KODEIN = "7.15.1"
const val KOTEST = "5.5.4"
const val KOTLINX_DATETIME = "0.4.0"
const val KOTLINX_COLLECTION = "0.3.5"
const val LOGBACK = "1.2.11"
Expand Down
4 changes: 2 additions & 2 deletions entity/src/commonMain/kotlin/cz/lastaapps/entity/day/Dish.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ data class Dish(
val allergens: ImmutableList<AllergenId>,
val allergenDishId: DishAllergensPage?,
val imageUrl: String?,
val priceStudent: Price,
val priceNormal: Price,
val priceStudent: Price?,
val priceNormal: Price?,
val issuePlaces: ImmutableList<IssueLocation>,
) {
init {
Expand Down
3 changes: 3 additions & 0 deletions fastlane/metadata/android/cs-CZ/changelogs/1020300.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Oprava načítání alergenů
Oprava nezobrazování jídel, když není zadána cena jídla
Aktualizace knihoven
3 changes: 3 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/1020300.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed allergens loading
Fixed no dish price given bug
Libs update
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
# along with Menza. If not, see <https://www.gnu.org/licenses/>.
#

#Fri Sep 23 21:04:13 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-rc-3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
Loading

0 comments on commit 18a50c2

Please sign in to comment.