From e6776a4c2a604c02a09527a8fc38373116a5f317 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 5 Dec 2019 09:44:27 +0800 Subject: [PATCH] up --- .../app/ui/changecover/ChangeCoverDialog.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverDialog.kt b/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverDialog.kt index ad94edb17..4a283e463 100644 --- a/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverDialog.kt +++ b/app/src/main/java/io/legado/app/ui/changecover/ChangeCoverDialog.kt @@ -1,11 +1,18 @@ package io.legado.app.ui.changecover +import android.os.Bundle import android.util.DisplayMetrics +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup import androidx.fragment.app.DialogFragment +import io.legado.app.R +import io.legado.app.utils.getViewModel class ChangeCoverDialog : DialogFragment() { + private lateinit var viewModel: ChangeCoverViewModel override fun onStart() { super.onStart() @@ -14,5 +21,14 @@ class ChangeCoverDialog : DialogFragment() { dialog?.window?.setLayout((dm.widthPixels * 0.9).toInt(), (dm.heightPixels * 0.9).toInt()) } + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + viewModel = getViewModel(ChangeCoverViewModel::class.java) + return inflater.inflate(R.layout.dialog_change_source, container) + } + } \ No newline at end of file