mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
Merge pull request #6080 from Bnyro/master
fix: explicitely set status bar color after app start
This commit is contained in:
commit
aa40047b4d
@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user