-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to reword strings of bottomNavigationMenu #12
Comments
The BottomNavigtaionView is supported out of the box, as this lib contains a ViewTransfomer for it. I just integrated a BottomNavigationView into my sample app and everything works fine there. Your code above looks correct, you may try to recreate the issue by forking my sample app and integrate your BottomNavigationView in the same way as in your real app. If this does not recreate the issue it may be due to something specific for your app. It may also depend on some specific version of the material lib or other libs used in your project. |
Oh Thanks!! I got the issue, I have not defined the id's for menu items. Also Just want to know one thing, the same way we are transforming the BottomNavigationMenu items, can we transform the menu items of the toolbar/support toolbar, so that strings of popup menu also got translated easily. As PopupMenu does not extends View we can not make its transformer directly, Or is there any other way to update popup menu strings? |
You're welcome :) Yes, it should work the same way with Toolbar/support Toolbar as with the BottomNavigationItems. Basically something like this in the ToolbarViewTransformer: override fun Toolbar.transform(attrs: Map<String, Int>) {
attrs.forEach { entry ->
when (entry.key) {
ATTRIBUTE_TITLE, ATTRIBUTE_ANDROID_TITLE -> updateTexts(entry.value, this::setTitle)
ATTRIBUTE_SUBTITLE, ATTRIBUTE_ANDROID_SUBTITLE -> updateTexts(entry.value, this::setSubtitle)
SOME_ATTRIBUTE -> menu.getItem(...).setTitle()
}
}
} I don't have the time to look into this at the moment, but maybe in the next weeks, this would definitely be a good improvement for the lib. If you want the feature now you can implement it though and create a PR :) |
PR added with the update: #14 :) |
@ashu5398 Released as version 2.1.0, thanks for the contribution :) |
Hi, I am unable to change the strings inflated in bottom Navigation Menu. Here is my code of bottomNavigationMenu. Is there anything I am missing on my end?
The text was updated successfully, but these errors were encountered: