Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert animation resources to use Compose #5247

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

cooltey
Copy link
Collaborator

@cooltey cooltey commented Jan 21, 2025

What does this do?

This PR combines the pulse and tab_list_zoom_enter resources into one ScaleAnimation. The thumbnail_item related animations can be converted by the time when we convert the GalleryThumbnailScrollView view to Compose.

Phabricator:
https://phabricator.wikimedia.org/T381833

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is more efficient if we can create this as a extension function of a Modifier instead of a composable function. so that we can apply the animation to any component easily, something like this.

fun Modifier.pulse(
    fromScale: Float = 1f,
    toScale: Float = 2.5f,
    durationMillis: Int = 1000,
    pivot: Float = 0.5f,
) : Modifier {

and we can apply this to any composable function on its modifier.

OnThisDayDot(
modifier = Modifier.pulse()
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a great idea. But just curious about the android:repeatCount="1" and the android:repeatMode="reverse" in the original animation XML, are these something that can be done in a Modifier?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants