mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #4398 from Bnyro/master
feat: hide status bar if player locked
This commit is contained in:
commit
55bd88076d
@ -18,6 +18,7 @@ import androidx.appcompat.app.AppCompatActivity
|
|||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.os.postDelayed
|
import androidx.core.os.postDelayed
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.marginStart
|
import androidx.core.view.marginStart
|
||||||
@ -47,6 +48,7 @@ import com.github.libretube.helpers.PlayerHelper
|
|||||||
import com.github.libretube.helpers.PreferenceHelper
|
import com.github.libretube.helpers.PreferenceHelper
|
||||||
import com.github.libretube.obj.BottomSheetItem
|
import com.github.libretube.obj.BottomSheetItem
|
||||||
import com.github.libretube.ui.base.BaseActivity
|
import com.github.libretube.ui.base.BaseActivity
|
||||||
|
import com.github.libretube.ui.extensions.toggleSystemBars
|
||||||
import com.github.libretube.ui.interfaces.PlayerGestureOptions
|
import com.github.libretube.ui.interfaces.PlayerGestureOptions
|
||||||
import com.github.libretube.ui.interfaces.PlayerOptions
|
import com.github.libretube.ui.interfaces.PlayerOptions
|
||||||
import com.github.libretube.ui.listeners.PlayerGestureController
|
import com.github.libretube.ui.listeners.PlayerGestureController
|
||||||
@ -138,6 +140,11 @@ open class CustomExoPlayerView(
|
|||||||
|
|
||||||
// change locked status
|
// change locked status
|
||||||
isPlayerLocked = !isPlayerLocked
|
isPlayerLocked = !isPlayerLocked
|
||||||
|
|
||||||
|
activity.toggleSystemBars(
|
||||||
|
types = WindowInsetsCompat.Type.statusBars(),
|
||||||
|
showBars = !isPlayerLocked
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
resizeMode = when (resizeModePref) {
|
resizeMode = when (resizeModePref) {
|
||||||
|
@ -129,7 +129,7 @@ class OnlinePlayerView(
|
|||||||
// Show status bar only not navigation bar if the player controls are visible and hide it otherwise
|
// Show status bar only not navigation bar if the player controls are visible and hide it otherwise
|
||||||
activity.toggleSystemBars(
|
activity.toggleSystemBars(
|
||||||
types = WindowInsetsCompat.Type.statusBars(),
|
types = WindowInsetsCompat.Type.statusBars(),
|
||||||
showBars = visibility == View.VISIBLE
|
showBars = visibility == View.VISIBLE && !isPlayerLocked
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user