mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 20:51:52 +01:00
Merge branch 'master' into MD2
This commit is contained in:
commit
f8eb0c0c27
@ -167,6 +167,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
setContentView(R.layout.reader_activity)
|
setContentView(R.layout.reader_activity)
|
||||||
|
|
||||||
|
setNotchCutoutMode()
|
||||||
|
|
||||||
if (presenter.needsInit()) {
|
if (presenter.needsInit()) {
|
||||||
val manga = intent.extras!!.getLong("manga", -1)
|
val manga = intent.extras!!.getLong("manga", -1)
|
||||||
val chapter = intent.extras!!.getLong("chapter", -1)
|
val chapter = intent.extras!!.getLong("chapter", -1)
|
||||||
@ -641,6 +643,22 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets notch cutout mode to "NEVER", if mobile is in a landscape view
|
||||||
|
*/
|
||||||
|
private fun setNotchCutoutMode() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||||
|
|
||||||
|
val currentOrientation = resources.configuration.orientation
|
||||||
|
|
||||||
|
if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
val params = window.attributes
|
||||||
|
params.layoutInDisplayCutoutMode =
|
||||||
|
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that handles the user preferences of the reader.
|
* Class that handles the user preferences of the reader.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user