Here I am writing the way to change the color and icon of FloatingActionButton.
If I talk about icon of the action button, we need to fulfill of requirement and purpose of Floating button.
So we need to change the icon of the FloatingActionButton.
For color of FloatingActionButton, we do it to look and feel and match the color with our App theme color.
So To change the icon we need to define it in xml like this
android:src="@android:drawable/checkbox_on_background"
To change the color,
app:backgroundTint="@android:color/holo_blue_bright"
From coding,
.setBackgroundTintList()
Below is the code
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_margin="@dimen/fab_margin"
app:backgroundTint="@android:color/holo_blue_bright"
app:elevation="10dp"
android:src="@android:drawable/checkbox_on_background" />
0 Comment(s)