Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
1 answer
188 views

Do I really need to set icon size manually when using LargeFloatingActionButton in Jetpack Compose?

I assumed that when using LargeFloatingActionButton, the icon size would be somehow set automatically (this is the point of using LargeFloatingActionButton, so that everything works out of box, right?)...
Mikhail's user avatar
  • 3,147
0 votes
1 answer
403 views

BottomAppBar has a cradle (hole) when FloatingActionButton is hidden

In a word game for Android I show a floating action button with "Play" icon, when a valid word is at the game board: mFab.setVisibility(canPlay ? View.VISIBLE : View.GONE); However when I ...
Alexander Farber's user avatar
1 vote
2 answers
639 views

how to disable fab hide animation for material design 3 on android

i have converted my current android project to use material 3 design as follows <style name="Theme.MyTheme" parent="Theme.Material3.DayNight.NoActionBar"> <item name=&...
Hector's user avatar
  • 4,874
0 votes
1 answer
867 views

How to change the background image of Floating Action Button programatically in Kotlin?

I use the following FloatingActionButton and I have set the background image using xml. How can I change the image programmatically in Kotlin? I want to replace the image 'image-color' with 'image-bw'....
Codist's user avatar
  • 759
0 votes
0 answers
347 views

How to bring down the fab in bottom app bar?

Since app:fabCradleVerticalOffset cannot have a negative value, I couldn't find a way to bring down the FAB component in bottom app bar.
Vijay Anand's user avatar
0 votes
1 answer
680 views

Gray out disabled button

I'm currently writing my first Android application. so far, I've added the basic layout as well as a floating action button. To disable the button, I am using FloatingActionButton#setEnabled(false). ...
writzlpfrimpft's user avatar
7 votes
3 answers
2k views

How to center align text in Extended Floating Action Button?

I want to center align the text in the extended floating action button but I'm not able to do that. As you can see in the image below the text is not centrally aligned. Here's is the code for ...
Jazib Khan's user avatar
-1 votes
1 answer
661 views

Floating action button(FAB) in MotionLayout, .show() doesn't work, .hide() work incorrect

I have MainActivity with FragmentContainerView, BottomNavigationView and FAB. activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.motion....
Andrei R's user avatar
  • 1,908
1 vote
3 answers
58 views

how to get current colour of FloatingActionButton

I have FloatingActionButton in my App: https://i.sstatic.net/iOj2C.jpg witch have configuration in according with image from link above. In my app user can change the colour of this ...
Michal's user avatar
  • 11
2 votes
1 answer
791 views

how to grey out floatingActionButton to indicate disabled state? [duplicate]

I have a FloatingActionButton in a android layout. by Code I try to disable the button as follow: if(notAvailable){ floatingActionButton.setEnabled(false); } This makes the button unclickable, ...
mcfly soft's user avatar
  • 11.6k
2 votes
3 answers
120 views

Unable to change icon color in layout file for a FloatingActionButton on Android Studio

So, I have this layout file with the following skeleton: <layout> <CoordinatorLayout> <AppBarLayout> ... some tags and stuff ... </AppBarLayout> <...
Renato Silva's user avatar
0 votes
0 answers
68 views

FAB with material components look square

I'm using a FAB in my layout but looks weird. I try with invalidate restar cache but nothing happens. This is my xml: <com.google.android.material.floatingactionbutton.FloatingActionButton ...
LordCommanDev's user avatar
2 votes
2 answers
728 views

Adding elevation (shadow) to ExtendedFloatingActionButton

I'm trying to add elevation (shadow) to a com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton and it just doesn't apply I've tried so far adding: app:elevation="8dp"...
SagiLow's user avatar
  • 5,971
2 votes
1 answer
1k views

Arrange a BottomNavigationView, a FAB, and a FrameLayout in a CoordinatorLayout and make it work with Snackbar

I want to place a FrameLayout for hosting Fragments, a BottomNavigationView and a FAB inside a CoordinatorLayout. I would like to display a Snackbar over the BottomNavigationView and FAB to move up ...
Sudhir Singh Khanger's user avatar
2 votes
1 answer
791 views

How to create bottom navigation with floating action button

How to create this design I have used this code but not get expected result <androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:...
Shivam Kumar's user avatar
  • 1,894

15 30 50 per page