Lilly
03/09/2021, 2:34 AMAnimatedVisibility
composable but the animation inspector does not appear. Is that intended behavior? What are the requirements so that animation inspector is available?chris
03/09/2021, 3:07 AMLaw Gimenez
03/09/2021, 3:53 AMDeepak Gahlot
03/09/2021, 4:35 AMShivam Sethi
03/09/2021, 4:38 AMJason Ankers
03/09/2021, 4:46 AMLazyColumn
out of a nested scroll chain? The docs only explain how to opt in/configure the existing chain: https://developer.android.com/jetpack/compose/gestures#auto-nested-scrollingAlan Yin
03/09/2021, 6:46 AMRajashekar
03/09/2021, 6:57 AMval points: List<Offset> = listOf(
Offset(200f, 200f), Offset(400f, 200f),
Offset(200f, 200f), Offset(200f, 400f),
Offset(400f, 200f), Offset(400f, 400f),
Offset(200f, 400f), Offset(400f, 400f),
Offset(200f, 400f), Offset(200f, 600f),
Offset(200f, 600f), Offset(400f, 600f),
Offset(400f, 400f), Offset(400f, 600f),
)
Two offsets completes a line, this whole points makes -> 8
How I want is, lines must be drawn between those points at certain duration.
Canvas(
modifier = Modifier.fillMaxSize()
) {
drawPoints(
points = points,
pointMode = PointMode.Lines,
color = Color.Gray,
strokeWidth = 16f,
cap = StrokeCap.Round,
pathEffect = PathEffect.dashPathEffect(floatArrayOf(8f, 16f))
)
}
Shivam Sethi
03/09/2021, 7:22 AMAhmet Delibaş
03/09/2021, 8:10 AMUtkarsh Tiwari
03/09/2021, 9:15 AMModalBottomSheetLayout
and it seems like the scrim to dismiss the modal is being triggered when tapping an area within the sheet. Is this expected behaviour?
Here is my codeloloof64
03/09/2021, 9:32 AMandroidx.compose.ui.tooling.preview.PreviewActivity is not an Activity subclass or alias
though I managed to launch it yesterday.
This is my preview :
@Preview
@Composable
fun ChessBoardPreview() {
ChessBoard(size = 60.dp)
}
where ChessBoard is a Composable component that I'm writing
Android Studio Arctic Fox | 2020.3.1 Canary 8
Build #AI-203.7148.57.2031.7165533, built on February 23, 2021
Runtime version: 11.0.8+0-b944-P17168821 amd64
VM: OpenJDK 64-Bit Server VM by N/A
Linux 5.10.19-200.fc33.x86_64
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.intellij.plugins.markdown
Current Desktop: GNOME
yousefa2
03/09/2021, 9:56 AMAndroidView
. The View
used for AndroidView
is provided by a generic provider that takes in some input and outputs a View
type.
@Composable
fun BasketItemsList(
modifier: Modifier,
basketItems: List<ProductState>,
provider: ProductCard,
interactionListener: ProductCardView.InteractionListener
) {
LazyColumn(modifier = modifier) {
items(basketItems) { product ->
AndroidView(factory = { provider.view }) {
Timber.tag("BasketItemsList").v(product.toString())
provider.setup(product, interactionListener)
}
}
}
}
With this sample, any interaction with the ProductCard view’s doesn’t update the screen. Logging shows that the state gets updated but the catch is that it’s only updated once per button. For example, I have a favourites button. Clicking it once pushes a state update only once, any subsequent clicks doesn’t propagate. Also the card itself doesn’t updates. It’s as if it was never clicked.
Now changing the block of AndroidView.update
to cast from the ProductCard
interface to a concrete view type works as expected. All clicks propagate correctly and the card view gets updated to reflect the state.
@Composable
fun BasketItemsList(
modifier: Modifier,
basketItems: List<ProductState>,
provider: ProductCard,
interactionListener: ProductCardView.InteractionListener
) {
LazyColumn(modifier = modifier) {
items(basketItems) { product ->
AndroidView(factory = { provider.view }) {
Timber.tag("BasketItemsList").v(product.toString())
// provider.setup(product, interactionListener)
(it as ProductCardView).setup(product, interactionListener)
}
}
}
}
What am I missing here? why does using ProductCard
type not working while casting the view to it’s type is working?Deepak Gahlot
03/09/2021, 9:57 AMKarthick
03/09/2021, 10:13 AMloloof64
03/09/2021, 11:02 AMFilip Wiesner
03/09/2021, 11:19 AMval ballSpacing = remember { Offset(0f, 48f * density) }
var ball1 by remember { mutableStateOf(Offset.Zero) }
val ball2 by animateOffsetAsState(ball1 + ballSpacing)
val ball3 by animateOffsetAsState(ball2 + ballSpacing)
I move ball1 with gestures and I want the other balls to follow. I must move the ball really slowly to trigger the animations but when it starts working it's smooth so long as I don't stop moving them (GIF in thread)alexsullivan114
03/09/2021, 12:40 PMtranslationY
value for both the scrolling and the tick. Right now, when I toggle between scrolling mode or ticking animation mode the composable kind of swaps between the two different translationY values. I'd like to remember the old translationY and increment from there but I'm not sure how to make that happen...I've added the relevant code to this thread.Lilly
03/09/2021, 1:37 PMScaffold(
topBar = {
Column {
TopAppBar(
...
)
AnimatedVisibility(
visible = (connectionState == BluetoothConnectionState.Disconnected),
enter = slideInVertically(),
exit = slideOutVertically(targetOffsetY = { value -> -value }),
content = { ConnectionStatusBannerComponent(onAction = { }) }
)
}
},
)
Does someone have an idea?Se7eN
03/09/2021, 2:06 PMcutoutShape
for BottomNavigation
?Bradleycorn
03/09/2021, 2:40 PMandroid:configChanges="orientation|screenSize"
When I run my app, everything works as expected ... when I rotate the device the activity does not get re-created, and my main setContent
composable gets recomposed. But ... if I rotate the device "upside down", the composable does NOT get recomposed? What am I missing?
To be clear .. the device (a phone) starts in a "normal" portrait orientation ... i rotate it 90 degrees to a landscape orientatin and my root composable gets recomposed. Great. I rotate 90 degrees again to portrait (but now upside down, with the earpiece at the bottom and the mic at the top), and my root composable does NOT get recomposed and the display is now "sideways"?Orhan Tozan
03/09/2021, 2:47 PMColumn(modifier = Modifier.fillMaxHeight().background(Color.Blue)) {
Column(modifier = Modififer.fillMaxHeight().background(Color.Red)) {
Text("Hi")
}
}
Stylianos Gakis
03/09/2021, 3:10 PMupdateTransition
with keyframes
or something similar to have more control over one value? To exmplain:
I want an animation that will fluidly animate rotation simply done with transition.animateFloat.
But I want the color to be White from 0-50% of the animation and then immediately change to Red at 50% and stay like that for 50-100% of the animation. Any ideas?martinsumera
03/09/2021, 3:30 PMval backCallback = remember { /* ... */ }
SideEffect {
backCallback.isEnabled = enabled
}
and
val backCallback = remember { /* ... */ }
backCallback.isEnabled = enabled
Joseph D
03/09/2021, 3:58 PMColton Idle
03/09/2021, 4:20 PMRed
composable and Blue
composable that I want to overlap by 35%. The three ways I've thought about doing this is:
1. Have these two in a Box
, but apply a padding to the top of blue composable that I calculate somehow to be 35% of bottom of red
2. Have these two in a Column, and someone apply a negative padding to a value that I calculate somehow to be 35% of the bottom of red
3. Write a custom layout? (seems scary even though this is supposed to be a lot easier in compose)
Anyone have other ideas or an idea of how I would go about this? Right now I just hard coded the padding and it works, but the height of the red square will change and so the hard coded padding idea will fall apart.
Edit: Wish there was a way to shrink the preview size in slack. SorryRabindra Khadka
03/09/2021, 5:53 PMColton Idle
03/09/2021, 7:10 PMBradleycorn
03/09/2021, 7:32 PMBryan Herbst
03/09/2021, 7:33 PMBryan Herbst
03/09/2021, 7:33 PMtad
03/09/2021, 7:54 PMNader Jawad
03/09/2021, 7:54 PMtad
03/09/2021, 7:56 PMsrc/main/icons
and get generated KotlinBryan Herbst
03/09/2021, 7:58 PM