From f9841c4a709821a870458b9a6730d50ed1d53c0d Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 21 Aug 2019 19:19:31 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/readbook/config/ReadStyleDialog.kt | 6 +++++- app/src/main/res/layout/dialog_read_book_style.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt index bd49296ab..ef10c357c 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/config/ReadStyleDialog.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.readbook.config import android.os.Bundle import android.util.DisplayMetrics +import android.view.Gravity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -33,10 +34,13 @@ class ReadStyleDialog : DialogFragment() { val dm = DisplayMetrics() activity?.windowManager?.defaultDisplay?.getMetrics(dm) dialog?.window?.let { + it.setBackgroundDrawableResource(R.color.transparent) + it.decorView.setPadding(0, 0, 0, 0) val attr = it.attributes attr.dimAmount = 0.0f + attr.gravity = Gravity.BOTTOM it.attributes = attr - it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) + it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } } diff --git a/app/src/main/res/layout/dialog_read_book_style.xml b/app/src/main/res/layout/dialog_read_book_style.xml index f14268b6e..83fc3f585 100644 --- a/app/src/main/res/layout/dialog_read_book_style.xml +++ b/app/src/main/res/layout/dialog_read_book_style.xml @@ -4,6 +4,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@color/background" android:padding="10dp">