diff --git a/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt index 4e362e180d..2779429a3c 100644 --- a/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt +++ b/app/src/main/java/com/github/libretube/helpers/ThemeHelper.kt @@ -14,6 +14,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.core.text.HtmlCompat import androidx.core.text.parseAsHtml +import androidx.core.view.WindowCompat import com.github.libretube.R import com.github.libretube.constants.PreferenceKeys import com.github.libretube.ui.adapters.IconsSheetAdapter @@ -40,6 +41,8 @@ object ThemeHelper { } else { getThemeColor(context, android.R.attr.colorBackground) } + WindowCompat.getInsetsController(window, window.decorView) + .isAppearanceLightStatusBars = !isDarkMode(context) } /** diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index ebda3c5074..ad5a3908c3 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -82,6 +82,7 @@ import com.github.libretube.helpers.PlayerHelper.getVideoStats import com.github.libretube.helpers.PlayerHelper.isInSegment import com.github.libretube.helpers.PreferenceHelper import com.github.libretube.helpers.ProxyHelper +import com.github.libretube.helpers.ThemeHelper import com.github.libretube.helpers.WindowHelper import com.github.libretube.obj.PlayerNotificationData import com.github.libretube.obj.ShareData @@ -692,12 +693,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { @SuppressLint("SourceLockedOrientationActivity") fun unsetFullscreen() { // set status bar icon color back to theme color - windowInsetsControllerCompat.isAppearanceLightStatusBars = - when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) { - Configuration.UI_MODE_NIGHT_YES -> false - Configuration.UI_MODE_NIGHT_NO -> true - else -> true - } + windowInsetsControllerCompat.isAppearanceLightStatusBars = !ThemeHelper.isDarkMode(requireContext()) viewModel.isFullscreen.value = false