From 213df1e0e2c6efad380c0b538441662f97e682fa Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 23 Aug 2019 17:40:28 +0800 Subject: [PATCH] up --- .../app/ui/readbook/config/MoreConfigDialog.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/config/MoreConfigDialog.kt b/app/src/main/java/io/legado/app/ui/readbook/config/MoreConfigDialog.kt index 479ce5969..4e9676a1a 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/config/MoreConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/config/MoreConfigDialog.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 @@ -19,6 +20,7 @@ class MoreConfigDialog : DialogFragment() { savedInstanceState: Bundle? ): View? { val view = LinearLayout(context) + view.setBackgroundResource(R.color.background) view.id = R.id.tag1 container?.addView(view) return view @@ -28,7 +30,15 @@ class MoreConfigDialog : DialogFragment() { super.onStart() val dm = DisplayMetrics() activity?.windowManager?.defaultDisplay?.getMetrics(dm) - dialog?.window?.setLayout((dm.widthPixels * 0.9).toInt(), (dm.heightPixels * 0.9).toInt()) + 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(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + } } override fun onViewCreated(view: View, savedInstanceState: Bundle?) {