https://kotlinlang.org logo
#compose
Title
# compose
b

brabo-hi

08/02/2022, 6:21 PM
Hello guys, when using compose material3, how could we indent the fab to centered the bottom navigation bar
👀 1
j

Jasmin Fajkic

08/02/2022, 6:29 PM
Same question I have
d

dewildte

08/02/2022, 7:47 PM
Docking the FAB is a material 2 concept. Material 3 purposely avoids this behaviour. You can investigate the code in the material 2 code and do that. But why bother?
b

brabo-hi

08/02/2022, 7:56 PM
We are currently using M2 with fan docked centered. We are migrating to M3 but want to keep the fab almost close to what we havd
m

mtrewartha

08/02/2022, 8:37 PM
Per the M3 guidelines on bottom app bars:
FAB is now contained within the app bar container
d

dewildte

08/02/2022, 8:43 PM
This ☝️
b

brabo-hi

08/02/2022, 8:44 PM
I want to use it for navigation
d

dewildte

08/02/2022, 8:46 PM
If you stick to the guidelines then you wont have to fight the framework.
m

mtrewartha

08/02/2022, 8:49 PM
By “use it for navigation” do you mean you need a hamburger menu item in the bottom app bar or do you mean you actually want a FAB to indent a navigation bar? If you mean the former, then I think you still can do that. The latter doesn’t seem to be supported and I’d guess that’s because the FAB would contend with nav items for space (especially if you had an odd number of items where the middle one was centered with the FAB).
b

brabo-hi

08/03/2022, 1:24 AM
I am talking about navigationBar to switch between pages and having fab centered docked. I guess i can use offset on the fab
5 Views