Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Material Design Floating Action Menu For Android - MaterialDesignFloatingActionMenu.java
package viralandroid.com.androidmaterialdesigntutorial;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.github.clans.fab.FloatingActionButton;
import com.github.clans.fab.FloatingActionMenu;
public class MaterialDesignFloatingActionMenu extends AppCompatActivity {
FloatingActionMenu materialDesignFAM;
FloatingActionButton floatingActionButton1, floatingActionButton2, floatingActionButton3;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.material_design_floating_action_menu);
materialDesignFAM = (FloatingActionMenu) findViewById(R.id.material_design_android_floating_action_menu);
floatingActionButton1 = (FloatingActionButton) findViewById(R.id.material_design_floating_action_menu_item1);
floatingActionButton2 = (FloatingActionButton) findViewById(R.id.material_design_floating_action_menu_item2);
floatingActionButton3 = (FloatingActionButton) findViewById(R.id.material_design_floating_action_menu_item3);
floatingActionButton1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//TODO something when floating action menu first item clicked
}
});
floatingActionButton2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//TODO something when floating action menu second item clicked
}
});
floatingActionButton3.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//TODO something when floating action menu third item clicked
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.