Closed Miteshmakwana73 closed 3 years ago
You can resolve this using a customized popup.
i'll try this
@skydoves
I pass selecter file but it's not working only changing the text color only not changing drawable
public static PowerMenu getIconPowerMenu(
Context context,
LifecycleOwner lifecycleOwner,
OnMenuItemClickListener<PowerMenuItem> onMenuItemClickListener) {
Context styledContext = new ContextThemeWrapper(context, R.style.PopupCardThemeOverlay);
return new PowerMenu.Builder(styledContext)
.addItem(new PowerMenuItem("WeChat", R.drawable.image_selecter))
.addItem(new PowerMenuItem("Facebook", R.drawable.image_selecter))
.addItem(new PowerMenuItem("Twitter", R.drawable.image_selecter))
.addItem(new PowerMenuItem("Line", R.drawable.image_selecter))
.addItem(new PowerMenuItem("Other", R.drawable.image_selecter))
.setLifecycleOwner(lifecycleOwner)
.setOnMenuItemClickListener(onMenuItemClickListener)
.setAnimation(MenuAnimation.FADE)
.setMenuRadius(context.getResources().getDimensionPixelSize(R.dimen.menu_corner_radius))
.setMenuShadow(context.getResources().getDimensionPixelSize(R.dimen.menu_elevation))
.setIsMaterial(true)
.build();
}
selecter file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_baseline_radio_button_checked_24" android:state_selected="true"></item>
<item android:drawable="@drawable/ic_baseline_radio_button_unchecked_24" android:state_selected="false"></item>
</selector>
onIconMenuItemClickListener i write this line
iconMenu.setSelectedPosition(position);
this what i got now
i want to create popup menu with radio button is it possible?