|
|
@ -2,6 +2,7 @@ package io.legado.app.ui.association |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
|
|
|
|
import android.content.DialogInterface |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.LayoutInflater |
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.MenuItem |
|
|
@ -37,10 +38,15 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
|
|
fun start(fragmentManager: FragmentManager, source: String) { |
|
|
|
fun start( |
|
|
|
|
|
|
|
fragmentManager: FragmentManager, |
|
|
|
|
|
|
|
source: String, |
|
|
|
|
|
|
|
finishOnDismiss: Boolean = false |
|
|
|
|
|
|
|
) { |
|
|
|
ImportBookSourceDialog().apply { |
|
|
|
ImportBookSourceDialog().apply { |
|
|
|
arguments = Bundle().apply { |
|
|
|
arguments = Bundle().apply { |
|
|
|
putString("source", source) |
|
|
|
putString("source", source) |
|
|
|
|
|
|
|
putBoolean("finishOnDismiss", finishOnDismiss) |
|
|
|
} |
|
|
|
} |
|
|
|
}.show(fragmentManager, "importBookSource") |
|
|
|
}.show(fragmentManager, "importBookSource") |
|
|
|
} |
|
|
|
} |
|
|
@ -67,6 +73,13 @@ class ImportBookSourceDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickList |
|
|
|
return inflater.inflate(R.layout.dialog_recycler_view, container) |
|
|
|
return inflater.inflate(R.layout.dialog_recycler_view, container) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onDismiss(dialog: DialogInterface) { |
|
|
|
|
|
|
|
super.onDismiss(dialog) |
|
|
|
|
|
|
|
if (arguments?.getBoolean("finishOnDismiss") == true) { |
|
|
|
|
|
|
|
activity?.finish() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { |
|
|
|
binding.toolBar.setTitle(R.string.import_book_source) |
|
|
|
binding.toolBar.setTitle(R.string.import_book_source) |
|
|
|
binding.rotateLoading.show() |
|
|
|
binding.rotateLoading.show() |
|
|
|