Skip to content

Commit

Permalink
Release 2.0.3/1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-Fabi committed Sep 21, 2023
2 parents 92e3852 + b430e32 commit e2e5a1c
Show file tree
Hide file tree
Showing 84 changed files with 853 additions and 452 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/checkStyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Check Style

on:
pull_request:

env:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3g"

jobs:
checkStyle:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Detekt
run: ./gradlew detekt

- name: Upload detekt SARIF files
if: always()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'build/reports/detekt/merge.sarif'
category: detekt
12 changes: 7 additions & 5 deletions .github/workflows/publishAndroid.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Publish Android
concurrency: # Cancel currently running releases when a new one is started
group: publish-android
cancel-in-progress: true
on:
push:
branches:
Expand All @@ -19,10 +22,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle
Expand Down Expand Up @@ -55,11 +58,10 @@ jobs:
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3g"

- name: Create version tag
if: ${{ github.ref_name == 'main' }}
run: |
git tag android-$(cat androidApp/build/version.tag)
git push --tags
git push origin android-$(cat androidApp/build/version.tag)
# TODO auto increase androidPatch in version.properties (on prod build only) and push (to dev branch, republish must be prevented then)?

# TODO add discord or other notification
# TODO add discord or other notification
7 changes: 5 additions & 2 deletions .github/workflows/publishShared.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Publish Shared Swift Package
concurrency: # Cancel currently running releases when a new one is started
group: publish-shared
cancel-in-progress: true
on:
workflow_dispatch: # allow manually running the workflow for the dev and main branch
branches:
Expand All @@ -17,8 +20,8 @@ on:

jobs:
call-kmmbridge-publish:
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/faktorybuildbranches.yml@v0.8
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/faktorybuildbranches.yml@2e121ace461e0004eb079926c1f6e74afaee3e3d
with:
jvmVersion: 11
jvmVersion: 17
secrets:
gradle_params: "-PGITHUB_BRANCH=${{ github.ref_name }}"
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'adopt'

- name: Setup Gradle
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ and [build.gradle.kts (shared)](shared/build.gradle.kts) kmmbridge config)
# Further Resources and References

