annsofi
10/25/2024, 11:42 AMAseem Sharma
11/07/2024, 1:15 PMNizam
11/21/2024, 2:32 PMIlias Goormans
11/27/2024, 9:34 AMBekzod
12/05/2024, 8:09 AM@Destination
@Composable
fun AgentOrderWarehouseProductsScreen(
warehouseId: Long,
navController: DestinationsNavigator,
editOrderConfirmationResultRecipient: ResultRecipient<AgentEditOrderConfirmationDialogDestination, DismissEditConfirmationEnum>,
filterResultRecipient: ResultRecipient<AgentOrderProductsFilterBottomSheetDestination, FilterWarehouseProduct>,
viewModel: AgentOrderWarehouseProductsViewModel = get()
) {
and
import kotlinx.serialization.Serializable
@Serializable
data class FilterWarehouseProduct(
val productInStock: ProductInStock,
val productSelectionType: ProductSelectionType
)
destinations:
private fun ManualComposableCallsBuilder.agentOrderWarehouseProductsScreenDestination() {
composable(AgentOrderWarehouseProductsScreenDestination) {
AgentOrderWarehouseProductsScreen(
navController = destinationsNavigator,
warehouseId = navArgs.warehouseId,
filterResultRecipient = resultRecipient<AgentOrderProductsFilterBottomSheetDestination, FilterWarehouseProduct>(),
editOrderConfirmationResultRecipient = resultRecipient<AgentEditOrderConfirmationDialogDestination, DismissEditConfirmationEnum>()
)
}
}
error: ksp] com.ramcosta.composedestinations.codegen.commons.IllegalDestinationsSetup: Composable AgentOrderWarehouseProductsScreen, FilterWarehouseProduct: Result types must be one of: String, Long, Boolean, Float, Int, Parcelable, Serializable.
@Destination(style = DestinationStyleBottomSheet::class)
@Composable
fun AgentOrderProductsFilterBottomSheet(
productInStock: ProductInStock,
productSelectionType: ProductSelectionType,
resultBackNavigator: ResultBackNavigator<FilterWarehouseProduct>
) {
and
private fun ManualComposableCallsBuilder.agentFilterOrderBottomSheetDestination() {
bottomSheetComposable(AgentOrderProductsFilterBottomSheetDestination) {
AgentOrderProductsFilterBottomSheet(
productInStock = navArgs.productInStock,
productSelectionType = navArgs.productSelectionType,
resultBackNavigator = resultBackNavigator()
)
}
}
initially it was not data class but pair, tried to change it to data class but not fixed. it stopped working after I updated to the latest version. raamcostaNavitagion = "1.11.7" it used to be "1.8.33-beta".
it is interesting to note that when I tried with @Parcelize it worked but here I cannot do it since FilterWarehouseProduct is in commonMain. I need that data class in Swift UiSuhaib Kazi
12/09/2024, 12:39 PMnavArgs = ProfileScreenNavArgs::class
It says
[ksp] com.ramcosta.composedestinations.codegen.commons.IllegalDestinationsSetup: Cannot detect default value for navigation argument 'serverID' because we don't have access to source code. Nav argument classes from other modules with default values are not supported!
David
12/12/2024, 8:59 AMSuhaib Kazi
12/13/2024, 10:27 AMSuhaib Kazi
12/18/2024, 12:49 PMPatrick Cavanagh
12/18/2024, 5:50 PMSuhaib Kazi
12/20/2024, 12:45 PMMini
01/09/2025, 2:20 PMfun SomeDestination(val arg1: Long, val someString: String) {}
class MyViewModel(savedStateHandle: SavedStateHandle) : ViewModel() {
val someString = savedStateHandle.get(SomeDestinationArgumentKeys.SomeString)
}
Mini
01/28/2025, 11:21 AMRyan
01/28/2025, 6:45 PMBottomBarItem.entries.forEach { destination ->
val isCurrentDestOnBackStack by
navController.isRouteOnBackStackAsState(destination.direction)
NavigationBarItem(
selected = isCurrentDestOnBackStack,
onClick = {
if (isCurrentDestOnBackStack) {
// When we click again on a bottom bar item and it was already selected
// we want to pop the back stack until the initial destination of this bottom bar
// item
navigator.popBackStack(destination.direction, false)
return@NavigationBarItem
}
navigator.navigate(destination.direction) {
// Pop up to the root of the graph to
// avoid building up a large stack of destinations
// on the back stack as users select items
popUpTo(NavGraphs.root) { saveState = true }
// Avoid multiple copies of the same destination when
// reselecting the same item
launchSingleTop = true
// Restore state when reselecting a previously selected item
restoreState = true
}
},
// ...
)
}
}
Is there a way within a subclassed DestinationStyle.Animated()
to see whether navigation is occurring from this bottom bar or is there a way through nested navigation graphs to achieve this (seems heavy handed for animation)?Ilia Kazantsev
03/23/2025, 6:20 PMAlex Char
03/24/2025, 12:54 PMRobert C
04/02/2025, 9:27 AMdependenciesContainerBuilder = {
navGraph(SomeNavGraph){
dependency(SomeObject())
}
and then im trying to inject this by
ScreenA(
...
someObject: SomeObject
)
ScreenB(
...
someObject: SomeObject
)
where SomeNavGraph contains 2 destinations, im using Koin in the project
object is getting injected but these are 2 different objects in both of the screens
both screens belong to nested SomeNavGraph
is this possible for non viewmodel objects?Thomas Richtsfeld
04/15/2025, 5:14 PMDestinationsNavigator
to navigate to "ScreenC". Doing this inside the composable of "ScreenB". Something like navController.navigate(DeviceRegistrationScreenDestination)
. The bottom bar is still shown on "ScreenC" which is obvious to me.
Now the question is: Is it possible to launch a screen on top of the bottom bar without a callback to the first NavHost that contains the bottom bar?Suhaib Kazi
04/23/2025, 10:19 AMSuhaib Kazi
04/23/2025, 1:25 PMyurihondo
04/24/2025, 1:46 AMTomáš Procházka
04/30/2025, 11:20 PMDestinationsNavHost
?
I get deep link intent from the Activity and pass it to my compose app.
But DestinationsNavHost
has just start
parameter, there is no way how to put there deep link Uri.
I found that this works:
val navController = rememberNavController()
val destinationNavigator = navController.rememberDestinationsNavigator()
DestinationsNavHost(
...
)
navController.handleDeepLink(deepLinkIntent)
But the issue is that it always display the start
screen first and then replace it by the screen resolved from deeplink, which doesn't looks good.
Maybe I can put some empty screen as defaultStartDestionation
but this also looks like hack to me.Ryan
05/05/2025, 3:57 PMFatal Exception: java.lang.NullPointerException:
at androidx.compose.material.navigation.BottomSheetNavigator$sheetContent$1$2$1.invoke(BottomSheetNavigator.java:182)
at androidx.compose.material.navigation.BottomSheetNavigator$sheetContent$1$2$1.invoke(BottomSheetNavigator.java:181)
at androidx.activity.compose.BackHandlerKt$BackHandler$backCallback$1$1.handleOnBackPressed(BackHandler.kt:89)
at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:260)
at androidx.activity.ComponentActivity.onBackPressed(ComponentActivity.kt:588)
at android.app.Activity.onKeyUp(Activity.java:4157)
at android.view.KeyEvent.dispatch(KeyEvent.java:3522)
where sheet content is null. My destinations that use the bottom sheet are styled as such:
@Destination<RootGraph>(style = DestinationStyleBottomSheet::class)
Would you prefer if I open a github ticket to discuss this? I don't have much information since I can't reproduce it locally, but it's a fairly frequent crash in production.
composeDestination = "2.1.0-beta12"
I'll upgrade to 2.2.0 in the meanwhile and monitor as well.Ilia Kazantsev
05/06/2025, 8:30 AMimport kotlinx.serialization.Serializable
@Serializable
data class ModificationError(
val myBoolean: Boolean,
)
The issue is I am getting the error
[ksp] com.ramcosta.composedestinations.codegen.commons.IllegalDestinationsSetup: Composable 'AddEditFavoritesScreen', ResultBackNavigatorModificationError: Result types must be of a valid navigation argument type, but was 'ModificationError'
Library version is 2.1.0-beta16
Kotlin serialization 1.8.0
I am using multimodule architecture and the screen destination and ModificationError are in different modules.
I would be so grateful to hear any suggestions what may be the problem here. 🥲 Am i missing something?Cash Hsiao
05/19/2025, 6:40 AMResultBackNavigator.navigateBack()
use NavController.navigateUp()
internally
(In kiwi it doesn't contain navigateUp, so we can popBackStack manually)
Is there any way to solve this problem?slack
06/06/2025, 4:48 PMPranathi
06/13/2025, 12:57 PMMagnus Gudmandsen
06/23/2025, 7:42 AMResultRecipient
not sending any event to onNavResult
(from a ResultBackNavigator
in a bottom sheet destination, specifically).
I can't identify exactly when this started to happen, but before digging too much (we already tried downgrading compose destinations, without luck), I just wanted to start out with checking if it's a known bug?
Essentially, doing resultNavigator.navigateBack(foo)
MOSTLY doesn't return a result. It's not a 100% fail rate, but almost.brandonmcansh
07/03/2025, 9:37 PMRohit Jakhar
07/19/2025, 8:16 PM@Destination<RootGraph>(style = SlideInScreenAnimation::class)
@Composable
fun ProfileScreen(
vm: ProfileVM = hiltViewModel()
)
but after using koin it will be:
@Destination<RootGraph>(style = SlideInScreenAnimation::class)
@Composable
fun ProfileScreen(
vm: ProfileVM = koinViewModel()
)
so Profile viewmodel instance will be auto destroy if i navigate to other screen.
It work with hiltViewModel but i am not sure about koinViewModel
anyone can tell me?
Thanks