Skip to content

Handle scaffold topBar and bottomBar#2

Open
tcBorek2002 wants to merge 2 commits intormyhal:compose-shared-elementfrom
tcBorek2002:scaffold-topbar-and-bottombar
Open

Handle scaffold topBar and bottomBar#2
tcBorek2002 wants to merge 2 commits intormyhal:compose-shared-elementfrom
tcBorek2002:scaffold-topbar-and-bottombar

Conversation

@tcBorek2002
Copy link
Copy Markdown

@tcBorek2002 tcBorek2002 commented Oct 4, 2024

First of all thank you for this repository, it was very useful to me!

In my app, I am making use of the scaffold topBar and bottomBar to show the app title and some navigation buttons at the bottom.

This section from the material 3 guidelines indicates what I am trying to achieve. You can see it has the navbar at the bottom.

I have tried to make the container transform transition work with the fab while using the scaffold topBar and bottomBar. My strategy for this is to conditionally render these bars when the AddContentScreen is shown or not.

The best way to do this would have been to render the AddContentScreen on top of the topBar and bottomBar but I was not able to do this. My solution is not great because there is a bit of a weird artefact at the top. Let me know if you would have a better way to handle this. For now I will leave this here for anyone trying to do the same.

Below a gif of the way it works in my solution:

@rmyhal
Copy link
Copy Markdown
Owner

rmyhal commented Oct 8, 2024

@tcBorek2002 I would suggest integrating Compose Navigation library in that case, because my example didn't include navigation for simplicity.
They do have some examples of how to integrate that here and I think in that case your topBar and bottomBar will live inside HomeScreen or otherwise depends on your needs it might be shared across several screens and therefore it should be placed on some higher level.

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.

2 participants