Closed khalid-mahmood closed 6 years ago
You can find some examples in this project!
@skydoves Defualt PowerMenu works good even with Kotlin, CustomPowerMenu is the focus. i am unable to use CustomPowerMenu in Kotlin! can't get ride of Errors in Kotlin Can you Please help ?
Try this :
fun getIconPowerMenu(context: Context, lifecycleOwner: LifecycleOwner, onMenuItemClickListener: OnMenuItemClickListener<IconPowerMenuItem>): CustomPowerMenu<*, *> {
return CustomPowerMenu.Builder(context, IconMenuAdapter())
.addItem(IconPowerMenuItem(context.resources.getDrawable(R.drawable.ic_wechat), "WeChat"))
.addItem(IconPowerMenuItem(context.resources.getDrawable(R.drawable.ic_facebook), "Facebook"))
.addItem(IconPowerMenuItem(context.resources.getDrawable(R.drawable.ic_twitter), "Twitter"))
.addItem(IconPowerMenuItem(context.resources.getDrawable(R.drawable.ic_line), "Line"))
.setLifecycleOwner(lifecycleOwner)
.setOnMenuItemClickListener(onMenuItemClickListener)
.setAnimation(MenuAnimation.FADE)
.setMenuRadius(10f)
.setMenuShadow(10f)
.build()
}
Thanks for you help.
CustomPowerMenu<, > This is the key trick i was missing!
it would be awesome if you can port this Library to Kotlin!
Nice work although!!