There are problems with tabbar translation along with fragments in the application. At the moment, I only translate the contents of the fragments (when changing languages ​​in the settings). I will explain that in my tabbar, in addition to the icons, there are the names of the fragments, by clicking on which I turn into fragments. But when changing the language in the application, the tabbar changes the language only if I kill the application and restart again. Therefore, it would be nice to update the tabbar without leaving the application.

I decided to redraw the activation elements by implementing the method:

override fun onConfigurationChanged(newConfig: Configuration?) { super.onConfigurationChanged(newConfig) invalidate() Log.d("onConfigurationChanged", "onConfigurationChanged") } 

And also added a parameter in AndroidManifest.xml for locale:

  android:configChanges="locale|layoutDirection" 

But in the logs the method is still not used.

  • What is this tabbar? - pavlofff
  • @pavlofff in the sense of what is it?) - Inkognito

1 answer 1

Try using the following method in your class with TabBar:

 override fun onConfigurationChanged(newConfig: Configuration?) { super.onConfigurationChanged(newConfig) invalidate() } 

I hope it will be useful.

  • Unfortunately, nothing has changed. - Inkognito
  • @Inkognito check whether you call this method at all (this may be due to the large amount of view's) - Morozov