Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
67 changes: 43 additions & 24 deletions app/src/main/java/org/cssnr/parking/ui/ParKingApp.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 = {
Expand All @@ -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) },
)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/cssnr/parking/ui/screens/MapScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -233,7 +233,7 @@ fun MapScreen(
},
) {
Icon(
imageVector = Icons.Filled.LocationSearching,
imageVector = Icons.Filled.MyLocation,
contentDescription = "Jump to current location",
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<string name="about_visit_website_summary">View Developer\'s Website</string>
<string name="about_discord">Join Discord</string>
<string name="about_discord_summary">Chat with us on Discord</string>
<string name="about_support_development">Support</string>
<string name="about_support_development">Support Development</string>
<string name="about_support_development_summary">Donate on Ko-fi</string>
<string name="acra_disable_title">Please Reconsider</string>
<string name="acra_disable_confirm">Disable</string>
Expand Down
Loading