@@ -38,7 +38,7 @@ import com.infomaniak.mail.utils.AttachmentIntentUtils
38
38
import com.infomaniak.mail.utils.UiUtils.FULLY_SLID
39
39
import com.infomaniak.mail.utils.UiUtils.progressivelyColorSystemBars
40
40
import com.infomaniak.mail.utils.safeNavigateToNewMessageActivity
41
- import com.infomaniak.mail.utils.updateNavigationBarColor
41
+ import com.infomaniak.mail.utils.setSystemBarsColors
42
42
import javax.inject.Inject
43
43
44
44
abstract class TwoPaneFragment : Fragment () {
@@ -121,7 +121,7 @@ abstract class TwoPaneFragment : Fragment() {
121
121
val isOpeningThread = threadUid != null
122
122
if (isOpeningThread) {
123
123
val hasOpened = slidingPaneLayout.openPaneNoAnimation()
124
- if (hasOpened) requireActivity().window. statusBarColor = requireContext().getColor( R .color.backgroundColor)
124
+ if (hasOpened) setSystemBarsColors( statusBarColor = R .color.backgroundColor, navigationBarColor = null )
125
125
} else {
126
126
resetPanes()
127
127
}
@@ -157,13 +157,15 @@ abstract class TwoPaneFragment : Fragment() {
157
157
}
158
158
}
159
159
160
- private fun resetPanes () = with (requireActivity()) {
160
+ private fun resetPanes () {
161
161
162
162
val hasClosed = slidingPaneLayout.closePaneNoAnimation()
163
163
164
164
if (hasClosed) {
165
- if (this @TwoPaneFragment is ThreadListFragment ) window.statusBarColor = getColor(R .color.backgroundHeaderColor)
166
- window.updateNavigationBarColor(getColor(R .color.backgroundColor))
165
+ setSystemBarsColors(
166
+ statusBarColor = if (this @TwoPaneFragment is ThreadListFragment ) R .color.backgroundHeaderColor else null ,
167
+ navigationBarColor = R .color.backgroundColor,
168
+ )
167
169
}
168
170
169
171
threadListAdapter.selectNewThread(newPosition = null , threadUid = null )
0 commit comments