From 6507e2bec1ea114590d8e63b9faceec45fbc8558 Mon Sep 17 00:00:00 2001 From: Angelo Suzuki <1063155+tinsukE@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:33:43 +0200 Subject: [PATCH] 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. --- app/src/main/java/app/pachli/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/pachli/MainActivity.kt b/app/src/main/java/app/pachli/MainActivity.kt index 664a2f922..b53a15e7a 100644 --- a/app/src/main/java/app/pachli/MainActivity.kt +++ b/app/src/main/java/app/pachli/MainActivity.kt @@ -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() }