diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index afbd7eb26..780000f4c 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -3,12 +3,14 @@ package io.legado.app.ui.readbook import android.app.Activity import android.content.Intent import android.net.Uri +import android.os.Build import android.os.Bundle import android.text.SpannableStringBuilder import android.view.KeyEvent import android.view.Menu import android.view.MenuItem import android.view.WindowManager +import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES import androidx.core.view.isVisible import androidx.lifecycle.Observer import io.legado.app.R @@ -61,6 +63,11 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea var readAloudStatus = Status.STOP override fun onActivityCreated(savedInstanceState: Bundle?) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + window.attributes = window.attributes.apply { + layoutInDisplayCutoutMode = LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES + } + } setSupportActionBar(toolbar) initView() page_view.callback = this