Implement a Beautiful Gallery Transition with Horizontal Pager with Jetpack Compose - Easy Tutorial
ฝัง
- เผยแพร่เมื่อ 13 ม.ค. 2025
- 🏆 My Online Courses
stevdza-san.com
☕ Buy me a Coffee
ko-fi.com/stev...
📝Medium
/ stevdza-san
💻 Github
github.com/ste...
📸 Instagram
/ stevdza_san
💎 Become a Premium Member
/ @stevdzasan
Build a Gallery Component with an amazing transition animation along with a horizontal pager, with Jetpack Compose.
When in transition, corners of image does not remain curves. How can we solve this?
In the graphicsLayer modifier, add those two lines:
shape = RoundedCornerShape(16.dp)
clip = true
Why are the rounded corners not applied anymore during transition without this change? The modifier is set, what happens in the background?
@@xTheScribio Remember that in compose the order is important.
In this case you can send the clip at the end so that it is preserved.
modifier = Modifier
.fillMaxSize()
.padding(16.dp)
.graphicsLayer {
scaleX = imageSize
scaleY = imageSize
}
.clip(RoundedCornerShape(16.dp)),
can we see the previous or next image below the current image? Like in stacked card view?
Updating colorMatrix on coil-compose:2.6.0 does not work due to disabled recomposition
Do you know how to solve that issue?
@@krzysztofgowacz796 Didn't solve the issue. I was using the old version. Maybe there is already a solution on the Internet.
This is perfect! Can you make so that edges of next and previous are shown too? So you can see that there is next item, and there is previous
I've answered that comment here already.
@@StevdzaSan do not think it is the same thing, the other comment is about corner radius, this is referring to a little offset so the next and previous item in the pager would be partly visible.
@@alirahimpour89 Oh yeah, my bad. You have a parameter called "pageSpacing". You can pass a negative value, but I'm not sure how would that look like. You can try it out. :)
Can you explain how to use Material3 modal bottom sheet?
I'll think about that. Thanks for the suggestion.
Could you please make a video for us on how to create a page curl effect using Jetpack Compose, adding your own touch to it? It would be very nice and kind of you, and we would be very grateful.
You are the best 💪
as of compose foundation 1.5.0 page count is now declared inside the pager state and not the pager itself
its so cool i like your video
Hey san, Can we add data to that mutable list! I want to load more objects into the pager once it comes to the last index. Is that possible?
Also using lerp would make it feel more natural for image size
great video, but i think you forgotton to add github link for the code
how about auto transition of the image. I dont need to click it. I have no idea how to impelent that
how to make image fill max width and scrollabe on Landscape mode?
This is great. Can you provide the source code?
can you please tell about pic image from gallery and crop the image by jetpack compose
I'm also experiencing scrolling, can you share the source code to confirm?
Why doing this „bigger“ calculation for the pageOffset? Reading out the currentPageOffsetFraction would have been enough, or not? You only check it the value is not 0.0 and this we get also with the currentPageOffsetFraction.
Can i put text on image?
You're free to use any composable component along.