-
Notifications
You must be signed in to change notification settings - Fork 1.1k
On click listener on the text lable #121
Comments
Just set yout OnClickListener on FAB inside the menu and label will also become clickable. |
Can u explain more detailed ? |
Labels are enabled only if the FAB is placed inside the FAM. |
I've already added the OnClickListener inside the menu and the label keeps unresponsive to click. |
Me too, my FAB placed iside te FAM |
Please paste your code here so I could look at it. |
This happens to me only if the FAB is added programmaticlly. When added in XML it works. |
There's an example of how to add FAB programmatically. Please look at the |
i'm doing like this: for (final Sport sport : Sport.values()) {
FloatingActionButton fab = new FloatingActionButton(getActivity());
fab.setImageResource(sport.getResource());
fab.setLabelText(getString(sport.getName()));
fab.setColorNormal(ContextCompat.getColor(getActivity(), R.color.accent));
fab.setColorRipple(ContextCompat.getColor(getActivity(), R.color.primary_dark));
fab.setColorPressed(ContextCompat.getColor(getActivity(), R.color.primary_dark));
fab.setButtonSize(FloatingActionButton.SIZE_MINI);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
createNewChallenge(sport);
}
});
mFabMenu.addMenuButton(fab);
} |
Thanks! Will fix this in the next build. For now set your OnClickListener after you have added the FAB into the FAM. |
This is not fixed. If you use the code from @jzeferino's comment the bug is there.
This bug is result of the workflow of it. The logic should be to create, configure and then attach it. Not create, attach and then configure. One good and permanent solution could be to use the builder pattern for adding menu items. |
Hi. How can i add onClickListner to text label in action menu item?
i can setOnClickListener to ActionMenu value, but in this case it can only responds when i pressing on icon.
Thank you.
The text was updated successfully, but these errors were encountered: