mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-06 01:20:29 +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.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.text.HtmlCompat
|
import androidx.core.text.HtmlCompat
|
||||||
import androidx.core.text.parseAsHtml
|
import androidx.core.text.parseAsHtml
|
||||||
|
import androidx.core.view.WindowCompat
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.constants.PreferenceKeys
|
import com.github.libretube.constants.PreferenceKeys
|
||||||
import com.github.libretube.ui.adapters.IconsSheetAdapter
|
import com.github.libretube.ui.adapters.IconsSheetAdapter
|
||||||
@ -40,6 +41,8 @@ object ThemeHelper {
|
|||||||
} else {
|
} else {
|
||||||
getThemeColor(context, android.R.attr.colorBackground)
|
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.PlayerHelper.isInSegment
|
||||||
import com.github.libretube.helpers.PreferenceHelper
|
import com.github.libretube.helpers.PreferenceHelper
|
||||||
import com.github.libretube.helpers.ProxyHelper
|
import com.github.libretube.helpers.ProxyHelper
|
||||||
|
import com.github.libretube.helpers.ThemeHelper
|
||||||
import com.github.libretube.helpers.WindowHelper
|
import com.github.libretube.helpers.WindowHelper
|
||||||
import com.github.libretube.obj.PlayerNotificationData
|
import com.github.libretube.obj.PlayerNotificationData
|
||||||
import com.github.libretube.obj.ShareData
|
import com.github.libretube.obj.ShareData
|
||||||
@ -692,12 +693,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
@SuppressLint("SourceLockedOrientationActivity")
|
@SuppressLint("SourceLockedOrientationActivity")
|
||||||
fun unsetFullscreen() {
|
fun unsetFullscreen() {
|
||||||
// set status bar icon color back to theme color
|
// set status bar icon color back to theme color
|
||||||
windowInsetsControllerCompat.isAppearanceLightStatusBars =
|
windowInsetsControllerCompat.isAppearanceLightStatusBars = !ThemeHelper.isDarkMode(requireContext())
|
||||||
when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) {
|
|
||||||
Configuration.UI_MODE_NIGHT_YES -> false
|
|
||||||
Configuration.UI_MODE_NIGHT_NO -> true
|
|
||||||
else -> true
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.isFullscreen.value = false
|
viewModel.isFullscreen.value = false
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user