Use the tab's contentDescription as the toolbar title (#3609)
Previous code had an IndexOutOfBoundsException where tab.position could be larger than the tabs array.
This commit is contained in:
parent
4da758c1f7
commit
a7001eecb8
1 changed files with 1 additions and 1 deletions
|
@ -737,7 +737,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
|
|||
|
||||
onTabSelectedListener = object : OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab) {
|
||||
binding.mainToolbar.title = tabs[tab.position].title(this@MainActivity)
|
||||
binding.mainToolbar.title = tab.contentDescription
|
||||
|
||||
refreshComposeButtonState(tabAdapter, tab.position)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue