Paris B. G.
Paris B. G.

Reputation: 394

After Android Studio 3.2 update all of my FAB icons are tiny and in the top right corner

UPDATE: You can override the normal and mini sizes by adding the following to values/dimens.xml:

<!-- Overriding sizes of the FAB -->
 <dimen name="design_fab_size_normal">90dp</dimen>
 <dimen name="design_fab_size_mini">30dp</dimen>

OR

//set XML attribute

app:fabCustomSize"100dp"

enter image description here

So I am developing an application that I am close to publishing to the app store. I updated android Studio to 3.2 and even though the release notes don't specify any changes to the FAB itself, somehow all of my FAB icons are now suddenly tiny and stuck in the top right corner of the FAB!

-This problem persist not just in one activity but in multiple.

-No I did not (at least not Intentionally) alter the parent FAB

-I have no custom FAB Style, nor am I extending the FAB parent class widget

-I tried changing "app:fabSize" to both mini and normal to no avail

-I tried adjusting the fab gravity to no avail

I am stuck here, all suggestions are welcome!

-Again the FAB with these very same attributes worked fine earlier and the only dynamic alterations to the FAB are using a Color.filter to change the color of the icon. -below is my XML, that was working perfectly a few day ago.

-These XML drawables are all housed in the drawable folder (iIeven tried drawable v-24)

//here is the actual icon xml 
<vector android:height="24dp"
android:tint="#000201"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
android:width="24dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData.../>
</vector>
//HERE IS THE FAB XML ATTRIBUTES
<android.support.design.widget.FloatingActionButton
                android:id="@+id/submit_fab_roster"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_gravity="center_horizontal"
                android:layout_marginEnd="4dp"
                android:layout_marginBottom="4dp"
                android:layout_marginStart="4dp"
                android:longClickable="true"
                android:onClick="onClickSubmit"
                android:src="@drawable/submit_fab_2"
                android:tint="@color/black"
                app:backgroundTint="@color/red"/>

Upvotes: 0

Views: 203

Answers (1)

BoD
BoD

Reputation: 11035

Your width and height should not be match_parent for a FAB - this doesn't make sense. Try wrap_content.

Please note that the size of a FAB is specified by the Material Design specs.

Upvotes: 1

Related Questions