|
|
|
@ -9,7 +9,6 @@ import android.view.MenuItem |
|
|
|
|
import android.view.View |
|
|
|
|
import android.view.ViewGroup |
|
|
|
|
import androidx.appcompat.widget.Toolbar |
|
|
|
|
import androidx.fragment.app.FragmentManager |
|
|
|
|
import androidx.fragment.app.viewModels |
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
|
import io.legado.app.R |
|
|
|
@ -26,26 +25,21 @@ import io.legado.app.databinding.ItemSourceImportBinding |
|
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
|
import io.legado.app.lib.theme.primaryColor |
|
|
|
|
import io.legado.app.ui.widget.dialog.WaitDialog |
|
|
|
|
import io.legado.app.utils.* |
|
|
|
|
import io.legado.app.utils.dp |
|
|
|
|
import io.legado.app.utils.putPrefBoolean |
|
|
|
|
import io.legado.app.utils.splitNotBlank |
|
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
import io.legado.app.utils.visible |
|
|
|
|
|
|
|
|
|
class ImportReplaceRuleDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { |
|
|
|
|
class ImportReplaceRuleDialog() : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { |
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
|
|
|
|
|
|
fun start( |
|
|
|
|
fragmentManager: FragmentManager, |
|
|
|
|
source: String, |
|
|
|
|
finishOnDismiss: Boolean = false |
|
|
|
|
) { |
|
|
|
|
fragmentManager.showDialog<ImportReplaceRuleDialog> { |
|
|
|
|
constructor(source: String, finishOnDismiss: Boolean = false) : this() { |
|
|
|
|
arguments = Bundle().apply { |
|
|
|
|
putString("source", source) |
|
|
|
|
putBoolean("finishOnDismiss", finishOnDismiss) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private val binding by viewBinding(DialogRecyclerViewBinding::bind) |
|
|
|
|
private val viewModel by viewModels<ImportReplaceRuleViewModel>() |
|
|
|
|
private val adapter by lazy { SourcesAdapter(requireContext()) } |
|
|
|
|