- [Kotlin/kmm-sample](https://github.com/Kotlin/kmm-sample)
- [KaMPKit](https://github.com/touchlab/KaMPKit) Collection of code and tools for getting stated
- [KaMPKit](https://github.com/touchlab/KaMPKit) Collection of code and tools for getting started
with KMP/KMM
- [KMMBridge SPM sample (android + shared)](https://github.com/touchlab/KMMBridgeSampleKotlin)
- [KMMBridge SPM sample (iOS)](https://github.com/touchlab/KMMBridgeSampleSpm)
Expand Down
29 changes: 16 additions & 13 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import java.util.Properties

plugins {
id("com.android.application")
id("com.github.triplet.play") version "3.6.0"
id("com.github.triplet.play") version "3.8.4"
kotlin("android")
id("com.google.devtools.ksp") version "1.8.10-1.0.9"
id("com.google.devtools.ksp") version "1.9.0-1.0.13"
}

private val versionProperty by lazy {
Expand All @@ -23,6 +23,10 @@ android {
namespace = "org.datepollsystems.waiterrobot.android"
compileSdk = Versions.androidCompileSdk

androidResources {
generateLocaleConfig = true
}

defaultConfig {
applicationId = "org.datepollsystems.waiterrobot.android"

Expand Down Expand Up @@ -73,21 +77,22 @@ android {

buildFeatures {
compose = true
buildConfig = true
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.composeCompiler
}

packagingOptions {
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
isCoreLibraryDesugaringEnabled = true
}

Expand All @@ -97,7 +102,6 @@ android {
create("lava") {
dimension = "environment"
applicationIdSuffix = ".lava"
resValue("string", "app_name", "WaiterRobot Lava")
buildConfigField("String", "API_BASE", "\"https://lava.kellner.team/api\"")
manifestPlaceholders["host"] = "lava.kellner.team"

Expand All @@ -107,13 +111,12 @@ android {
// -> use epochMinutes (overflow would be in 5962).
// (conversion to int is save as java int is bigger as the max versionCode allowed by google play)
val epochMinutes = (Date().toInstant().epochSecond / 60).toInt()
versionNameSuffix = "-lava-${epochMinutes}"
versionNameSuffix = "-lava-$epochMinutes"
versionCode = epochMinutes
}

create("prod") {
dimension = "environment"
resValue("string", "app_name", "WaiterRobot")
buildConfigField("String", "API_BASE", "\"https://my.kellner.team/api\"")
manifestPlaceholders["host"] = "my.kellner.team"
}
Expand Down Expand Up @@ -158,11 +161,11 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:${Versions.androidxLifecycle}")
implementation("androidx.appcompat:appcompat:1.6.1")

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.2")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")

// Compose
runtimeOnly("androidx.compose.compiler:compiler:${Versions.composeCompiler}")
implementation("androidx.activity:activity-compose:1.6.1")
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.foundation:foundation:${Versions.compose}")
implementation("androidx.compose.foundation:foundation-layout:${Versions.compose}")
implementation("androidx.compose.ui:ui-graphics:${Versions.compose}")
Expand All @@ -174,13 +177,13 @@ dependencies {
implementation("androidx.compose.material:material-icons-extended:${Versions.compose}")

// Compose helpers
implementation("com.google.accompanist:accompanist-permissions:0.28.0")
implementation("com.google.accompanist:accompanist-permissions:0.32.0")

// Architecture (MVI)
implementation("org.orbit-mvi:orbit-compose:${Versions.orbitMvi}")

// Dependency injection
implementation("io.insert-koin:koin-androidx-compose:3.4.2") // Not aligned with other koin version
implementation("io.insert-koin:koin-androidx-compose:3.4.6") // Not aligned with other koin version

// SafeCompose Navigation Args
implementation("io.github.raamcosta.compose-destinations:core:${Versions.composeDestinations}")
Expand All @@ -192,7 +195,7 @@ dependencies {
implementation("androidx.camera:camera-lifecycle:${Versions.camera}")

// QrCode Scanning
implementation("com.google.mlkit:barcode-scanning:17.0.3")
implementation("com.google.mlkit:barcode-scanning:17.2.0")

// In-App-Update support
implementation("com.google.android.play:app-update:2.1.0")
Expand Down
4 changes: 4 additions & 0 deletions androidApp/src/lava/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">lava kellner.team</string>
</resources>
4 changes: 4 additions & 0 deletions androidApp/src/lava/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">lava waiters.team</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import kotlinx.datetime.Instant
import kotlinx.datetime.until
import org.datepollsystems.waiterrobot.android.ui.RootView
import org.datepollsystems.waiterrobot.shared.core.CommonApp
import org.datepollsystems.waiterrobot.shared.core.CommonApp.MIN_UPDATE_INFO_HOURS
import org.datepollsystems.waiterrobot.shared.features.settings.models.AppTheme
import org.datepollsystems.waiterrobot.shared.root.RootViewModel
import org.datepollsystems.waiterrobot.shared.utils.extensions.defaultOnNull
Expand Down Expand Up @@ -74,11 +75,11 @@ class MainActivity : AppCompatActivity() {
val appUpdateInfoTask = appUpdateManager.appUpdateInfo
appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
if (
appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
&& appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)
&& CommonApp.settings.lastUpdateAvailableNote // Show max once a day
appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE &&
appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE) &&
CommonApp.settings.lastUpdateAvailableNote // Show max once a day
.defaultOnNull(Instant.DISTANT_PAST)
.until(Clock.System.now(), DateTimeUnit.HOUR) > 24
.until(Clock.System.now(), DateTimeUnit.HOUR) > MIN_UPDATE_INFO_HOURS
) {
CommonApp.settings.lastUpdateAvailableNote = Clock.System.now()
appUpdateManager.startUpdateFlow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import com.ramcosta.composedestinations.annotation.Destination
import org.datepollsystems.waiterrobot.android.ui.common.CenteredText
import org.datepollsystems.waiterrobot.android.ui.common.FloatingActionButton
import org.datepollsystems.waiterrobot.android.ui.core.CenteredText
import org.datepollsystems.waiterrobot.android.ui.core.handleSideEffects
import org.datepollsystems.waiterrobot.android.ui.core.view.ScaffoldView
import org.datepollsystems.waiterrobot.shared.core.viewmodel.ViewState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
package org.datepollsystems.waiterrobot.android.ui.billing

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.*
import androidx.compose.material.Button
import androidx.compose.material.MaterialTheme
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -15,8 +23,8 @@ import org.datepollsystems.waiterrobot.shared.generated.localization.change
import org.datepollsystems.waiterrobot.shared.generated.localization.pay
import org.datepollsystems.waiterrobot.shared.generated.localization.total

@Composable
// TODO own Screen?
@Composable
fun PayBillDialog(
priceSum: String,
changeText: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.datepollsystems.waiterrobot.android.ui.core
package org.datepollsystems.waiterrobot.android.ui.common

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ package org.datepollsystems.waiterrobot.android.ui.common

import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.material.*
import androidx.compose.material.ContentAlpha
import androidx.compose.material.FloatingActionButtonDefaults
import androidx.compose.material.FloatingActionButtonElevation
import androidx.compose.material.MaterialTheme
import androidx.compose.material.contentColorFor
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.compositeOver

@Composable
/* Wrapper for FloatingActionButton which allows to disable the button */
@Composable
fun FloatingActionButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
Expand All @@ -23,7 +27,9 @@ fun FloatingActionButton(
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
content: @Composable () -> Unit
) {
val realOnclick = if (enabled) onClick else {
val realOnclick = if (enabled) {
onClick
} else {
{}
}
val realBackgroundColor = if (enabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ fun LinkText(modifier: Modifier = Modifier, text: String, url: String) {
}
}
)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package org.datepollsystems.waiterrobot.android.ui.common

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.selection.selectable
Expand Down Expand Up @@ -77,4 +82,4 @@ private fun <T : Any> RadioButtonRow(
modifier = Modifier.padding(start = 16.dp)
)
}
}
}
Loading

0 comments on commit e2e5a1c

Please sign in to comment.