Hitomis / CircleMenu

Delicate, chic and supports customizable circle menu
954 stars 141 forks source link

Kotlin Issue #26

Open AKTDev opened 6 years ago

AKTDev commented 6 years ago

Not able to perform onMenuSelectedListener on Sub Menu in Android Kotlin...

saumya1singh commented 5 years ago

@AKTDev Try this :

`circleMenu.setMainMenu(Color.parseColor("#CDCDCD"), R.drawable.icon_menu, R.drawable.icon_cancel) .addSubMenu(Color.parseColor("#258CFF"), R.drawable.single_dice) .addSubMenu(Color.parseColor("#30A400"), R.drawable.double_dice) .addSubMenu(Color.parseColor("#FF4B32"), R.drawable.triple_dice) .setOnMenuSelectedListener (object : OnMenuSelectedListener{ override fun onMenuSelected(index: Int) { fragmentManager?.beginTransaction()?.add(R.id.parentLayout, OneRollerFragemnt())?.commit() } } ) .setOnMenuStatusChangeListener(object : OnMenuStatusChangeListener { override fun onMenuOpened() { } override fun onMenuClosed() { circleMenu.visibility = View.GONE }

        })`

Hope it will help you @AKTDev