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

[StaffScreen] center title when small state in LargeTopAppBar #292

Conversation

kosenda
Copy link
Contributor

@kosenda kosenda commented Aug 11, 2024

Issue

Overview (Required)

  • Use ScrollBehavior.state.collapsedFraction so that the title is centered on the screen when the TopAppBar is collapsed.
  • The 0.7f..1.0f and 0.0f..0.5f are set to values that looked good after trying them out.

Things I tried that didn't work

  • I thought I could set requiredWidth(screenWidth) to modifier using LocalConfiguration.screenWidth.dp in the title text, but it was not possible because the padding was a little to the right because of the size of the navigationIcon.

Movie

Before After
Screen_recording_20240811_194420.mp4
Screen_recording_20240811_213956.mp4

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 11:06 Inactive
@takahirom
Copy link
Member

@kosenda Are there any points to address to make this PR ready?

@kosenda
Copy link
Contributor Author

kosenda commented Aug 11, 2024

@takahirom
I'm trying to make the transition a little smoother 🙇
So, give me a little more time to try it!

@takahirom
Copy link
Member

Just to let you know that you might refer to this implementation. 👀
#293

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 12:26 Inactive
@kosenda kosenda marked this pull request as ready for review August 11, 2024 12:42
@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 12:49 Inactive
@kosenda
Copy link
Contributor Author

kosenda commented Aug 11, 2024

@takahirom
Sorry for the delay. I'm now ready and open!
However, It looks quite different from 293, what do you think...?

@kosenda kosenda marked this pull request as draft August 11, 2024 14:23
@kosenda
Copy link
Contributor Author

kosenda commented Aug 11, 2024

The same LargeTopAppBar is expected to be used in ContributorsScreen as well, so I have moved it.

@github-actions github-actions bot temporarily deployed to deploygate-distribution August 11, 2024 14:37 Inactive
@kosenda kosenda marked this pull request as ready for review August 11, 2024 14:54
@takahirom
Copy link
Member

@nobonobopurin
Can I consult you about an animation? There are two implementations for centering the title. Do you have a preference for which animation you like?
#292
#293

@nobonobopurin
Copy link

nobonobopurin commented Aug 11, 2024

@takahirom
Thanks for reaching out. Animation #292 is closer to what I had in mind.

@takahirom
Copy link
Member

takahirom commented Aug 12, 2024

@nobonobopurin Thank you for your opinion! I'll use this PR's implementation

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.

Thank you for your patience and contribution!

@takahirom takahirom merged commit 613aa34 into DroidKaigi:main Aug 12, 2024
5 checks passed
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.

Center align title in Staff screen app bar when it's in small state
3 participants