loloof64
07/21/2022, 5:17 PMCan Korkmaz
07/21/2022, 5:42 PMCannot create Typeface from ResourceFont(resId=2131296260, weight=FontWeight(weight=400), style=Normal)
David Corrado
07/21/2022, 7:35 PMNgọc Nguyên Nguyễn
07/22/2022, 2:48 AMVivek Modi
07/22/2022, 10:03 AMnavigateToResultScreen
is calling twice with screen flicks. Is it correct behaviour?
MainActivity.kt
when (val state = viewModel.stateResultFetchState.collectAsState().value) {
is ResultFetchState.OnSuccess -> {
LaunchedEffect(Unit) {
navigateToResultScreen(state.nearestResult)
}
}
is ResultFetchState.IsLoading -> {
LoadingFunction()
}
is ResultFetchState.OnError,
is ResultFetchState.OnEmpty -> {
ActivityContent(viewModel)
}
}
Akhil Jain
07/22/2022, 10:52 AMAudioWidgetItem
and I am passing a lambda onPostClicked
in it. Now when I am invoking this lambda on line 149
then this function is getting recomposed again and again on some action (even though hash code of this lambda is coming same as printed in line 144
).
But when I am commenting out this lambda invocation at line 149
then unnecessary recomposition of this function doesn't happen.
I am not able to understand the reason behind this behaviourBradleycorn
07/22/2022, 1:34 PMandroid.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.android.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}
Anyone run into this before? I’ve found a few things that mention adding the activity to the manifest in your androidTest folder, but I don’t have a manifest there, and have never needed one before. Not sure why I would need one now …Colton Idle
07/22/2022, 1:45 PMAnimatedVisibility(visibleState = (viewModel.screenState.loadingInProgress))
deviant
07/22/2022, 2:17 PMnglauber
07/22/2022, 2:31 PMLandry Norris
07/22/2022, 4:46 PMPointerInputChange#isConsumed
, I get an error This API is experimental and is likely to change in the future.
I don’t see any errors in the IDE, and opting in to ExperimentalComposeApi and ExperimentalMaterialApi don’t fix it. Looking at the source, I also don’t see it marked as experimental.David Corrado
07/22/2022, 4:58 PMzt
07/22/2022, 5:05 PMPaul Woitaschek
07/22/2022, 8:27 PMspierce7
07/23/2022, 5:43 AMScreen
s use classes, but I haven’t found any way to use the benefits of classes in my Composable functions.
Everything is scoped to the Compose lifecycle, i.e. my ScreenModel’s via rememberScreenModel
, and so instead of being able to share it as a member variable between all my Composable functions, I’m stuck passing it from Compose function to Compose function. It’s very cumbersome.
Is there something that I’m overlooking? Is there a better way to do this?Slackbot
07/23/2022, 12:53 PMSaiedmomen
07/23/2022, 1:17 PM@Stable
inference in multiplatform modules with android soucesets? There are no composables in the module.
I have tried adding the following to the android
block but doesn't seem to work
and metrics report isn't generated for the module
I am following Chris Banes blogpost on the issue and reports are generated for the main app module
android {
...
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.get()
}
}
Jasmin Fajkic
07/23/2022, 1:23 PMloloof64
07/23/2022, 3:43 PMandroidx.lifecycle:lifecycle-viewmodel-compose:2.5.0
to build.gradle file of the app module. Why ?
(I keep getting the error "Expression 'viewModel' of type 'StockfishLibraryViewModel' cannot be invoked as a function. The function 'invoke()' is not found")spierce7
07/24/2022, 5:05 AMjasu
07/24/2022, 9:27 AMArkadii Ivanov
07/24/2022, 12:29 PMLookaheadLayout
, and it crashes if there is LazyColumn
inside `LookaheadLayout`'s content:
java.lang.IllegalStateException: subcompose can only be used inside the measure or layout blocks
Is it not supported yet, or am I doing something wrong?Jasmin Fajkic
07/24/2022, 7:35 PMjames
07/24/2022, 11:17 PMval navigateToDetailScreen: (Int) -> Unit
declared
b. navigateToDetailScreen
is passed into the nav graph builder and passed into every composable()
route that might need to call it
c. navigateToDetailScreen
is then passed through as many Composables as required until it is passed into to the Composable that will generate the action from an onClick event
2. Passing the instance of NavController
from the same top level (where the NavHost is declared) down to each screen and into the ViewModel which will then keep a reference to it
3. Wrapping NavController
in a custom navigator class and injecting that custom class into ViewModels where it’s required
if I think about how best to build something flexible, testable, and not too “polluting” of my codebase, #3 seems like the best option, but when I look at examples of what others have built that method seems like the least common, so I find I am second guessing myself and wondering if there’s a problem with that option which I’m not seeingharry248
07/25/2022, 5:28 AMClément Cardonnel
07/25/2022, 8:15 AMvide
07/25/2022, 8:58 AMChristoph Wiesner
07/25/2022, 1:18 PMLazyVerticalGrid
and that composable should match the grids height.
seems like that’s not possible bc. the Grid is a SubComposeLayout and therefore i cannot use height(IntrinsicSize.Min)
(i do not want / cannot inline the content into the grid)
is there another approach?Colton Idle
07/25/2022, 2:57 PMfun MyScreen(
) {
val context = LocalContext.current
Box(Modifier.fillMaxSize().background(Color.Green), contentAlignment = Center) {
Button(onClick = { Toast.makeText(context, "screen in background clicked", Toast.LENGTH_SHORT).show() }) {
Text(text = "Bottom")
}
}
Box(Modifier.fillMaxSize().background(Color.Red)) {}
}
Vivek Modi
07/25/2022, 3:00 PMxml
for ui components which has id/tag
that is used for automated ui testing
. Now we switch to jetpack compose. So how can I provide this id/tag
for automation
now?Vivek Modi
07/25/2022, 3:00 PMxml
for ui components which has id/tag
that is used for automated ui testing
. Now we switch to jetpack compose. So how can I provide this id/tag
for automation
now?Landry Norris
07/25/2022, 3:08 PMModifier.testTag("an id")
Vivek Modi
07/25/2022, 3:10 PM