Merge pull request 'feature/update-dependencies' (#55) from feature/update-dependencies into develop
All checks were successful
Build Android / build (push) Successful in 2m37s

Reviewed-on: #55
This commit was merged in pull request #55.
This commit is contained in:
2024-06-06 13:43:27 +02:00
6 changed files with 135 additions and 114 deletions

View File

@@ -30,15 +30,11 @@ jobs:
- name: Build abb - name: Build abb
run: ./gradlew bundleRelease run: ./gradlew bundleRelease
- name: Deploy latest to Nextcloud - uses: actions/upload-artifact@v3
run: | with:
curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "${{ secrets.NEXTCLOUD_BASE_URL }}/TichuCounter/latest/app-release.apk" name: app-release
curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "${{ secrets.NEXTCLOUD_BASE_URL }}/TichuCounter/latest/app-release.aab" retention-days: 10
path: app/build/outputs/**/release/app-release.*
- name: Deploy tagged build to Nextcloud
run: |
curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/apk/release/app-release.apk" "${{ secrets.NEXTCLOUD_BASE_URL }}/TichuCounter/tagged/app-release-${GITHUB_REF_NAME##*/}.apk"
curl -k -u "${{ secrets.NEXTCLOUD_USERNAME }}:${{ secrets.NEXTCLOUD_PASSWORD }}" -T "app/build/outputs/bundle/release/app-release.aab" "${{ secrets.NEXTCLOUD_BASE_URL }}/TichuCounter/tagged/app-release-${GITHUB_REF_NAME##*/}.aab"
- uses: https://github.com/ravsamhq/notify-slack-action@v2 - uses: https://github.com/ravsamhq/notify-slack-action@v2
if: always() if: always()

1
.gitignore vendored
View File

@@ -15,3 +15,4 @@
.idea .idea
keystore.properties keystore.properties
version.properties version.properties
.vscode/

View File

@@ -3,6 +3,7 @@ plugins {
id 'kotlin-android' id 'kotlin-android'
id 'com.google.dagger.hilt.android' id 'com.google.dagger.hilt.android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'com.google.devtools.ksp'
} }
// Create a variable called keystorePropertiesFile, and initialize it to your // Create a variable called keystorePropertiesFile, and initialize it to your
@@ -67,7 +68,7 @@ android {
} }
composeOptions { composeOptions {
kotlinCompilerExtensionVersion = "1.4.8" kotlinCompilerExtensionVersion = "1.5.14"
} }
compileOptions { compileOptions {
@@ -88,44 +89,44 @@ android {
dependencies { dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"]) implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.10.1' implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.appcompat:appcompat:1.7.0'
implementation "androidx.compose.material3:material3:1.1.1" implementation "androidx.compose.material3:material3:1.2.1"
implementation 'com.google.android.play:core-ktx:1.8.1' implementation 'com.google.android.play:core-ktx:1.8.1'
implementation 'com.google.android.play:core-ktx:1.8.1' implementation 'com.google.android.play:core-ktx:1.8.1'
implementation 'com.google.code.gson:gson:2.9.0' implementation 'com.google.code.gson:gson:2.10.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.1' implementation 'androidx.navigation:navigation-fragment-ktx:2.7.7'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.1' implementation 'androidx.navigation:navigation-ui-ktx:2.7.7'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.8.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.1'
implementation 'androidx.fragment:fragment-ktx:1.6.1' implementation 'androidx.fragment:fragment-ktx:1.7.1'
implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.1' implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.1'
implementation 'androidx.compose.material:material-icons-extended:1.5.0' implementation 'androidx.compose.material:material-icons-extended:1.6.7'
implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0" implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.0"
implementation 'androidx.activity:activity-compose:1.7.2' implementation 'androidx.activity:activity-compose:1.9.0'
implementation "androidx.compose.ui:ui:1.5.0" implementation "androidx.compose.ui:ui:1.6.7"
implementation "androidx.compose.ui:ui-tooling-preview:1.5.0" implementation "androidx.compose.ui:ui-tooling-preview:1.6.7"
implementation "androidx.compose.runtime:runtime-livedata:1.5.0" implementation "androidx.compose.runtime:runtime-livedata:1.6.7"
implementation "androidx.navigation:navigation-compose:2.7.1" implementation "androidx.navigation:navigation-compose:2.7.7"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1" implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.8.1"
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation "com.google.dagger:hilt-android:2.44" implementation "com.google.dagger:hilt-android:2.51.1"
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.5.0" androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.6.7"
debugImplementation "androidx.compose.ui:ui-tooling:1.5.0" debugImplementation "androidx.compose.ui:ui-tooling:1.6.7"
debugImplementation "androidx.compose.ui:ui-test-manifest:1.5.0" debugImplementation "androidx.compose.ui:ui-test-manifest:1.6.7"
kapt "com.google.dagger:hilt-compiler:2.44" kapt "com.google.dagger:hilt-compiler:2.51.1"
implementation "androidx.room:room-runtime:2.5.2" implementation "androidx.room:room-runtime:2.6.1"
annotationProcessor "androidx.room:room-compiler:2.5.2" annotationProcessor "androidx.room:room-compiler:2.6.1"
kapt "androidx.room:room-compiler:2.5.2" ksp "androidx.room:room-compiler:2.6.1"
implementation "androidx.room:room-ktx:2.5.2" implementation "androidx.room:room-ktx:2.6.1"
implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.multidex:multidex:2.0.1"
api "androidx.navigation:navigation-fragment-ktx:2.7.1" api "androidx.navigation:navigation-fragment-ktx:2.7.7"
} }
// Allow references to generated code // Allow references to generated code

View File

@@ -12,6 +12,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.LazyListState
@@ -25,18 +26,17 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Badge import androidx.compose.material3.Badge
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.Card import androidx.compose.material3.Card
import androidx.compose.material3.DismissDirection
import androidx.compose.material3.DismissValue
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarDuration import androidx.compose.material3.SnackbarDuration
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SnackbarResult import androidx.compose.material3.SnackbarResult
import androidx.compose.material3.SwipeToDismiss import androidx.compose.material3.SwipeToDismissBox
import androidx.compose.material3.SwipeToDismissBoxValue
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.material3.rememberDismissState import androidx.compose.material3.rememberSwipeToDismissBoxState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
@@ -48,6 +48,7 @@ import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Alignment.Companion.TopEnd import androidx.compose.ui.Alignment.Companion.TopEnd
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
@@ -213,89 +214,110 @@ fun DismissibleHistoryListItem(
val density = LocalDensity.current val density = LocalDensity.current
val dismissState = val dismissState =
rememberDismissState(positionalThreshold = { with(density) { 100.dp.toPx() } }, rememberSwipeToDismissBoxState(positionalThreshold = { with(density) { 100.dp.toPx() } },
confirmValueChange = { confirmValueChange = {
if (it == DismissValue.DismissedToStart) { if (it == SwipeToDismissBoxValue.EndToStart) {
onDeleteClicked(game.game.uid) onDeleteClicked(game.game.uid)
} }
if (it == DismissValue.DismissedToEnd) { if (it == SwipeToDismissBoxValue.StartToEnd) {
onOpenClicked(game.game.uid) onOpenClicked(game.game.uid)
} }
true true
}) })
val directions = if (game.game.active) { SwipeToDismissBox(
setOf()
} else {
setOf(DismissDirection.EndToStart, DismissDirection.StartToEnd)
}
SwipeToDismiss(
modifier = modifier, modifier = modifier,
state = dismissState, state = dismissState,
directions = directions, enableDismissFromEndToStart = true,
background = { enableDismissFromStartToEnd = true,
val direction = dismissState.dismissDirection ?: return@SwipeToDismiss backgroundContent = {
val color by animateColorAsState( ItemBackground(dismissState.targetValue)
when (dismissState.targetValue) { }, content = {
DismissValue.DismissedToStart -> MaterialTheme.colorScheme.error
DismissValue.DismissedToEnd -> MaterialTheme.colorScheme.primary
else -> MaterialTheme.colorScheme.background
}, label = ""
)
val textColor by animateColorAsState(
when (dismissState.targetValue) {
DismissValue.DismissedToStart -> MaterialTheme.colorScheme.onError
DismissValue.DismissedToEnd -> MaterialTheme.colorScheme.onPrimary
else -> MaterialTheme.colorScheme.onBackground
}, label = ""
)
val alignment = when (direction) {
DismissDirection.StartToEnd -> Alignment.CenterStart
DismissDirection.EndToStart -> Alignment.CenterEnd
}
val icon = when (direction) {
DismissDirection.StartToEnd -> Icons.Outlined.RestartAlt
DismissDirection.EndToStart -> Icons.Outlined.Delete
}
val text = when (direction) {
DismissDirection.StartToEnd -> stringResource(id = R.string.continue_play)
DismissDirection.EndToStart -> stringResource(id = R.string.delete)
}
val scale by animateFloatAsState(
if (dismissState.targetValue == DismissValue.Default) 0.75f else 1f, label = ""
)
Box(
Modifier
.fillMaxSize()
.padding(top = 2.dp, bottom = 2.dp)
.background(color)
.padding(horizontal = 10.dp),
contentAlignment = alignment
) {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Icon(
icon,
contentDescription = null,
modifier = Modifier.scale(scale),
tint = textColor
)
Text(text = text, color = textColor)
}
}
}, dismissContent = {
HistoryListItem(game = game, modifier = Modifier.padding(2.dp)) HistoryListItem(game = game, modifier = Modifier.padding(2.dp))
}) })
} }
@OptIn(ExperimentalMaterial3Api::class) @OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ItemBackground(
dismissBoxValue: SwipeToDismissBoxValue
)
{
val backgroundColor by animateColorAsState(
when (dismissBoxValue) {
SwipeToDismissBoxValue.EndToStart -> MaterialTheme.colorScheme.error
SwipeToDismissBoxValue.StartToEnd-> MaterialTheme.colorScheme.primary
else -> MaterialTheme.colorScheme.background
}, label = ""
)
val textColor by animateColorAsState(
when (dismissBoxValue) {
SwipeToDismissBoxValue.EndToStart -> MaterialTheme.colorScheme.onError
SwipeToDismissBoxValue.StartToEnd -> MaterialTheme.colorScheme.onPrimary
else -> MaterialTheme.colorScheme.onBackground
}, label = ""
)
val scale by animateFloatAsState(
if (dismissBoxValue == SwipeToDismissBoxValue.Settled) 0.75f else 1f, label = ""
)
Box(
Modifier
.fillMaxSize()
.padding(top = 2.dp, bottom = 2.dp)
.background(backgroundColor)
.padding(horizontal = 10.dp),
) {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.align(Alignment.CenterStart)
) {
Icon(Icons.Outlined.RestartAlt,
contentDescription = null,
tint = textColor,
modifier = Modifier.scale(scale),)
Text(text = stringResource(id = R.string.continue_play), color = textColor)
}
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.align(Alignment.CenterEnd)
) {
Icon(Icons.Outlined.Delete,
contentDescription = null,
tint = textColor,
modifier = Modifier.scale(scale),)
Text(text = stringResource(id = R.string.delete), color = textColor)
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
private fun BackgroundPreview() {
Column {
Box(modifier = Modifier.height(60.dp))
{
ItemBackground(SwipeToDismissBoxValue.Settled)
}
Box(modifier = Modifier.height(60.dp))
{
ItemBackground(SwipeToDismissBoxValue.EndToStart)
}
Box(modifier = Modifier.height(60.dp))
{
ItemBackground(SwipeToDismissBoxValue.StartToEnd)
}
}
}
@Composable @Composable
fun HistoryListItem( fun HistoryListItem(
game: GameWithScores, modifier: Modifier = Modifier game: GameWithScores, modifier: Modifier = Modifier

View File

@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = "1.8.22" ext.kotlin_version = "1.9.24"
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.1.2' classpath 'com.android.tools.build:gradle:8.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
@@ -15,8 +15,9 @@ buildscript {
} }
plugins { plugins {
id 'com.google.dagger.hilt.android' version '2.44' apply false id 'com.google.dagger.hilt.android' version '2.51.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'com.google.devtools.ksp' version '1.9.24-1.0.20' apply false
} }
allprojects { allprojects {

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip