fix: Setup compose button when creating MainActivity (#589)

The compose button isn't initially working on `MainActivity`. It is only
properly setup after changing tabs.

Fix by calling `MainActivity.refreshComposeButtonState(TabViewData)` on
creation.
This commit is contained in:
Angelo Suzuki 2024-04-04 13:33:43 +02:00 committed by GitHub
parent 6bef6f2fae
commit 6507e2bec1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -962,11 +962,13 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, MenuProvider {
activeTabLayout.addOnTabSelectedListener(it)
}
supportActionBar?.title = tabs[position].title(this@MainActivity)
binding.mainToolbar.title = tabs[position].title(this@MainActivity)
binding.mainToolbar.setOnClickListener {
(tabAdapter.getFragment(activeTabLayout.selectedTabPosition) as? ReselectableFragment)?.onReselect()
}
refreshComposeButtonState(tabs[position])
updateProfiles()
}