How do I remove the titles (at runtime) and decrease the size of the FloatingActionButton?

1

I have a menu with floating action buttons and I would like to know how you can put them smaller than the normal size because they are equal in size to the menu, even open and the fabsize property does not work. And how to remove the title programmatically when clicking on any of these buttons?

XML:

<com.getbase.floatingactionbutton.FloatingActionsMenu
                android:id="@+id/map_btn_compartilhar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignBottom="@+id/pink_icon"
                android:layout_alignEnd="@+id/multiple_actions_down"
                android:layout_alignRight="@+id/multiple_actions_down"
                android:layout_gravity="bottom|end"
                android:layout_margin="@dimen/fab_margin"
                android:src="@drawable/ic_share_white_24dp"
                app:fab_addButtonStrokeVisible="true"
                fab:fab_addButtonColorNormal="@color/fundo_3"
                fab:fab_addButtonColorPressed="@color/fundo_1"
                fab:fab_labelStyle="@style/menu_labels_style">

                <com.getbase.floatingactionbutton.FloatingActionButton
                    android:id="@+id/fab_ativa_map"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_map_24dp_branco_deactive"
                    fab:fab_colorNormal="@color/white"
                    fab:fab_colorPressed="@color/white_pressed"
                    fab:fab_title="@string/ativarmap_map"/>

                <com.getbase.floatingactionbutton.FloatingActionButton
                    android:id="@+id/fab_filtra_map"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_24dp_branco_deactive"
                    fab:fab_colorNormal="@color/white"
                    fab:fab_colorPressed="@color/fundo_2"
                    fab:fab_title="@string/filtra_map"/>

                <com.getbase.floatingactionbutton.FloatingActionButton
                    android:id="@+id/fab_parar_map"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@drawable/ic_24dp_branco_active"
                    android:visibility="gone"
                    fab:fab_colorNormal="@color/fundo_1"
                    fab:fab_colorPressed="@color/fundo_2"
                    fab:fab_title="@string/pararmap_map" />

</com.getbase.floatingactionbutton.FloatingActionsMenu>

Example of the FAB code:

fabAtivamap = (com.getbase.floatingactionbutton.FloatingActionButton) activity.findViewById(R.id.fab_ativa_map);
        fabAtivamap.setVisibility(View.VISIBLE);       
        fabAtivamap.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {                            
                ......
                // Reseta os botões
                fabPararmap.setVisibility(View.VISIBLE);
                fabAtivamap.setVisibility(View.GONE);
                fabFiltramap.setVisibility(View.VISIBLE);
                fabAtivamap.setTitle("");//retirar os titulos
                ......
});
    
asked by anonymous 28.04.2017 / 16:16

1 answer

0

Do you have any special reason to use a library that the author himself says is extremely limited a>?

I do not know if it will work with this library , but using FAB of the material library design, you control the size like this:

app:fabSize="mini"

For the minimum size (default 40x40 dp)

app:fabSize="normal"

For normal size (default 56x56 dp)

Try and see if it works, or stop using this library , that's it, it will work.

    
29.04.2017 / 18:53