LEVELU
04/16/2024, 3:30 PMfun navigateToTab(tab: BottomBarItem) {
selectedTab = tab
tabBarNavController.navigate(route = "$root/${tab.route}") {
// Avoid multiple copies of the same destination when
// reselecting the same item
launchSingleTop = true
// Restore state when reselecting a previously selected item
restoreState = tab.route != "my-tab-to-reload"
// Pop up to the start destination of the graph to
// avoid building up a large stack of destinations
// on the back stack as users select items
popUpTo(tabBarNavController.graph.findStartDestination().id) {
saveState = true
}
}
}
But it didn't work
Can you help me to do this ?colintheshots
04/16/2024, 3:54 PMjava.lang.NoSuchMethodError: No static method MarkdownEditor$default(...
relevant build.gradle lines in both library and example app modules:
android {
// ...
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions.jvmTarget = "1.8"
buildFeatures.compose = true
composeOptions.kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
youssef
04/16/2024, 5:44 PMChris Johnson
04/16/2024, 9:44 PMSunil Kumar
04/17/2024, 4:57 AMmohamed rejeb
04/17/2024, 8:20 AMeygraber
04/17/2024, 2:39 PMNacho Ruiz Martin
04/17/2024, 2:47 PMcomposeTestRule
from the Main Activity.
I’m using Nav Component in the app and the navigation is working when launched as an app, but it doesn’t when launched as an Android test.
I was so surprised that I created a really simple project reproducing the error and it’s indeed happening there.
Here’s the project: https://github.com/iruizmar/nav-component-ui-test-reproducer
As you can see, the MainActivity
just waits for 1s and then navigates to “screen”. The test is waiting forever. If the app is launched normally, the navigation happens but it doesn’t happen in the test.
What am I missing?
Thanks!Nthily
04/17/2024, 5:22 PMCLOVIS
04/17/2024, 5:45 PM@Composable
fun foo(): Int {
return Random.nextInt()
}
Now, my understanding is that this function won't ever rerun, since it has no inputs and reads no state. If so, great, that's what I want.
Now, I want two calls of this function in different call stacks to return the same value:
@Composable
fun bar() {
println(foo())
if (…) {
println(foo())
}
}
should both return the same value.
How can I achieve something like this?Colton Idle
04/17/2024, 6:24 PMJohn O'Reilly
04/17/2024, 9:53 PMRaju Kulo
04/18/2024, 6:24 AMaishwaryabhishek3
04/18/2024, 6:29 AMmohamed rejeb
04/18/2024, 6:34 AMaishwaryabhishek3
04/18/2024, 7:17 AMval commonMain by getting {
dependencies {
api(compose.runtime)
api(compose.foundation)
api(compose.material)
}
}
where is this compose.runtime defined ? I cannot find it in toml file . Is it provided via the jetbrains compose gradle plugin ? If so then how does it know which version of compose to pick up.Daria Voronina [JB]
04/18/2024, 1:10 PMViewModel
.
For the complete list of changes, refer to What’s new in Compose Multiplatform 1.6.10-beta01 or the release notes on GitHub.Vaibhav Jaiswal
04/18/2024, 1:50 PMPagingData<T>
?Binod Basnet
04/18/2024, 2:55 PMkaps
04/18/2024, 4:40 PMTravis Griggs
04/18/2024, 10:43 PMslide[In|Out][Vertically|Horizontally]
set to -it / 2
? I would have expected just '-it
. Why only slide half way?Omico
04/19/2024, 3:06 AMexpect fun Modifier.onTriggerContextMenu(onTrigger: () -> Unit): Modifier
// mobile
actual fun Modifier.onTriggerContextMenu(onTrigger: () -> Unit): Modifier =
this then pointerInput(Unit) {
detectTapGestures(
onLongPress = { onTrigger() }
)
}
// desktop
@OptIn(ExperimentalFoundationApi::class)
actual fun Modifier.onTriggerContextMenu(onTrigger: () -> Unit): Modifier =
this then pointerInput(Unit) {
detectTapGestures(
matcher = PointerMatcher.mouse(PointerButton.Secondary),
onPress = { onTrigger() },
)
}
Shane Schaefer
04/19/2024, 6:26 AMmohamed rejeb
04/19/2024, 8:09 AMThomas Hormes
04/19/2024, 11:55 AMGuilherme Delgado
04/19/2024, 4:34 PMUtkarsh Tiwari
04/19/2024, 7:22 PMmattinger
04/19/2024, 7:50 PMJan Skrasek
04/19/2024, 9:34 PM@Composable () -> Unit
blocks and I need to animate (ideally using AnimatedContent or something similarly trivial) from one to another based on the fact it the first lambda "renders" anything.
I hoped that new GraphicsLayer
api would help here, yet I cannot come up with anything reasonable.
The only implementation I was able to do was one based on subcomposition (in thread) or using nullable blocks, but that's the thing I want to rewrite.
Any other ideas?