private FloatingActionButton createButton(int id) {
FloatingActionButton fab = new FloatingActionButton(this);
fab.setId(id);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("Entrei truta");
}
});
fab.setImageResource(R.drawable.ic_delete);
RelativeLayout.LayoutParams lay = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
lay.addRule(RelativeLayout.BELOW, buttonAddCardapio.getId());
lay.addRule(RelativeLayout.RIGHT_OF, editTextCardapioHora.getId());
lay.addRule(RelativeLayout.END_OF, editTextCardapioHora.getId());
fab.setLayoutParams(lay);
return fab;
}
I'm trying to create a FloatingActionButton
button on Android but I can not set the size of the button or something like app:fabSize="mini"
because it does not have the setSize
method and neither Enum
FloatingActionButton.SIZE_MINI
.