The `drawLayer` modifier is real nice! <https://gi...
# compose
z
❤️ 28
😮 21
9
👍 11
r
Can you say more about this comment:
“// Animating the alpha just look janky.”
z
Sorry, it works fine – I meant it just looks weird to have the alpha bouncing around. It’s not obvious that it’s animating, it just looks strange.
r
Ok thanks! Just wanted to make sure it wasn’t an issue on our side 🙂
z
Nope, alpha works as expected. However, there is an issue with x/y rotation when the scale is too big: when the rotation is around 90º, lots of weird clipping or something starts to happen. This looks weird for other reasons (views are basically unreadable), so I don’t know why an app would try to do this in production, but I can file a bug.
r
I am not surprised by this
These are fake 3D rotations and I can definitely think of a few ways that they would catastrophically break down at such acute angles in Skia
Please file a bug if you want but it’s not Compose specific
I can forward this to one of the graphics engineers
What version of Android is this on?
z
Android 10, March 5 2020 security patch, build QQ2A.200305.002
I'm not worried about it, doesn't seem like it would be an issue in real apps
r
Thanks
Yeah but still awkward
k
@Zach Klippenstein (he/him) [MOD] This is a pretty interesting demonstration of the
drawLayer
modifier. Thanks for this dude
👍 2
l
I totally see that being used in an app onboarding
a
since someone asked on twitter, no, this doesn't support transforming the input events - yet. 🙂 We were just discussing unifying transformations for layout/drawing/input earlier this week
👍 1
might end up being a slightly different modifier API that uses
drawLayer
as an implementation detail to get the visual part.
not sure yet
r
We filed a bug internally, the Skia team will investigate. Thanks for the repro case!
🙏 1
v
Zack, what kind of compose do you use? I cannot access default buttons as Add and others (dev-07) - only Favourite, Menu and Close available.
z
You need the material icons dependency as well:
androidx.ui:ui-material-icons-extended:${versions.compose}
@romainguy I just noticed that the shadow under the FAB doesn’t rotate around the Z axis with the rest of the views – it’s always “below” the button relative to the screen, at every angle. I’m guessing that’s because the shadow has its own layer?
r
yep
👍 1
z
Really obvious here
😮 1
v
Thanks, Zach
z
It's a bit of a contrived use case, but this is the demo I wanted to write when I first saw this composable 😂 made me think of the new layout inspector's 3D view https://kotlinlang.slack.com/archives/C0BJ0GTE2/p1585585754055600
r
The bug is confirmed fixed in Android R btw
🙏 1
b
can’t we have skia updatable via project mainline to avoid issues like this in the future?
r
It’s in the works
😍 4
b
Android S.. S of Skia.. lol, can’t wait! haha (sidenote: unfortunately my device won’t receive it, but hopefully until then Samsung will be giving more than 2 major updates)