Java
public void creacion_fab(){ ImageView icon = new ImageView(this); icon.setImageResource(R.drawable.logofinal);
FloatingActionButton fab_rankit; fab_rankit = (FloatingActionButton) findViewById(R.id.fab_rankit); SubActionButton.Builder itemBuilder = new SubActionButton.Builder(this); FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(130,130); itemBuilder.setLayoutParams(params); ImageView fab_home = new ImageView(this); fab_home.setImageResource(R.mipmap.fab_home); ImageView fab_buscar = new ImageView(this); fab_buscar.setImageResource(R.mipmap.fab_buscar); ImageView fab_publicar = new ImageView(this); fab_publicar.setImageResource(R.mipmap.fab_publicar); SubActionButton button1 = itemBuilder.setContentView(fab_publicar).build(); SubActionButton button2 = itemBuilder.setContentView(fab_buscar).build(); SubActionButton button3 = itemBuilder.setContentView(fab_home).build(); //attach the sub buttons to the main button FloatingActionMenu actionMenu = new FloatingActionMenu.Builder(this) .addSubActionView(button1) .addSubActionView(button2) .addSubActionView(button3) .attachTo(fab_rankit) .build();
}
Código Java:
public void creacion_fab(){
ImageView icon = new ImageView(this);
icon.setImageResource(R.drawable.logofinal);
FloatingActionButton fab_rankit;
fab_rankit = (FloatingActionButton) findViewById(R.id.fab_rankit);
SubActionButton.Builder itemBuilder = new SubActionButton.Builder(this);
FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(130,130);
itemBuilder.setLayoutParams(params);
ImageView fab_home = new ImageView(this);
fab_home.setImageResource(R.mipmap.fab_home);
ImageView fab_buscar = new ImageView(this);
fab_buscar.setImageResource(R.mipmap.fab_buscar);
ImageView fab_publicar = new ImageView(this);
fab_publicar.setImageResource(R.mipmap.fab_publicar);
SubActionButton button1 = itemBuilder.setContentView(fab_publicar).build();
SubActionButton button2 = itemBuilder.setContentView(fab_buscar).build();
SubActionButton button3 = itemBuilder.setContentView(fab_home).build();
//attach the sub buttons to the main button
FloatingActionMenu actionMenu = new FloatingActionMenu.Builder(this)
.addSubActionView(button1)
.addSubActionView(button2)
.addSubActionView(button3)
.attachTo(fab_rankit)
.build();
}