Marcin Środa
05/31/2021, 7:23 AMTolriq
05/31/2021, 7:28 AMtaponidhi
05/31/2021, 8:09 AMubu
05/31/2021, 9:34 AMiamthevoid
05/31/2021, 9:37 AMcurrentPage
and currentPageOffset
values. What is the best way in compose to blend colors one with another for current case? It is not an animation, colors must change on drag (recompose), so somehow i must change color based on currentPage
and currentPageOffset
. Would be the good solution is changing the alpha? Or i can somehow blend colors?Adrian Landborn
05/31/2021, 10:50 AMSpikey Sanju
05/31/2021, 11:21 AMTapGestures
I really see a performance issue
. Why is it happening? Is there any way optimise performance?
For ex - When I tap LazyColumn Item
it will goto details screen
. But now it takes 1s to navigate to details screen
. When remove those functions & use clickable to goto details screen it’s working fine!Se7eN
05/31/2021, 11:31 AMaspectRatio(1f)
but whatever height I use, the arc only fills half of it. Code in thread.Felipe Passos
05/31/2021, 11:36 AMiamthevoid
05/31/2021, 12:53 PMnavController.currentBackStackEntryFlow
and must to do it in CoroutineScope. I have few questions
1. Where can I read about relation of coroutines and composables
2. Where better to collect this flow? Looks like there are mechanisms in compose to handle coroutines, but i am not sure that good practice to do as i did.
3. Even if it is good practice - what is better to use as key for LaunchedEffect
? I select activity, but it seems meaninglessDaniele Segato
05/31/2021, 12:58 PMLayout
for the first time I've set myself to build a fairly straight forward widget, but with a small circular dependency
2 components (the name is to help imagining but they can be whatever):
• field
• button
the button
can decide its own width but must match field
height
the field
can decide its own height but must leave room for the button
in it's width (maxWidth - button.width
)
the idea is the component will show the field and the button side by side filling width and wrapping height using the field.
As far as I understood I can measure all components only once.
If I measure field
first I can adjust button
width accordingly but I cannot make its height match field
If I measure button
first I can know it's width but I cannot tell it to take as much height as the field
Can someone enlighten me on how to overcome a situation like this with Layout? thanksdimsuz
05/31/2021, 12:58 PM@Stable
imply @Immutable
or vice versa?
2. If I have a data class
which contains only vals (which are either other data classes or privitives or non-mutable collection types), does it mean that Compose compiler plugin will be able to infer `@Stable`/`@Immutable` automatically? I found an earlier thread that seemed to suggest that.
3. It would be great if both of these points were somehow covered in documentation (or did I miss that?)Bradleycorn
05/31/2021, 2:16 PMnglauber
05/31/2021, 2:32 PMval systemUiController = rememberSystemUiController()
val useDarkIcons = MaterialTheme.colors.isLight
SideEffect {
systemUiController.setStatusBarColor(
color = Color.Red,
darkIcons = useDarkIcons
)
}
MyComposable()
Rooparsh
05/31/2021, 2:54 PMTextField
API.
I noticed some issue in the one of the API approach. The cursor doesn't move forward as the value gets updated. Attaching a video as reference. Its the one which accepts TextFieldValue
Am I missing here something ??Shakil Karim
05/31/2021, 4:27 PMspierce7
05/31/2021, 6:30 PMColton Idle
05/31/2021, 7:04 PMremember
method appropriate to make sure the composable doesn't reload the video on every compostion?
2. LaunchedEffect (I haven't used it before) seems like an interesting use case to use to update the fact that the video url has changed. Maybe the fact that it's called "Effect" is throwing me off, but would there be any other way to do this?
3. How does one properly dispose of this video playback. Does the composable clean up the androidView inside of it when I don't show it on screen anymore?robnik
05/31/2021, 7:35 PMChris Fillmore
05/31/2021, 7:58 PMclass MyViewModel : ViewModel() {
val plugin: Plugin
...
}
interface Plugin {
@Composable
fun Content()
}
My use case is, in my app we can dynamically load plugins depending on user requirements. These plugins themselves have composable methods to draw UI, and their own ViewModels in turn.
Thanks for any help!dimsuz
05/31/2021, 8:03 PMComposeView
in an ordinary view hierarchy. See the snippet in the thread.Colton Idle
05/31/2021, 9:07 PMtylerwilson
05/31/2021, 10:40 PMnglauber
05/31/2021, 11:18 PMtad
06/01/2021, 12:12 AMms
06/01/2021, 5:05 AMHardeep Singh
06/01/2021, 6:24 AMNana Vong
06/01/2021, 6:36 AMdata class Question(var add: Boolean = true)
val testState = MutableLiveData<List<Question>>()
testState.value = listOf(Question(false))
val state = testState.observeAsState()
RedButton(
text = state.value?.get(0)?.add?.toString() ?: "?",
btnColor = Color.Red,
modifier = Modifier.clickable {
testState.value = testState.value.apply {
this?.get(0)?.add = true
}
})
aipok
06/01/2021, 7:24 AMMarcin Środa
06/01/2021, 8:17 AMMarcin Środa
06/01/2021, 8:17 AMcomposeTestRule.onNodeWithContentDescription(inputDescription).assertTextEquals("")
returns
java.lang.AssertionError: Failed to assert the following: (Text + EditableText = [])
Semantics of the node:
Node #130 at (l=0.0, t=273.0, r=1080.0, b=420.0)px
ContentDescription = '[message_input_text]'
ImeAction = 'Send'
EditableText = ''
TextSelectionRange = 'TextRange(0, 0)'
Focused = 'false'
Text = '[Type Message]'
Actions = [GetTextLayoutResult, SetText, SetSelection, OnClick, OnLongClick, PasteText]
MergeDescendants = 'true'
Has 1 child
Selector used: (ContentDescription = 'message_input_text' (ignoreCase: false))
composeTestRule.onNodeWithContentDescription(inputDescription, useUnmergedTree = true).assertTextEquals("")