Closed wiliam-toney closed 6 years ago
Below is the code i implemented. private OnMenuItemClickListener onMenuItemClickListener = new OnMenuItemClickListener() { @Override public void onItemClick(int position, SwitcherItem item) { Toast.makeText(getBaseContext(), item.getName(), Toast.LENGTH_SHORT).show(); mSwitcherMenu.dismiss(); } };
mSwitcherMenu = new CustomPowerMenu.Builder<>(this, new PatientSwitcherAdapter()) .addItem(new SwitcherItem("", "John Appleseed")) .addItem(new SwitcherItem("", "Evil Monster")) .addItem(new SwitcherItem("", "New Patient")) .addItem(new SwitcherItem("", "AAA EEE")) .setOnMenuItemClickListener(onMenuItemClickListener) .setFooterView(R.layout.cell_signout) .setWidth(dm.widthPixels * 2 / 3) .setBackgroundAlpha(0.2f) .setAnimation(MenuAnimation.SHOWUP_TOP_LEFT) .setMenuRadius(10f) .setMenuShadow(10f) .build();
But onItemClick is not calling. I appreciate your any help!
Below is the code i implemented. private OnMenuItemClickListener onMenuItemClickListener = new OnMenuItemClickListener() {
@Override
public void onItemClick(int position, SwitcherItem item) {
Toast.makeText(getBaseContext(), item.getName(), Toast.LENGTH_SHORT).show();
mSwitcherMenu.dismiss();
}
};
mSwitcherMenu = new CustomPowerMenu.Builder<>(this, new PatientSwitcherAdapter()) .addItem(new SwitcherItem("", "John Appleseed")) .addItem(new SwitcherItem("", "Evil Monster")) .addItem(new SwitcherItem("", "New Patient")) .addItem(new SwitcherItem("", "AAA EEE")) .setOnMenuItemClickListener(onMenuItemClickListener) .setFooterView(R.layout.cell_signout) .setWidth(dm.widthPixels * 2 / 3) .setBackgroundAlpha(0.2f) .setAnimation(MenuAnimation.SHOWUP_TOP_LEFT) .setMenuRadius(10f) .setMenuShadow(10f) .build();
But onItemClick is not calling. I appreciate your any help!