pull/32/head
kunfei 5 years ago
parent da6369f87b
commit f9841c4a70
  1. 6
      app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt
  2. 1
      app/src/main/res/layout/dialog_read_book_style.xml

@ -2,6 +2,7 @@ package io.legado.app.ui.readbook.config
import android.os.Bundle import android.os.Bundle
import android.util.DisplayMetrics import android.util.DisplayMetrics
import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -33,10 +34,13 @@ class ReadStyleDialog : DialogFragment() {
val dm = DisplayMetrics() val dm = DisplayMetrics()
activity?.windowManager?.defaultDisplay?.getMetrics(dm) activity?.windowManager?.defaultDisplay?.getMetrics(dm)
dialog?.window?.let { dialog?.window?.let {
it.setBackgroundDrawableResource(R.color.transparent)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes val attr = it.attributes
attr.dimAmount = 0.0f attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr it.attributes = attr
it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
} }
} }

@ -4,6 +4,7 @@
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/background"
android:padding="10dp"> android:padding="10dp">
<View <View

Loading…
Cancel
Save