This message was deleted.
s
This message was deleted.
j
this is base API data. and has an id for each user
v
you mean navigation between different screens?
j
not specifically, cause those user on the chatlist its just getting those data from API, the goal is if I click one of that user it must route to it's specific screen for chat. it's like inheriting the chat screen or conversation screen
j
I dont follow, what do you want to do exactly? When click on a specific conversion, what do you want to happen technically? If I have to guess what youre after, you fetch the conversion id + user id and send that to the screen for chat, send those ids to server and fetch the chat for that and present it on the screen. Is it something like that you mean?
1
j
yes sir sorry for my english
j
No worries, which navigation framework are you using btw, if any?
j
I used NavController for this and DaggerHilt
j
Right so youre using androidx compose navigation or?
j
these are my dependency
Copy code
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")

//FIREBASE-ANALYTICS-MESSAGING
// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.2.2"))
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics:18.6.1")
//messaging
implementation("com.google.firebase:firebase-messaging-ktx:23.2.1")
//notification-permission
implementation("com.google.accompanist:accompanist-permissions:0.31.1-alpha")

//MATERIAL3
implementation("androidx.compose.material3:material3:1.1.2")
implementation("androidx.compose.material3:material3-window-size-class:1.1.2")
implementation("androidx.compose.material3:material3-adaptive:1.0.0-alpha04")
implementation("androidx.compose.material3:material3-adaptive-navigation-suite:1.0.0-alpha02")

//NAVIGATION
implementation("androidx.navigation:navigation-compose:2.7.6")

//DAGGER-HILT
implementation ("com.google.dagger:hilt-android:2.48.1")
kapt("com.google.dagger:hilt-compiler:2.48.1")
kapt ("androidx.hilt:hilt-compiler:1.0.0")
implementation ("androidx.hilt:hilt-navigation-compose:1.0.0")

//RETROFIT
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")

//PREFERENCES
implementation("de.devland.esperandro:esperandro-api:2.2.0")
implementation("de.devland.esperandro:esperandro-gson-addon:2.2.0")
kapt("de.devland.esperandro:esperandro:2.2.0")

//OKHTTP
implementation("com.squareup.okhttp3:okhttp:4.9.3")
implementation("com.squareup.okhttp3:logging-interceptor:4.8.1")

//SOCKET.IO
implementation("io.socket:socket.io-client:2.0.0")
j
Imagine you have something like this:
Copy code
composable("chat/{userId}/{conversationId}") { backStackEntry ->
    Profile(navController, backStackEntry.arguments?.getString("userId"))
}
You can do:
Copy code
navController.navigate("profile/user1234/conversaion1234")
If having details more whats supported and not and how, also see: https://developer.android.com/jetpack/compose/navigation
If want to use hilt graph viewmodel scoped in navigations, its : https://developer.android.com/jetpack/compose/libraries#hilt-navigation