diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cea7ccb..9432333 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -174,12 +174,15 @@ jobs: - name: "Create Version in Acrarium" if: ${{ env.acra_id }} continue-on-error: true + env: + summary_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + acrarium_url: ${{ secrets.ACRARIUM_HOST }}/api/apps/${{ env.acra_id }}/version/upload/${{ github.run_number }}?name=${{ github.ref_name }} run: | - echo -n "See GitHub Actions" | curl -m 120 \ + echo -n "See: ${{ env.summary_url }}" | curl -m 120 \ -H "Content-Type: text/plain" \ -u "${{ secrets.ACRARIUM_USER }}:${{ secrets.ACRARIUM_PASS }}" \ --data-binary @- \ - "${{ secrets.ACRARIUM_HOST }}/api/apps/${{ env.acra_id }}/version/upload/${{ github.run_number }}?name=${{ github.ref_name }}" + "${{ env.acrarium_url }}" - name: "Upload APK to Artifacts" uses: actions/upload-artifact@v7 diff --git a/README.md b/README.md index 82bbebf..a11d805 100644 --- a/README.md +++ b/README.md @@ -252,10 +252,11 @@ You can also star this project on GitHub and support other related projects: - [Django Files Android](https://github.com/django-files/android-client?tab=readme-ov-file#readme) - [Zipline Android](https://github.com/cssnr/zipline-android?tab=readme-ov-file#readme) -- [NOAA Weather Android](https://github.com/cssnr/noaa-weather-android?tab=readme-ov-file#readme) - [Remote Wallpaper Android](https://github.com/cssnr/remote-wallpaper-android?tab=readme-ov-file#readme) +- [NOAA Weather Android](https://github.com/cssnr/noaa-weather-android?tab=readme-ov-file#readme) - [ParKing Android](https://github.com/cssnr/parking-android?tab=readme-ov-file#readme) - [Todo List Android](https://github.com/cssnr/todolist-android?tab=readme-ov-file#readme) +- [Device Info Android](https://github.com/cssnr/device-info-android?tab=readme-ov-file#readme) - [Tibs3DPrints Android](https://github.com/cssnr/tibs3dprints-android?tab=readme-ov-file#readme) For a full list of current projects visit: [https://cssnr.github.io/](https://cssnr.github.io/) diff --git a/app/src/main/java/org/cssnr/parking/ui/ParKingApp.kt b/app/src/main/java/org/cssnr/parking/ui/ParKingApp.kt index c3a612a..4d9732e 100644 --- a/app/src/main/java/org/cssnr/parking/ui/ParKingApp.kt +++ b/app/src/main/java/org/cssnr/parking/ui/ParKingApp.kt @@ -1,14 +1,25 @@ package org.cssnr.parking.ui -import androidx.annotation.DrawableRes +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.expandVertically +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.animation.shrinkVertically +import androidx.compose.animation.slideInVertically +import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.only import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.History +import androidx.compose.material.icons.filled.AddLocation import androidx.compose.material.icons.filled.Map +import androidx.compose.material.icons.filled.BrowseGallery import androidx.compose.material.icons.filled.Settings +import androidx.compose.material.icons.outlined.AddLocation +import androidx.compose.material.icons.outlined.Map +import androidx.compose.material.icons.outlined.BrowseGallery +import androidx.compose.material.icons.outlined.Settings import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem @@ -17,9 +28,9 @@ import androidx.compose.material3.ScaffoldDefaults import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.res.painterResource import androidx.navigation.NavDestination.Companion.hasRoute import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavGraph.Companion.findStartDestination @@ -28,7 +39,6 @@ import androidx.navigation.compose.composable import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.toRoute -import org.cssnr.parking.R import org.cssnr.parking.ui.navigation.Automatic import org.cssnr.parking.ui.navigation.About import org.cssnr.parking.ui.navigation.History @@ -45,13 +55,13 @@ import org.cssnr.parking.ui.screens.SettingsRoute enum class Destination( val route: Any, val label: String, - val icon: ImageVector?, - @DrawableRes val iconRes: Int? = null, + val selectedIcon: ImageVector, + val unselectedIcon: ImageVector, ) { - LOCATION(Location, "Location", Icons.Filled.Map), - HISTORY(History, "History", Icons.Filled.History), - AUTOMATIC(Automatic, "Automatic", null, R.drawable.md_pin_road_24px), - SETTINGS(Settings, "Settings", Icons.Filled.Settings), + LOCATION(Location, "Location", Icons.Filled.Map, Icons.Outlined.Map), + HISTORY(History, "History", Icons.Filled.BrowseGallery, Icons.Outlined.BrowseGallery), + AUTOMATIC(Automatic, "Automatic", Icons.Filled.AddLocation, Icons.Outlined.AddLocation), + SETTINGS(Settings, "Settings", Icons.Filled.Settings, Icons.Outlined.Settings), } @Composable @@ -68,15 +78,32 @@ fun ParKingApp() { } } + // About is a drill-in from Settings. Animate the bar instead of + // adding/removing it instantly, otherwise Scaffold's innerPadding + // snaps and the outgoing/incoming content jumps. + val isAbout = currentDestination?.hasRoute(About::class) == true + val showBottomBar = !isAbout + Scaffold( contentWindowInsets = ScaffoldDefaults.contentWindowInsets .only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom), bottomBar = { - if (currentDestination?.hasRoute(About::class) != true) { + AnimatedVisibility( + visible = showBottomBar, + enter = slideInVertically(initialOffsetY = { it }) + + expandVertically(expandFrom = Alignment.Bottom) + + fadeIn(), + exit = slideOutVertically(targetOffsetY = { it }) + + shrinkVertically(shrinkTowards = Alignment.Bottom) + + fadeOut(), + ) { NavigationBar { Destination.entries.forEach { destination -> + // Keep Settings highlighted while About is on top so the + // selection does not flicker out during the slide-away. val selected = currentDestination?.hierarchy - ?.any { it.hasRoute(destination.route::class) } == true + ?.any { it.hasRoute(destination.route::class) } == true || + (isAbout && destination == Destination.SETTINGS) NavigationBarItem( selected = selected, onClick = { @@ -88,18 +115,10 @@ fun ParKingApp() { } }, icon = { - val imageVector = destination.icon - if (imageVector != null) { - Icon( - imageVector = imageVector, - contentDescription = destination.label, - ) - } else { - Icon( - painter = painterResource(destination.iconRes!!), - contentDescription = destination.label, - ) - } + Icon( + imageVector = if (selected) destination.selectedIcon else destination.unselectedIcon, + contentDescription = destination.label, + ) }, label = { Text(destination.label) }, ) diff --git a/app/src/main/java/org/cssnr/parking/ui/screens/MapScreen.kt b/app/src/main/java/org/cssnr/parking/ui/screens/MapScreen.kt index d5532b1..6430da0 100644 --- a/app/src/main/java/org/cssnr/parking/ui/screens/MapScreen.kt +++ b/app/src/main/java/org/cssnr/parking/ui/screens/MapScreen.kt @@ -9,7 +9,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material.icons.filled.AddCircle -import androidx.compose.material.icons.filled.LocationSearching +import androidx.compose.material.icons.filled.MyLocation import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FloatingActionButton @@ -233,7 +233,7 @@ fun MapScreen( }, ) { Icon( - imageVector = Icons.Filled.LocationSearching, + imageVector = Icons.Filled.MyLocation, contentDescription = "Jump to current location", ) } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ae40ac0..52ff420 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,7 +18,7 @@ View Developer\'s Website Join Discord Chat with us on Discord - Support + Support Development Donate on Ko-fi Please Reconsider Disable