Se7eN
11/20/2020, 11:17 AM@Stable
? Also, is it fine to make a modifier composable?Arun
11/20/2020, 11:22 AM@get:Rule
val composeTestRule =
AndroidComposeTestRule<MyActivity>(disableTransitions = true)
However, there’s no such parameter disableTransitions
. Is there any alternative way to disable animations and transitions while testing?Odin
11/20/2020, 12:14 PMe: java.lang.IllegalArgumentException: Unbound type parameters are forbidden: [Unbound private symbol org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl@69e10c4e, Unbound private symbol org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl@782ec94]
Ive read that it might be because of synthetic imports, but I cannot find any. Are there any other reason for this to occur?Rafs
11/20/2020, 12:17 PMdrawText
method in the DrawScope
Arun
11/20/2020, 12:23 PMNode #1 at (0.0, 66.0, 1080.0, 2009.0)px
|-Node #2 at (970.0, 110.0, 1036.0, 176.0)px
| OnClick = 'AccessibilityAction(label=null, action=Function0<java.lang.Boolean>)'
| MergeDescendants = 'true'
|-Node #3 at (0.0, 220.0, 1080.0, 2009.0)px
VerticalAccessibilityScrollState = 'AccessibilityScrollState(value=0.0, maxValue=0.0, reverseScrolling=false)'
ScrollBy = 'AccessibilityAction(label=null, action=Function2<java.lang.Float, java.lang.Float, java.lang.Boolean>)'
|-Node #4 at (44.0, 1089.0, 368.0, 1152.0)px, Tag: 'Section Header'
| Text = 'Section Header'
| GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
|-Node #7 at (44.0, 1196.0, 1036.0, 1423.0)px
| OnClick = 'AccessibilityAction(label=null, action=Function0<java.lang.Boolean>)'
| MergeDescendants = 'true'
| |-Node #8 at (88.0, 1229.0, 201.0, 1283.0)px, Tag: 'Title 1'
| | Text = 'Title 1'
| | GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
| |-Node #11 at (88.0, 1289.0, 794.0, 1379.0)px
| Text = 'Get the list of all the assigned tasks in serial order to complete'
| GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
|-Node #13 at (44.0, 1467.0, 1036.0, 1694.0)px
| OnClick = 'AccessibilityAction(label=null, action=Function0<java.lang.Boolean>)'
| MergeDescendants = 'true'
| |-Node #14 at (88.0, 1500.0, 201.0, 1554.0)px, Tag: 'Title 2'
| | Text = 'Title 2'
| | GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
| |-Node #17 at (88.0, 1560.0, 794.0, 1650.0)px
| Text = 'Perform all IoT actions and QC of all devices in the car'
| GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
|-Node #19 at (44.0, 1738.0, 1036.0, 1965.0)px
OnClick = 'AccessibilityAction(label=null, action=Function0<java.lang.Boolean>)'
MergeDescendants = 'true'
|-Node #20 at (88.0, 1771.0, 201.0, 1825.0)px, Tag: 'Title 3'
| Text = 'Title 3'
| GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
|-Node #23 at (88.0, 1831.0, 794.0, 1921.0)px
Text = 'Get the list of all the assigned tasks in serial order to complete'
GetTextLayoutResult = 'AccessibilityAction(label=null, action=(kotlin.collections.MutableList<androidx.compose.ui.text.TextLayoutResult>) -> kotlin.Boolean)'
The following test fails even though, you can clearly see in the tree that there are Nodes with Tags Section Header
and `Title 1`:
fun apiSuccess_showFeatures(): Unit = testCoroutineDispatcher.runBlockingTest {
composeTestRule.onRoot(useUnmergedTree = true).printToLog("TAG")
composeTestRule.onNodeWithTag("Section Header").assertIsDisplayed()
composeTestRule.onNodeWithTag("Title 1").assertIsDisplayed()
}
If I just test with the following single assertion, the test passes.
composeTestRule.onNodeWithTag("Section Header").assertIsDisplayed()
Any idea on what am I doing wrong?grandstaish
11/20/2020, 1:12 PMDefaultSwitchColors
(and similar colour interface implementations in the Material library) don’t use `data class`es and instead manually implement equals/hashcode?Anita
11/20/2020, 1:21 PMzoha131
11/20/2020, 2:19 PMTextField
?jim
11/20/2020, 5:35 PMNat Strangerweather
11/20/2020, 5:39 PMLuke
11/20/2020, 6:43 PMNavHost
? I want to add a fragment that I don’t own, from a library, as a destination. I tried:
NavHost(
navController = navController,
startDestination = route,
) {
composable(...) { ... )
fragment<LibraryFragment>(id)
}
But when I run, the activity crashes with Could not find Navigator with name "fragment". You must call NavController.addNavigator() for each navigation type.
If it’s not possible, is there another way to add a fragment to composition?Joseph D
11/20/2020, 10:25 PMexample▾
chatVm.getMessages()
?Denis
11/21/2020, 1:32 AMnavigation-compose
?
I want to make a list with multiple selection like in the GMail app. On back button press navigation-compose goes to the previous destination, but I want it to unselect all selected items. I did it with a boolean optional argument "items?selected={selected}"
, but I think it really smells. I suppose it's better to override the default behavior of back button, but I just can't find a solution. Or is there a better approach to the problem?Grigorii Yurkov
11/21/2020, 10:45 AMLaunchedEffect
if args
are changed
LaunchedEffect(args) {
suspendFunction(args)
}
Or it cancels automatically (I have not checked)zoha131
11/21/2020, 4:59 PMFocusRequester#freeFocus()
but it does not work for me.Bradleycorn
11/21/2020, 5:14 PMnavigation
component, is there a way to know the size of the backstack?
I’m setting up a TopAppBar
(via Scaffold
) and I’d like to show a back arrow if the current destination is not at the top of the back stack. I’m essentially trying to do something like navController.backstack.size > 0
but the backstatck
property access is restricted to the navigation lib itself. How can I determine the backstack size to know if I should show a back icon or not?alilosoft
11/21/2020, 6:05 PMGabriel
11/21/2020, 8:23 PMSuperblazer
11/22/2020, 1:51 AMzoha131
11/22/2020, 8:59 AMadajustpan
and adjustresize
but those are not working for me.Nat Strangerweather
11/22/2020, 10:10 AMval max = 202.dp
val min = 24.dp
val offsetPosition = remember { mutableStateOf(0f) }
Archie
11/22/2020, 3:06 PMQuentin Dommerc
11/22/2020, 3:07 PMMehdi Haghgoo
11/22/2020, 7:44 PMBradleycorn
11/23/2020, 1:33 AMMaterialTheme
to set a color (like a background color) on an “old style” view that is used via the AndroidView
composable?kluck
11/23/2020, 9:23 AMbuildFeatures {
compose = true
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
}
composeOptions {
kotlinCompilerVersion = versions.kotlin
kotlinCompilerExtensionVersion = versions.compose
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation(libs.compose.ui)
implementation(libs.compose.tooling)
implementation(libs.compose.foundation)
implementation(libs.compose.material)
}
When I try to build, I get an error :
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
Caused by: java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/tasks/KotlinCompile
louiscad
11/23/2020, 11:43 AMhttps://youtu.be/cSv8HxfLCbs?t=2062▾
tylerwilson
11/23/2020, 4:46 PMe: java.lang.NoSuchMethodError: 'org.jetbrains.kotlin.descriptors.Visibility org.jetbrains.kotlin.descriptors.ClassDescriptor.getVisibility()'
at androidx.compose.compiler.plugins.kotlin.lower.ClassStabilityFieldSerializationPlugin.afterClass(ClassStabilityFieldSerializationPlugin.kt:57)
at org.jetbrains.kotlin.serialization.DescriptorSerializer.classProto(DescriptorSerializer.kt:156)
at org.jetbrains.kotlin.incremental.JavaClassesTrackerImplKt.convertToProto(JavaClassesTrackerImpl.kt:88)
...
anybody else see this? any known fix, or should i stay on 1.4.10 for now?grandstaish
11/23/2020, 4:52 PMsealed class
hierarchy as @Immutable
, should i annotate the base class, the subclasses, or both?Kirill Grouchnikov
11/23/2020, 5:10 PMRadioGroup
or ToggleGroup
class in the core Compose for this? Same for segmented toggle buttons (like controlling text alignment, e.g.)Kirill Grouchnikov
11/23/2020, 5:10 PMRadioGroup
or ToggleGroup
class in the core Compose for this? Same for segmented toggle buttons (like controlling text alignment, e.g.)jim
11/23/2020, 5:16 PMKirill Grouchnikov
11/23/2020, 5:19 PMjim
11/23/2020, 5:24 PMtext = internationalizeFromEnglish(text)
, assuming you use the english variant as your internationalization keys (which has benefits, like being able to search the codebase for english strings to locate the relevant pieces of code based on a UI). Of course, this has drawbacks too, so it is perfectly understandable if you wanted to replace 118 with an integer or enum, but either way, a complex data structure isn't necessary unless you want one.Kirill Grouchnikov
11/23/2020, 5:37 PMjim
11/23/2020, 5:38 PM