Clans / FloatingActionButton

Android Floating Action Button based on Material Design specification
Apache License 2.0
5.22k stars 1.13k forks source link

FAB cut #393

Open candeiasdan opened 7 years ago

candeiasdan commented 7 years ago
<com.github.clans.fab.FloatingActionMenu
            android:id="@+id/fabMenu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            fab:menu_colorNormal="@color/green_dark"
            fab:menu_colorPressed="@color/green_dark_selected"
            fab:menu_colorRipple="@color/green_dark"
            fab:menu_icon="@android:drawable/ic_menu_sort_by_size">

            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/fabOne"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                fab:fab_colorNormal="@color/green_dark_selected"
                fab:fab_colorPressed="@color/green_dark"
                fab:fab_colorRipple="@color/green_selection"
                fab:fab_progress_indeterminate="false"
                fab:fab_progress_max="100"
                fab:fab_progress="100"
                fab:fab_size="normal"/>

            <com.github.clans.fab.FloatingActionButton
                android:id="@+id/fabTwo"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                fab:fab_progress_color="#FF009688"
                fab:fab_progress_backgroundColor="#4D000000"
                fab:fab_progress_indeterminate="false"
                fab:fab_progress_max="100"
                fab:fab_progress="100"
                fab:fab_colorNormal="@color/green_dark_selected"
                fab:fab_colorPressed="@color/green_dark"
                fab:fab_colorRipple="@color/green_selection"
                fab:fab_size="normal"/>

        </com.github.clans.fab.FloatingActionMenu>

As result i get this: screen shot 2017-06-02 at 10 23 49

Whats wrong here the cornes to be cut? I also tried to add an icon to center of those buttons and they don't get center.

Am i missing something or is it a bug?

dainq57 commented 7 years ago

@candeiasdan you can add "android:paddingBottom" and "android:paddingEnd" into your FloatingActionMenu

Avjeet commented 7 years ago

@dainq57 your solution is not working

Gyoko commented 5 years ago

Had the same problem. It shows up when you're playing with progress in xml. If you declare fab in layout as usual, but inside java you write the progress options, it will be displayed correctly. Consult ProgressFragment in the sample provided for more info

jilenloa commented 4 years ago

I am experiencing same issue. anyone with solution yet. your assistance would be appreciated.

jilenloa commented 4 years ago

This is what I eventually did that worked for me.

 floatingActionButton.post(new Runnable() {

        @Override
        public void run() {
            submitAttendance.setShowProgressBackground(true);
            submitAttendance.setProgress(90, false);
        }
    });