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