In my layout I am having recycler view. Initially I put floating action button as hidden I want that whenever i click on any recyclerview item fab should get visible and speed dial menu should open and when after opening the speed dial menu clicking on content cover speed dial menu should first close and then gets hidden. I tried it using an interface to get the click event of recyclerview item and checked for speed dialmenu is opened or not then tried to toggle that.But speed dial menu is not opening it is getting opened all menu items get overlapped.Below is my code.
interface callback:
public void onLongPressed() {
if(floatingActionButton.isSpeedDialMenuOpen()){
floatingActionButton.hide(true);
floatingActionButton.setVisibility(View.GONE);
}else {
floatingActionButton.setVisibility(View.VISIBLE);
floatingActionButton.setContentCoverEnabled(true);
floatingActionButton.setContentCoverColour(0xffff9900);
floatingActionButton.setContentCoverEnabled(true);
floatingActionButton.callOnClick();
}
}
where floatingActionButton is initialised as in onCreate of activity
floatingActionButton = findViewById(R.id.fabMenu);
floatingActionButton.setSpeedDialMenuAdapter(new CustomSpeedMenuAdapter(this));
Hi,
In my layout I am having recycler view. Initially I put floating action button as hidden I want that whenever i click on any recyclerview item fab should get visible and speed dial menu should open and when after opening the speed dial menu clicking on content cover speed dial menu should first close and then gets hidden. I tried it using an interface to get the click event of recyclerview item and checked for speed dialmenu is opened or not then tried to toggle that.But speed dial menu is not opening it is getting opened all menu items get overlapped.Below is my code.
interface callback: public void onLongPressed() { if(floatingActionButton.isSpeedDialMenuOpen()){ floatingActionButton.hide(true); floatingActionButton.setVisibility(View.GONE); }else { floatingActionButton.setVisibility(View.VISIBLE); floatingActionButton.setContentCoverEnabled(true); floatingActionButton.setContentCoverColour(0xffff9900); floatingActionButton.setContentCoverEnabled(true); floatingActionButton.callOnClick(); } } where floatingActionButton is initialised as in onCreate of activity floatingActionButton = findViewById(R.id.fabMenu); floatingActionButton.setSpeedDialMenuAdapter(new CustomSpeedMenuAdapter(this));
In layout