Rafs
01/03/2021, 11:42 AMCanvas
composable since there is no drawText
method. I have a requirement where I rotate the canvas and draw some lines with some text. I'm currently using drawContext.canvas.nativeCanvas.drawText
dimsuz
01/03/2021, 12:38 PMcomposeOptions
+ useIR = true
+ buildFeatures.compose = true
for each module or is it enough to specify all (or some) of these in the :app
module?
Setup instructions have only app module example (which unfortunately is true for many examples in docs: they assume a single app-module structure)Ayomide
01/03/2021, 2:58 PMSharedFlow
- I'm trying to figure out how to keep the web socket session (DefaultClientWebSocketSession
) running in the background so that I can collect the SharedFlow
messages and display them on screen as they stream in into a LazyColumn
or similar. I'm not sure how to fit this into Compose's state tools.
I tried using coroutineScope.launch{}
with rememberCoroutineScope()
but it seems like the web socket session would stop as soon as the coroutine scope ended.nglauber
01/03/2021, 8:14 PMLazyColumn
scroll position? In my sample, the first tab is a list.Vivek Sharma
01/04/2021, 6:17 AMdrawLine(
brush = SolidColor(Color.Red),
cap = StrokeCap.Round,
strokeWidth = 8.dp.toPx(),
start = middle,
end = Offset(midX, 16.dp.toPx())
)
Can anyone help me with this, when we draw a line using the above code, end
mean we ending that line at some position,
But with Offset(X,Y)
Y having 16.dp.toPx()
what does this mean?
I am increasing Y offset like 100.dp.toPx()
, line is becoming short in length Why?Jeff
01/04/2021, 8:05 AMGeert
01/04/2021, 9:02 AMAndré Thiele
01/04/2021, 10:04 AMMarko Novakovic
01/04/2021, 11:24 AMModifier
as a first parameter of a composable
. Did it change? Am seeing more and more samples, including Google ones, with Modifier
as the last parameter. Where it "should be" put?nicola.de.fiorenze
01/04/2021, 1:38 PMeditText.setSelection(position)
with the classic android view system.
thanksColton Idle
01/04/2021, 5:41 PMLauren Yew
01/04/2021, 9:03 PMmutableState
and State
: in the "Using State in Jetpack Compose" codelab, it says:
State<T> is intended to be used by Compose.
Application state that's used outside of Compose should not use State<T> to hold the state.
Why is this? Is State
being discarded along with the compose-recompose lifecycle or something?
Does anyone know the lifecycle of State
?Lauren Yew
01/04/2021, 9:49 PMTextField
sometimes opening keyboard properly when I click on the textfield, and sometimes not. Is anyone else seeing these issues? Working thru "Using State in Jetpack Compose" codelabMehmet Peker
01/05/2021, 1:52 AMKshitij Patil
01/05/2021, 10:43 AMfillMaxHeight
and one of the item's height is conditionally dependent upon some state, don't we have any other option than writing a custom layout to get wrapContent behaviour? Currently fillMaxHeight
makes the row fill the entire height but what I meant was the maximum height of an item in given rowKshitij Patil
01/05/2021, 11:18 AMLazyColumn
?rsktash
01/05/2021, 12:51 PMKshitij Patil
01/05/2021, 1:04 PMKshitij Patil
01/05/2021, 1:48 PMScrollableColumn
vs LazyColumn
? Is it equivalent to RecyclerView vs ListView?Vitor Prado
01/05/2021, 3:58 PMNat Strangerweather
01/05/2021, 4:50 PMMarcello Galhardo
01/05/2021, 5:23 PMStateFlow
or LiveData
that is "collected as state" and receive new values directly (e.g., onChanged = { vm.stateFlow.value = it }
or creating a "local remembered state" and passing it back only when necessary (e.g., onClick = { vm.onClick(myRememberedState.value) }
). 🤔buszi0809
01/05/2021, 6:15 PMJavier
01/05/2021, 6:23 PMandroid:configChanges
with some flags (orientation
for example) will be the standard in the future?
I think that Compose can manage better the responsibility.
In case of an affirmative reply, extending the ViewModel should be useless?Lilly
01/05/2021, 6:36 PM@Preview
@Composable
fun TestPreview() {
Text("Hello World!")
}
I'm on alpha09 with latest IDE.Leandro Garcia
01/05/2021, 6:45 PMLazyColumn
and LazyColumnFor
when should one or the other be used? I see that LazyColumnFor
calls LazyColumn
internallyColton Idle
01/05/2021, 7:32 PMMatt Lien
01/05/2021, 8:03 PMColton Idle
01/05/2021, 9:26 PMLilly
01/06/2021, 3:06 AM@Preview
is not able to preview drawables. Can s.o. confirm that? Is this a known bug?
ListItem(
text = { Text("") },
icon = { Icon(vectorResource(id = iconRes)) }, // can not be previewed
)
While iconRes
is a png file.
EDIT: Sorry, wasn't aware of imageResource
. Now it works.Lilly
01/06/2021, 3:06 AM@Preview
is not able to preview drawables. Can s.o. confirm that? Is this a known bug?
ListItem(
text = { Text("") },
icon = { Icon(vectorResource(id = iconRes)) }, // can not be previewed
)
While iconRes
is a png file.
EDIT: Sorry, wasn't aware of imageResource
. Now it works.Nader Jawad
01/06/2021, 7:36 AMpainterResource
API that opaquely loads pngs or vector assets and returns a Painter that can be used as input to the Icon composable