From ebbc4b7325790bc9dec67fe0d479cfa6e3bf6b1a Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 29 Aug 2019 22:47:33 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) 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