Kazemihabib1996
04/06/2020, 3:17 PMSocheat KHAUV
04/07/2020, 8:56 AMJavier
04/08/2020, 10:15 AMsemoro
04/08/2020, 12:02 PM@Preview
in Android Studio 4.1 Canary 4
There is some freezes on typing, which is caused by @Preview
annotation discovery, I have thread dumps for it
Also, there is some memory leak happens, as after few hours of work AS consumes 4-5 Gb of RAM, can provide heap analysis dumpVinay Gaba
04/08/2020, 4:25 PMVinay Gaba
04/09/2020, 1:12 AMgolden image testing facilities
. I would love to know how you’ll are thinking about screenshot testing now? Moreover, what’s the long term vision for testing in Compose? Also, are there any testing frameworks/tools from the other declarative frameworks that you’ll are particularly excited about?
It’s also possible this question was already covered before. In that case would be very grateful if someone could point me to that thread 🙏🏼SrSouza
04/09/2020, 2:40 AMmolikto
04/09/2020, 6:15 AMBacho Kurtanidze
04/09/2020, 12:16 PMContextAmbient.current
wherever I want in my code?Nikit Bhandari
04/09/2020, 7:12 PMdrawImage(imageResource(R.drawable.baseline_menu_white_18dp)
, Offset(midX, midY), Paint().apply { color = Color(25, 138, 128) })
When I call the above drawImage
method of Canvas, my build fails with the following error Functions which invoke @Composable functions must be marked with the @Composable annotation
But Canvas already has the @Composable annotation, any clue what I might be missing here?
ThanksZach Klippenstein (he/him) [MOD]
04/10/2020, 4:38 PMSomeComposable(modifier = Modifier.withAmbients(FooAmbient provides foo)) { … }
carbaj0
04/10/2020, 6:52 PMsetContent {
val (mode, setMode) = state { lightColorPalette() }
MaterialTheme(mode) {
Button(onClick = { setMode(if (mode.isLight) darkColorPalette() else lightColorPalette()) }) {
Text(text = "button")
}
}
}
Zach Klippenstein (he/him) [MOD]
04/11/2020, 12:34 AMsemoro
04/11/2020, 4:22 AMstateFor
and provide some key?
https://gist.github.com/semoro/ea7c07cf3bcbd3bc4cbc4729b82b4140#file-composeremovalarea-kt-L64
Actually, if I don’t provide some kind of this id parameter, button click also hides subsequent list element, which is a bit counter-intuitive.
Is it due to that changes of input parameters in RemovalArea’s child doesn’t cause recompose in RemovalArea itself, and previously occupied slot for deleted element became used by next one, without reset of state?
Is there is some way to avoid passing id
parameter?Adam Bennett
04/11/2020, 9:11 AMCanvas
using Compose? I'm looking to do this
override fun onDraw(canvas: Canvas?) {
super.onDraw(canvas)
calculatePropagation()
canvas?.let { render() }
postInvalidateDelayed(20)
}
But I can't seem to find an equivalent for repeatedly drawing to Canvas. I've done a tonne of digging through docs and on here - can anyone chime in?codeslubber
04/11/2020, 2:55 PMdev05
but under 8 it says failed to cast to MutableState:
*val* position = _state_ *{* _SliderPosition_(valueRange = sliderRange, initial = range.*first*.toFloat(), steps = 9) }
Kazemihabib1996
04/11/2020, 10:22 PM//Unresolved: ...
for example:
https://developer.android.com/reference/kotlin/androidx/ui/layout/LayoutSize
https://developer.android.com/reference/kotlin/androidx/compose/Pivotalamar_1995
04/12/2020, 1:42 AMTextField(
value = value,
onValueChange = onValueChange,
textStyle = editorStyle,
imeAction = ImeAction.Search,
keyboardType = keyboardType,
onImeActionPerformed = {
onSearchClick()
},
onFocus = {
println("focus called >>>>")
onSearchChanged(R.drawable.ic_baseline_arrow_back_24)
},
onBlur = {
println("blur called >>>>")
}
)
In above example blur called >>>>
is never printed.
Cursor is also not removed once it gain focus.
In dev-05( I think) it was working fine but not now.molikto
04/12/2020, 3:01 AMMutableState
outside of any composition, then this state is shared among multiple compositions? Will this leak any Composition/Context?Sri
04/12/2020, 4:37 PM@Composable
fun ButtonRow() {
Row {
val padding = Modifier.padding(12.dp)
Button(onClick = { }, modifier = padding) {
Text(text = "Ok")
}
Button(onClick = { }, modifier = padding) {
Text(text = "Subtract")
}
}
}
I am not able to center the Ok
text. Any help as to what I have to do to center it would be much appreciated.Kazemihabib1996
04/12/2020, 8:07 PMColor(0.0, 1.0, 0.0, 1.0, sRGB IEC61966-2.1)
to Color(1.0, 0.0, 0.0, 1.0, sRGB IEC61966-2.1)
@Composable
fun SingleValueAnimationDemo() {
val enabled = state { true }
Clickable({ enabled.value = !enabled.value }) {
val color = animate(if (enabled.value) Color.Green else Color.Red)
Box(Modifier.fillMaxSize(), backgroundColor = color)
}
}
Timo Drick
04/12/2020, 8:38 PMzak.taccardi
04/13/2020, 3:38 PM@Compose
world?Kazemihabib1996
04/13/2020, 5:02 PMKstabks
04/13/2020, 9:32 PMromainguy
04/14/2020, 5:55 AMKazemihabib1996
04/14/2020, 6:46 PMTabRow
inside VerticalScroller
crashes:
@Composable
fun TextTabs() {
var state by state { 0 }
val titles = listOf("TAB 1", "TAB 2", "TAB 3 WITH LOTS OF TEXT")
VerticalScroller {
Column {
TabRow(items = titles, selectedIndex = state) { index, text ->
Tab(text = { Text(text) }, selected = state == index, onSelected = { state = index })
}
Text(
modifier = Modifier.gravity(ColumnAlign.Center),
text = "Text tab ${state + 1} selected",
style = MaterialTheme.typography.body1
)
}
}
}
I just added VerticalScroller to
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/androidx-master-dev/ui/ui-material/samples/src/main/java/androidx/ui/material/samples/TabSamples.kt?autodive=0%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fianrumac
04/15/2020, 12:19 PMFoso
04/15/2020, 5:55 PMZach Klippenstein (he/him) [MOD]
04/15/2020, 8:17 PMState
, instead of just returning the value directly? Is it cheaper to “observe” a single model instance’s property multiple times than run this subscription/observation wiring multiple times?Andrey Kulikov
04/15/2020, 9:01 PMstate { }
, and similarly to it property delegation using by
makes it easy to simplify the basic usagesZach Klippenstein (he/him) [MOD]
04/15/2020, 10:37 PM