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

Address FIXME in Animation Calculation in BookmarkTopArea.kt #494

Merged
merged 3 commits into from
Aug 14, 2023

Conversation

tfandkusu
Copy link
Contributor

@tfandkusu tfandkusu commented Aug 14, 2023

Issue

Overview (Required)

Problem

  • On this issue, titlePaddingStart and titlePaddingTop in the BookmarkTopArea.kt is calculated by fraction.
  • fraction is culculated by scrollState.firstVisibleItemScrollOffset and fixed pixel 520.
  • If user selects large font and bookmarks item which has long title, scrollState.firstVisibleItemScrollOffset may be more than 520 pixel.
  • So fraction may be more than 1.0f.
  • So titlePaddingTop may be less than 0.0f.
  • Modifier.padding must not be a negative value, or the app will crash.

Solution

  • I use min method to limit fraction from 0.0f to 1.0f.

Links

Screenshot

Before(not use if expresson) After
screencap-2023-08-14T162514.532Z.mp4
screencap-2023-08-14T160936.558Z.mp4

Copy link
Member

@takahirom takahirom left a comment

Choose a reason for hiding this comment

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

Looks good!

@github-actions
Copy link

Test Results

27 tests   27 ✔️  3m 23s ⏱️
  7 suites    0 💤
  7 files      0

Results for commit d16da92.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 14, 2023 16:42 Inactive
@tfandkusu tfandkusu marked this pull request as ready for review August 14, 2023 16:45
@takahirom takahirom merged commit aa1a51a into DroidKaigi:main Aug 14, 2023
4 checks passed
@tfandkusu tfandkusu deleted the issue_273_2 branch August 14, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address FIXME in Animation Calculation in BookmarkTopArea.kt
2 participants