Soumen pal
09/11/2025, 12:22 PMTaha
09/11/2025, 2:16 PMJanne Mareike Koschinski
09/11/2025, 3:03 PMAdam Hill
09/11/2025, 9:46 PMcompose.resources {
publicResClass = true
generateResClass = always
}
IntelliJ Project Explorer shows styled icons for all of them except files. Custom fonts went smoothly, I expected Files to be no different.
What am I missing?? Thanks.Thomas
09/12/2025, 3:32 AMMark
09/12/2025, 8:24 AMFlowRow
that shows a bunch of tags (Chips). I was expecting this to be typically less than a hundred items, but I notice some users have over 500, and this causes major performance issues. How do you deal with `FlowRow`s with too many items?Jonathan
09/12/2025, 12:56 PMNavHost
in a Compose Multiplatform app? My concern is the Home screen (startDestination) may be visible until the preferences are read (using DataStore) and itās determined the app should navigate to the Login route. In Android, this we straightforward to achieve by holding the splash screen until weāve loaded initial state. Iām struggling to find an effective way of achieving this that works for both Android and iOS. Not sure if this is the best channel for this question. If not, please point out the best one for this question.Michael Paus
09/12/2025, 2:24 PMpointerInput
correctly in common code. I want to detect a right mouse click if the device is operated with a mouse. However, when I use the button property of the event, then I get a build time error for Android. Why? IntelliJ does not complain when I use this in common code.
if (event.button?.isSecondary ?: false) {...}
On Android:
Unresolved reference 'isSecondary'.
Unresolved reference 'button'.
The documentation says āSpecifies the pointer button state of which was changed. It has value only when eventās type is PointerEventType.Press or PointerEventType.Release and when button is applicable (only for Mouse and Stylus events).ā This tells me that button
will just be null
in case it is not applicable.
I tried this with Compose 1.9.0-rc02 and Kotlin 2.2.20 on a Mac.Joe
09/12/2025, 9:03 PMorg.jetbrains.compose.ui.tooling.preview.Preview
and the androidx.compose.ui.tooling.preview.Preview
annotations when I work on the multiplatform composables and want to have previews for them?min
09/13/2025, 9:55 AM@Composable
functions schedule changes to the slot table via a Composer
2. The Composer
records the scheduled changes in a list and hands it over to an Applier
3. The Applier
executes the scheduled changes and alters the slot table and the actual node tree
Edit: If the Composer
knows that weāre already in the middle of inserting
new nodes, it directly alters the slot table? What does the Applier
do in that case? Wait for that to be done so it can start altering the actual node tree?Nathan Fallet
09/14/2025, 12:39 AMmin
09/14/2025, 5:59 AMApplier
only work either bottom up or top down but never both?Didier Villevalois
09/14/2025, 1:35 PMModalWideNavigationRail
in place of a ModalNavigationDrawer
. However, I fail to align my TopAppBar
navigation icon, to the one of the ModalWideNavigationRail
. The latter takes a nullable header
, but despite I pass null
it allocates some space for it (see attached video). If I try to put something in the header, then I get big padding above my header content.
However, when you look at the pictures of the M3 Expressive update for NavigationRail, there isn't such a padding above the header.
Does anyone have a hint on what I am doing wrong? Or is this a bug?ghosalmartin
09/15/2025, 6:58 AMHorizontalViewPager
on the last page of the VerticalPager
doesnāt scroll and if theres anyway to fix it please? It works on all the other pages
@Preview
@Composable
fun broken() {
val metrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(LocalContext.current)
val metricsHeight = (metrics.bounds.height() / LocalDensity.current.density)
val minHeight = (metricsHeight * .8f).dp
val items = listOf(1,2,3)
val pager = rememberPagerState { items.size }
VerticalPager(state = pager, modifier = Modifier.fillMaxSize(), pageSize = PageSize.Fixed(minHeight)) { index ->
Column(modifier = Modifier) {
Text("vertical $index")
val horizontalPagerState = rememberPagerState { items.size }
HorizontalPager(horizontalPagerState, modifier = Modifier.fillMaxSize()) {
Text("index $it", modifier = Modifier.fillMaxSize())
}
}
}
}
min
09/15/2025, 12:01 PMComposition
if necessary? Or is CompositionImpl
the only class that matters?min
09/15/2025, 12:13 PMprivate fun ensureCompositionCreated() {
if (composition == null) {
try {
creatingComposition = true
composition = setContent(resolveParentCompositionContext()) {
Content()
}
} finally {
creatingComposition = false
}
}
}
Whatās going on in this method from the AbstractComposeView
class?
private var creatingComposition = false
private fun checkAddView() {
if (!creatingComposition) {
throw UnsupportedOperationException(
"Cannot add views to " +
"${javaClass.simpleName}; only Compose content is supported"
)
}
}
The class has these members also, and a bunch of methods (e.g. addView
) that guard their bodies with a call to checkAddView
at the start:
override fun addView(child: View?) {
checkAddView()
super.addView(child)
}
Does this mean thatā¦
composition = setContent(resolveParentCompositionContext()) {
Content()
}
ā¦there might be parallel threads that also have concurrent access to the receiver (AbstractComposeView
) and theyāre only allowed to call methods such as addView
while the assignment above is running? What happens if:
1. Thread A calls ensureCompositionCreated
on an AbstractComposeView
2. While the assignment is running, thread B also calls the same method on the same instance
3. One thread finishes first and sets creatingComposition = false
while the other is still running
4. Thread C calls addView
which in turn first calls checkAddView
on the same instance of AbstractComposeView
Wouldnāt that result in the creatingComposition
property incorrectly being set to false
even though thereās a creation process running (namely in the slower thread)? Why should the methods guarded by checkAddView
only be called a) concurrently b) while a composition is being created in parallel anyway?Carl Zeitler
09/15/2025, 2:42 PMonFirstVisible
modifier and hoping to get some input.
When displaying `Row`s with horizontalScroll
within a Column
with verticalScroll
, vertical scrolls are never considered for triggering the onFirstVisble
callbacks. Horizontal scrolling still invokes the callbacks when applicable. This only happens if a Row
is initially considered to be in the viewport (e.g. the Row
is the first item in the Column
), otherwise, both scrolling directions work properly with onFirstVisible
.
Unfortunately Iāve tried to isolate this behavior in a demo project but wasnāt able to. Therefore Iām asking if anyone has an idea of what the underlying issue could be.Jonathan
09/15/2025, 3:46 PMSavedStateHandle
in a Compose Multiplatform app? Iām currently trying to figure out away of saving a ārouteā instance inside of the SavedStateHandle
I pass to my tested ViewModel but Iām not finding an API to do so. Is this only something possible to achieve using mocking?Kacper
09/15/2025, 3:54 PMLazyColumn(
verticalArrangement = Arrangement.spacedBy(10.dp),
) {
item {
Spacer(modifier = Modifier.windowInsetsTopHeight(WindowInsets.statusBars))
}
// some content
item {
Spacer(modifier = Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars))
}
}
But this does not go well together. Now I will have additional spacings at the top and bottom even if insets are consumed by the parent (the lazy column will apply padding between items even if the item is empty).
And here is my question, do anyone know how to handle such a scenario? I just want the first and last item to ignore this additional spacing provided by the spacedBy.Mark
09/15/2025, 4:28 PMSharedFlow
(application level coroutine scope with replay = 1) in compose using collectAsStateWithLifecycle
(initialValue = null), I notice that on screen rotation the first value is null
, but shouldnāt it be sharedFlow.replayCache.firstOrNull()
? The reason I ask, is because scroll position is being lost on rotation, but when I use ``replayCache.firstOrNull()`` as the initialValue
everything works as expected.phteven
09/15/2025, 5:16 PMPaolo Pasianot
09/16/2025, 8:37 AMMark
09/16/2025, 12:01 PMMuthu
09/16/2025, 12:48 PMColton Idle
09/16/2025, 6:29 PMButton { Text(someText) }
Do I need to do anything in compose to make this accessible? Or by virtue of it being a button that contains a text, it should work correctly? I can't test with talkback at the moment, so I'm just trying to see if adding a contentDescription via semantics modifier is needed in this case?min
09/17/2025, 11:58 AMfun ComponentActivity.mySetContent(
parent: CompositionContext? = null,
content: @Composable () -> Unit,
) {
val existingView = this.window.decorView
.findViewById<ViewGroup>(android.R.id.content)
.getChildAt(0) as? ComposeView
val compositionDest = (existingView ?: ComposeView(this)).also { view ->
view.setParentCompositionContext(parent)
view.setContent(content)
}
if (existingView != compositionDest) {
this.setContentView(compositionDest, ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT
))
this.window.decorView.also { decorView ->
if (decorView.findViewTreeLifecycleOwner() == null) {
decorView.setViewTreeLifecycleOwner(this)
}
if (decorView.findViewTreeViewModelStoreOwner() == null) {
decorView.setViewTreeViewModelStoreOwner(this)
}
if (decorView.findViewTreeSavedStateRegistryOwner() == null) {
decorView.setViewTreeSavedStateRegistryOwner(this)
}
}
}
}
Iām reimplementing parts of Jetpack Compose to get a better idea of how it works. My understanding is that existingView
is only not null
if mySetContent
has already been called on the current ComponentActivity
object; that the ComposeView
created in the assignment to compositionDest
gets registered in the if
body via the call to this.setContentView
the first time the method is called; and that itās this ComposeView
object that every subsequent call to the method on the same instance gets access to via existingView
. Am I correct, and if so, there should be nothing wrong with swapping out ComposeView
for MyComposeView
(my implementation) here, right?Lukasz Kalnik
09/17/2025, 3:16 PMBottomSheetScaffold
with the following `scaffoldState`:
val scaffoldState = rememberBottomSheetScaffoldState(
bottomSheetState = rememberStandardBottomSheetState(
initialValue = Hidden,
skipHiddenState = false,
confirmValueChange = { newValue ->
println("new value: $newValue")
if (newValue == Hidden) viewModel.onCodeBottomSheetClosed()
true
}
)
)
However the behavior of the state in confirmValueChange
is quite weird (see š§µ).min
09/18/2025, 6:56 AMGlobalSnapshotManager
(in androidx.compose.ui.platform
) start a coroutine on AndroidUiDispatcher.Main
?ribesg
09/18/2025, 3:37 PMIf the latest Material3 features are needed, please include it this way:
implementation("org.jetbrains.compose.material3:material3:1.9.0-beta06")
I don't know what "the latest Material3 features" is supposed to mean, but all Material 3 Expressive APIs are internal in that versionSean Proctor
09/18/2025, 9:02 PMNavigationSuiteScaffoldLayout
for any complicated use case? The source teases a demo:
An usage example of using a custom modal wide rail can be found at androidx.compose.material3.demos.NavigationSuiteScaffoldCustomConfigDemo.
I'm guessing that got renamed to ...Sample and the modal nav rail was removed.