Skip to content

Commit

Permalink
Merge pull request #4398 from Bnyro/master
Browse files Browse the repository at this point in the history
feat: hide status bar if player locked
  • Loading branch information
Bnyro authored Aug 7, 2023
2 parents a623404 + b42bcf6 commit 55bd880
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.os.postDelayed
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.view.marginStart
Expand Down Expand Up @@ -47,6 +48,7 @@ import com.github.libretube.helpers.PlayerHelper
import com.github.libretube.helpers.PreferenceHelper
import com.github.libretube.obj.BottomSheetItem
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.PlayerOptions
import com.github.libretube.ui.listeners.PlayerGestureController
Expand Down Expand Up @@ -138,6 +140,11 @@ open class CustomExoPlayerView(

// change locked status
isPlayerLocked = !isPlayerLocked

activity.toggleSystemBars(
types = WindowInsetsCompat.Type.statusBars(),
showBars = !isPlayerLocked
)
}

resizeMode = when (resizeModePref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class OnlinePlayerView(
// Show status bar only not navigation bar if the player controls are visible and hide it otherwise
activity.toggleSystemBars(
types = WindowInsetsCompat.Type.statusBars(),
showBars = visibility == View.VISIBLE
showBars = visibility == View.VISIBLE && !isPlayerLocked
)
}
}
Expand Down

0 comments on commit 55bd880

Please sign in to comment.