From 5995350bb9ab44bce1130e8e5be9f1990d40d8b5 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 15 Apr 2020 20:47:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/book/read/config/TipConfigDialog.kt | 42 +++++++++++++++++++ app/src/main/res/layout/dialog_tip_config.xml | 6 +++ 2 files changed, 48 insertions(+) create mode 100644 app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt create mode 100644 app/src/main/res/layout/dialog_tip_config.xml diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt new file mode 100644 index 000000000..7e2774b67 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt @@ -0,0 +1,42 @@ +package io.legado.app.ui.book.read.config + +import android.os.Bundle +import android.util.DisplayMetrics +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import io.legado.app.R +import io.legado.app.base.BaseDialogFragment +import io.legado.app.ui.book.read.Help + +class TipConfigDialog : BaseDialogFragment() { + + override fun onStart() { + super.onStart() + val dm = DisplayMetrics() + activity?.let { + Help.upSystemUiVisibility(it) + it.windowManager?.defaultDisplay?.getMetrics(dm) + } + dialog?.window?.let { + val attr = it.attributes + attr.dimAmount = 0.0f + it.attributes = attr + it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return inflater.inflate(R.layout.dialog_tip_config, container) + } + + override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { + + } + + +} \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_tip_config.xml b/app/src/main/res/layout/dialog_tip_config.xml new file mode 100644 index 000000000..77d9ef65f --- /dev/null +++ b/app/src/main/res/layout/dialog_tip_config.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file