Skip to content

Commit

Permalink
Remove unnecessary cast
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Feb 1, 2024
1 parent eae1932 commit 20cba88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ abstract class TwoPaneFragment : Fragment() {
val hasOpened = slidingPaneLayout.openPaneNoAnimation()
if (hasOpened) {
updateDrawerLockMode()
(requireActivity() as MainActivity).window.statusBarColor = requireContext().getColor(R.color.backgroundColor)
requireActivity().window.statusBarColor = requireContext().getColor(R.color.backgroundColor)
}
} else {
resetPanes()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/infomaniak/mail/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fun Date.isLastWeek(): Boolean {
//region UI
fun Context.isInPortrait(): Boolean = resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT

private fun Context.canDisplayBothPanes(): Boolean = resources.getBoolean(R.bool.canDisplayBothPanes)
fun Context.canDisplayBothPanes(): Boolean = resources.getBoolean(R.bool.canDisplayBothPanes)
fun Fragment.canDisplayBothPanes(): Boolean = requireContext().canDisplayBothPanes()
fun Context.canDisplayOnlyOnePane(): Boolean = !canDisplayBothPanes()
fun Fragment.canDisplayOnlyOnePane(): Boolean = requireContext().canDisplayOnlyOnePane()
Expand Down

0 comments on commit 20cba88

Please sign in to comment.