Closed milon27 closed 3 years ago
//overload setupWithNavController fun setupWithNavController(menu:Menu,navController: NavController) { NavigationComponentHelper.setupWithNavController(menu, this, navController) } +fun setupWithNavController(navController: NavController) { + NavigationComponentHelper.setupWithNavController(this.menu, this, navController) + Navigation.setViewNavController(this,navController) +} //select an item +fun selectItem(pos:Int){ + try{ + this.itemActiveIndex=pos + NavigationUI.onNavDestinationSelected(this.menu.getItem(pos), this.findNavController()) + }catch (e:Exception){ + throw Exception("set menu using PopupMenu") + } + }