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
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId = "com.am.stbus"
minSdk = 23
targetSdk = 36
versionCode = 85
versionName = "4.1.0"
versionCode = 86
versionName = "4.1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
12 changes: 11 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,14 @@
-keepattributes SourceFile,LineNumberTable # Keep file names and line numbers.
-keep public class * extends java.lang.Exception # Optional: Keep custom exceptions.

-dontwarn org.slf4j.impl.StaticLoggerBinder
-dontwarn org.slf4j.impl.StaticLoggerBinder

# Keep SignalR data models to prevent obfuscation of field names
-keep class com.am.stbus.domain.usecases.gmaps.VehicleData { *; }
-keep class com.am.stbus.data.models.LiveVehicle { *; }

# If you use other models for API responses, keep them as well
-keep class com.am.stbus.data.models.** { *; }

# SignalR requires some reflection
-keep class com.microsoft.signalr.** { *; }
22 changes: 11 additions & 11 deletions app/src/main/java/com/am/stbus/presentation/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
Expand All @@ -32,6 +30,7 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.runtime.rememberSaveableStateHolderNavEntryDecorator
import androidx.navigation3.ui.NavDisplay
import com.am.stbus.R
Expand Down Expand Up @@ -61,7 +60,8 @@ class MainActivity : ComponentActivity() {

SplitBusTheme {

val backStack = remember { mutableStateListOf<Any>(HomeScreenKey) }
// Recommended: use rememberNavBackStack for persistent state
val backStack = rememberNavBackStack(HomeScreenKey)

val bottomBarVisible = TOP_LEVEL_ROUTES.map { it.navKey }.contains(backStack.last())

Expand All @@ -88,6 +88,7 @@ class MainActivity : ComponentActivity() {
selected = isSelected,
onClick = {
backStack.add(topLevelRoute.navKey)
// Keep only the home screen and the current selection
if (backStack.size > 2) {
backStack.removeAt(1)
}
Expand Down Expand Up @@ -162,7 +163,7 @@ class MainActivity : ComponentActivity() {
}
},
onBackClicked = {
backStack.removeAt(backStack.lastIndex)
backStack.removeLastOrNull()
}
)
}
Expand All @@ -185,7 +186,7 @@ class MainActivity : ComponentActivity() {
}
},
onBackClicked = {
backStack.removeAt(backStack.lastIndex)
backStack.removeLastOrNull()
}
)
}
Expand All @@ -201,12 +202,12 @@ class MainActivity : ComponentActivity() {
}
entry<InfoGmapsScreenKey> {
GmapsScreen {
backStack.removeAt(backStack.lastIndex)
backStack.removeLastOrNull()
}
}
entry<InfoPrometWebScreenKey> {
PrometWebScreen {
backStack.removeAt(backStack.lastIndex)
backStack.removeLastOrNull()
}
}

Expand Down Expand Up @@ -266,11 +267,10 @@ data object TimetablesListScreenKey : NavKey
data object InfoScreenKey : NavKey

@Serializable
data object InfoGmapsScreenKey : NavKey {
}
data object InfoGmapsScreenKey : NavKey

data object InfoPrometWebScreenKey : NavKey {
}
@Serializable
data object InfoPrometWebScreenKey : NavKey


@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ class TimetablesDetailViewModel(
)
}
}.onFailure {
Timber.wtf("onFailure $websiteTitle $it")
Timber.wtf(it)
geRemoteTimetableData(websiteTitle, false)
}
}
Expand All @@ -86,7 +84,6 @@ class TimetablesDetailViewModel(
}.onFailure {
Timber.wtf("onFailure $websiteTitle $it")
Timber.wtf(it)
//timetableData = null
fullScreenLoading = false
pullToRefreshLoading = false
}
Expand Down
Loading