Freedom
06/07/2025, 3:54 AMgalex
06/07/2025, 1:23 PMHarold Scissors
06/09/2025, 5:57 PMDialogScenes
in Nav3 to dim the content behind them? Calling it doesn't seem to do it, and an older implementation using (LocalView.current.parent as? DialogWindowProvider)?.window?.setDimAmount(.32f)
doesn't seem to work anymoreNurlibay
06/10/2025, 12:04 PMval uiState by viewModel.loginUiState.collectAsStateWithLifecycle()
var isOfferChecked by rememberSaveable { mutableStateOf(false) }
val isLoginButtonEnabled by remember {
derivedStateOf {
uiState.login.isNotBlank() && uiState.password.isNotBlank() && isOfferChecked
}
}
private var _loginUiState = MutableStateFlow(LoginUIState())
val loginUiState: StateFlow<LoginUIState> = _loginUiState.asStateFlow()
Hello!
Is something wrong with using derivedStateOf here?
Kevin Worth
06/10/2025, 12:36 PManimateFloatAsState
, AnimatedVisibility
, AnimatedContent
. I need to display ComposableA
when objectA
is not null, ComposableB
when objectB
is not null, or neither when they are both null. If it were always just one or the other (if there were no "neither case") then AnimatedContent
would suit me just fine. The problem is, when I transition from either one of them visible to neither one visible, the visible one just disappears suddenly. But I need it to fade out. Is there a good, clean way to do this and I'm just not seeing it, or should I file a feature request?Sargun Vohra
06/11/2025, 9:05 PMsuspend fun
in a LaunchedEffect
, and the client is backed by Ktor (via Ktorfit) and the OkHttp engine. As far as I can tell, these network calls shouldn't be blocking the main thread, but still the UI stutters when I scroll (triggering network calls as list items load).
The problem only happens on Android. The demo on iOS, Desktop (JVM), macOS (native), JS, and WASM builds all have a totally smooth UI.
I've tried:
• Explicitly setting <http://Dispatchers.IO|Dispatchers.IO>
◦ No change. Verified in Ktor source that the default is IO, so that makes sense.
• Switching to the CIO
engine on the JVM target.
◦ No change, still stutters when loading data on Android
• Running as profileable to debug further
◦ The problem disappears when I run a profileable build; scrolling is smooth while data loads, so it's unclear to me how to debug further or gather data on the issue
You can repro by cloning https://github.com/PokeAPI/pokekotlin and running the demo app (the :demo-app
module)
(x-post from #C0B8M7BUY)jean
06/12/2025, 7:06 AMdylan
06/12/2025, 2:37 PMThomas
06/13/2025, 9:16 PMZahn
06/19/2025, 8:06 PMflingBehaviour
supposed to work in a focused-driven navigation ?
It seems it doesn’t and I assume it is only working with gestures, right ?
Is there a way to change the default spring animation when scrolling through a LazyColumn
using interaction sources / D_PAD ?Colton Idle
06/20/2025, 1:33 PMMutableState<Bar>
as arguments instead of just Bar
. I want to point to some documentation about this but I'm coming up empty. I could have sworn the android docs had something very clearly about this sort of pattern. Does anyone remember by chance?Colton Idle
06/20/2025, 3:33 PMCấn Văn Nghị
06/22/2025, 9:39 AMUnable to start activity ComponentInfo{com.example.myapp/.MainActivity}:
java.lang.RuntimeException: Window couldn't find content container view
This doesn't happen every time — it's random and seems to occur more frequently on cold starts or after backgrounding the app.
Has anyone faced this issue before or know what might be causing it?
Any help or guidance would be greatly appreciated.
Thanks in advance!Sargun Vohra
06/24/2025, 7:08 AMcom.android.kotlin.multiplatform.library
plugin and you’re experiencing a MissingResourceException
because your library includes resources, you need to explicitly opt in to resources with an experimental flag:
kotlin {
androidLibrary {
experimentalProperties["android.experimental.kmp.enableAndroidResources"] = true
}
}
The migration guide doesn’t call this out but I found it mentioned in a YouTrack issue. Sharing here for viz.Sandeep Dhami
06/24/2025, 10:24 AMNavHost
with an independent NavController
.
For example, our main NavHost
might show RootScreenA
, which then composes a FeatureANavHost
(with featureANavController
) internally. Similarly, RootScreenB
might compose FeatureBNavHost
(with featureBNavController
).
The challenge we're facing is how to achieve coordination or navigation between these separate NavController
instances. For instance, if an action occurs deep within `FeatureANavHost`'s stack, we might need to navigate to a specific screen within `FeatureBNavHost`'s stack.
Currently, we're exploring methods like using a global event bus/coordinator (e.g., SharedFlow
or a simple object with callbacks accessible at a higher level) to "signal" navigation events from one independent `NavController`'s domain to another. The coordinator then explicitly calls navigate()
on the target NavController
.
While this works, it feels like we're working against the core principles of Jetpack Compose Navigation, which typically advocates for a single NavController
for the entire app, leveraging nested navigation { ... }
blocks.
My questions are:
1. Is this pattern of having multiple independent `NavHost`es (each with its own NavController
) considered an anti-pattern for a single-activity app, even for modularity in a deep tree structure?
2. If it is, what are the recommended patterns or best practices to achieve similar modularity and hierarchical organization (especially with deep nesting like 10+ levels) while sticking to a single NavController
?
3. If this multi-NavController
approach can be viable under specific circumstances, what are the most robust ways to handle cross-controller "navigation" or coordination, and what are the major pitfalls to watch out for beyond basic isolation?
Any insights, examples, or pointers to relevant architectural discussions would be greatly appreciated! Thanks in advance!Nurlibay
06/24/2025, 10:48 AM@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DigitalLoanApplicationResultBottomSheet(
item: TotalStateEntity,
employeeCode: String,
onEmployeeCodeChanged: (String) -> Unit,
sheetState: SheetState,
isSheetOpen: (Boolean)-> Unit,
) {
ModalBottomSheet(
modifier = Modifier.fillMaxSize().statusBarsPadding(),
sheetState = sheetState,
containerColor = colorResource(R.color.colorSurfaceBackgroundPrimary),
contentColor = colorResource(R.color.colorSurfaceBackgroundPrimary),
onDismissRequest = {
isSheetOpen.invoke(false)
},
// contentWindowInsets = BottomSheetDefaults.windowInsets,
dragHandle = {
Box(
modifier = Modifier
.padding(8.dp)
.width(36.dp)
.height(5.dp)
.clip(RoundedCornerShape(50))
.background(colorResource(R.color.colorLabelsVibrantTertiary))
)
}
) {
.....
Column(
modifier = Modifier
.padding(top = 72.dp, start = 16.dp, end = 16.dp, bottom = 16.dp)
.windowInsetsPadding(WindowInsets.statusBars)
.imePadding(),
// enable scrolling, // Add Status Bar Padding,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top
) {
Box(
modifier = Modifier
.size(80.dp)
.background(
color = bgColor,
shape = RoundedCornerShape(50)
),
contentAlignment = Alignment.Center
) {
Image(
painter = painterResource(icon),
contentDescription = "Checkmark",
colorFilter = ColorFilter.tint(tintColor),
modifier = Modifier.size(40.dp),
)
}
Spacer(modifier = Modifier.height(24.dp))
val formattedText = item.text?.replace("\\n", "\n").orEmpty()
Text(
text = formattedText,
textAlign = TextAlign.Center,
style = TextStyle(
color = colorResource(R.color.colorTextPrimary),
fontSize = 20.sp,
fontWeight = FontWeight.W600
)
)
Spacer(modifier = Modifier.height(8.dp))
if(item.subText.isNullOrEmpty().not()) {
Text(
text = item.subText.orEmpty(),
style = TextStyle(
color = colorResource(R.color.colorTextSecondary),
fontSize = 13.sp,
fontWeight = FontWeight.W400
),
textAlign = TextAlign.Center
)
Spacer(modifier = Modifier.height(8.dp))
}
Text(
text = item.date.orEmpty(),
style = TextStyle(
color = colorResource(R.color.colorTextSecondary),
fontSize = 13.sp,
fontWeight = FontWeight.W400
),
textAlign = TextAlign.Center
)
Spacer(modifier = Modifier.weight(1f))
Column(
modifier = Modifier
.border(
width = 1.dp,
color = colorResource(R.color.colorSurfaceBorder),
shape = RoundedCornerShape(16.dp)
).padding(20.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = stringResource(R.string.lbl_if_you_applied_branch_with_help_of_employee_specify_their_code),
style = TextStyle(
color = colorResource(R.color.colorTextSecondary),
fontSize = 14.sp,
fontWeight = FontWeight.W400
),
textAlign = TextAlign.Center,
lineHeight = 20.sp
)
Spacer(modifier = Modifier.height(16.dp))
AppInputCompose(
value = employeeCode,
onValueChange = {
onEmployeeCodeChanged.invoke(it)
},
imeAction = ImeAction.Done,
label = stringResource(R.string.lbl_employee_code),
)
}
FilledButtonCompose(
modifier = Modifier.padding(vertical = 16.dp),
text = stringResource(R.string.title_close),
onClick = {
isSheetOpen.invoke(false)
}
)
}
}
}
Nurlibay
06/24/2025, 10:52 AMdave08
06/24/2025, 1:32 PMdave08
06/24/2025, 1:46 PMs3rius
06/25/2025, 8:30 AMAjay Chandran
06/25/2025, 10:29 AMRihards
06/29/2025, 2:02 PMTextField
within the bottom sheet from BottomSheetScaffold
, but I’m not able to use .imePadding()
to display the TextField
on top of the keyboard. Any suggestion? I tried to place the .imePadding()
to various modifiers, but no success.Rafi Panoyan
07/03/2025, 9:05 AMtestTag
to every component of the app without having to add it manually, be it with a ksp plugin or else.
I think this should not be possible due to the nature of Compose being declarative in code, but I might not be aware of a hidden API that would allow thatAlmeric
07/04/2025, 6:11 AMListDetailPaneScaffold
and SecondaryTabRow
on the latest Material3/Material3Adaptive libraries?
I’m getting a crash when navigating from the listPane
to the detailPane
.MarkRS
07/04/2025, 8:25 AMAjay Chandran
07/05/2025, 12:23 PMAnum Amin
07/07/2025, 8:22 PMshadow
modifier doesn't render properly if parent composable is a Surface
? If it is under Box
, it is rendered correctly. Couldn't find in the documentation. In the attached screenshots, notice the sharp edge if parent is Surface
. TIA
Snippet in 🧵Tapan Desai
07/08/2025, 4:17 PMNavigation3
library right now.
I have come across a scenario where we need to scope a ViewModel
to the previous screen
Current we are using compose-destinations which is built on top of Jetpack Navigation library
We scope a ViewModel
to the previous destination like this. Can this is be achieved in Navigation3
?
@Composable
@Destination(style = DestinationStyleBottomSheet::class)
fun ColumnScope.SalesStaffBottomSheet(
navigator: DestinationsNavigator,
navBackStackEntry: NavBackStackEntry,
navController: NavController,
result: ResultBackNavigator<SalesStaffDetails>,
) {
val backStack = remember(navBackStackEntry) {
navController.getBackStackEntry(AnalyticsMobileDestination.route)
}
val viewModel = hiltViewModel<AnalyticsViewModel>(backStack)
val uiState by viewModel.analyticsUiState.collectAsStateWithLifecycle()
SalesStaffDialogBottomSheet(
uiState = uiState,
onSalesStaffClick = { result.navigateBack(it) },
onCloseClick = { navigator.popBackStack() }
)
}
Slack ConversationBradleycorn
07/10/2025, 5:16 PMUsewith anrememberInfiniteTransition
infiniteRepeatable
to continuously repeat your animation. ChangeanimationSpec
to specify how it should go back and forth.RepeatModes
UseBut I can't find ato repeat a set number of times.finiteRepeatable
finiteRepeatable
api anywhere. Am I missing something?Rob
07/15/2025, 6:12 PM