Skip to main content
se añadieron 146 caracteres en el cuerpo
Origen Enlace
Jorgesys
  • 111.1k
  • 14
  • 55
  • 134
  • 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();
    }
  • 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();
    }
se añadieron 137 caracteres en el cuerpo
Origen Enlace

Finalmente he resuelto mi problema. He implementado el botón flotante de la siguiente manera:

  • 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();
    

    }

Este es el resultado final:

introducir la descripción de la imagen aquí

Espero que a alguien le sea últil

Finalmente he resuelto mi problema. He implementado el botón flotante de la siguiente manera:

  • 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();
    

    }

Espero que a alguien le sea últil

Finalmente he resuelto mi problema. He implementado el botón flotante de la siguiente manera:

  • 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();
    

    }

Este es el resultado final:

introducir la descripción de la imagen aquí

Espero que a alguien le sea últil

Origen Enlace

Finalmente he resuelto mi problema. He implementado el botón flotante de la siguiente manera:

  • 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();
    

    }

Espero que a alguien le sea últil