Fix: Fullscreen bug
This commit is contained in:
parent
c104bf32da
commit
1f90e21f68
|
@ -26,6 +26,7 @@ import org.libre.agosto.p2play.adapters.CommentariesAdapter
|
|||
import org.libre.agosto.p2play.ajax.Actions
|
||||
import org.libre.agosto.p2play.ajax.Comments
|
||||
import org.libre.agosto.p2play.ajax.Videos
|
||||
import org.libre.agosto.p2play.helpers.setFullscreen
|
||||
import org.libre.agosto.p2play.models.CommentaryModel
|
||||
import org.libre.agosto.p2play.models.VideoModel
|
||||
|
||||
|
@ -388,12 +389,7 @@ class ReproductorActivity : AppCompatActivity() {
|
|||
|
||||
this@ReproductorActivity.fullScreen.addView(paramView, FrameLayout.LayoutParams(match_parent, match_parent))
|
||||
|
||||
|
||||
val attrs = this@ReproductorActivity.window.attributes
|
||||
attrs.flags = attrs.flags or WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
attrs.flags = attrs.flags or WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||
window.attributes = attrs
|
||||
this@ReproductorActivity.window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LOW_PROFILE
|
||||
setFullscreen(this@ReproductorActivity.window)
|
||||
|
||||
this@ReproductorActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package org.libre.agosto.p2play.helpers
|
||||
|
||||
import android.view.View
|
||||
import android.view.Window
|
||||
import android.view.WindowManager
|
||||
|
||||
fun setFullscreen (window: Window) {
|
||||
val attrs = window.attributes
|
||||
attrs.flags = attrs.flags or WindowManager.LayoutParams.FLAG_FULLSCREEN
|
||||
attrs.flags = attrs.flags or WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
|
||||
window.attributes = attrs
|
||||
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
}
|
Loading…
Reference in New Issue