All Questions
Tagged with material-components-android floating-action-button
47
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?)...
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 ...
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=&...
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'....
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.
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). ...
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 ...
-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....
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 ...
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, ...
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>
<...
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
...
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"...
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 ...
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:...