BoomMenuButton onClickListener
Maybe a stupid question but... Ther's a way to override the onClickListener event of a BoomMenuButton without modifying the Boom source code? I tried in XML too, setting the android:onClick property to a new function without any success...
What I need to do is a conditional boom() of the menu button, the menu is shown only if some settings are ok, otherwise the click on the menu button has to call another function (not open the menu):
rightBmb.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { boolean isAlertActive = ApplicationSettings.isAlertActive(context); if (!isAlertActive) { rightBmb.boom(); } else { showSnackbar(coordinatorLayout, context.getString(R.string.already_sending),Snackbar.LENGTH_LONG, Color.YELLOW); } } });
i think maybe if you use the onboommenuwillshow calback listener add an if condition in there if you want to show do nothing else bmb.reboom and do what do you want ?
This is how a did it
bmb.findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { // hack to hide on click
@Override
public void onClick(View view) {
if (bmb.isBoomed())
bmb.reboom();
else bmb.boom();
}
});
Hello, pardon me, how can i add onclick listener to each menu button pop ups