From b89086c5be7fbadf2e6f39951ec6f56222a70ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Garc=C3=ADa?= <55400857+jaime-grj@users.noreply.github.com> Date: Tue, 9 Sep 2025 02:11:36 +0200 Subject: [PATCH] fix: Prevent switch enable animation when opening equalizer fragment --- .../tempo/ui/fragment/EqualizerFragment.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/cappielloantonio/tempo/ui/fragment/EqualizerFragment.kt b/app/src/main/java/com/cappielloantonio/tempo/ui/fragment/EqualizerFragment.kt index 589f7b8b..a95949fb 100644 --- a/app/src/main/java/com/cappielloantonio/tempo/ui/fragment/EqualizerFragment.kt +++ b/app/src/main/java/com/cappielloantonio/tempo/ui/fragment/EqualizerFragment.kt @@ -61,13 +61,16 @@ class EqualizerFragment : Fragment() { inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { - return inflater.inflate(R.layout.fragment_equalizer, container, false) + val root = inflater.inflate(R.layout.fragment_equalizer, container, false) + eqSwitch = root.findViewById(R.id.equalizer_switch) + eqSwitch.isChecked = Preferences.isEqualizerEnabled() + eqSwitch.jumpDrawablesToCurrentState() + return root } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) eqBandsContainer = view.findViewById(R.id.eq_bands_container) - eqSwitch = view.findViewById(R.id.equalizer_switch) resetButton = view.findViewById(R.id.equalizer_reset_button) safeSpace = view.findViewById(R.id.equalizer_bottom_space) } @@ -93,7 +96,6 @@ class EqualizerFragment : Fragment() { safeSpace.visibility = View.VISIBLE eqSwitch.setOnCheckedChangeListener(null) - eqSwitch.isChecked = Preferences.isEqualizerEnabled() updateUiEnabledState(eqSwitch.isChecked) eqSwitch.setOnCheckedChangeListener { _, isChecked -> manager.setEnabled(isChecked)