mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 21:59:15 +01:00
Copy source ID to clipboard when long pressing source in migrate list (closes #6479)
This commit is contained in:
parent
b459234ddc
commit
879dacfba6
@ -14,12 +14,14 @@ import eu.kanade.tachiyomi.databinding.MigrationSourcesControllerBinding
|
|||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrationMangaController
|
import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrationMangaController
|
||||||
|
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||||
import uy.kohesive.injekt.injectLazy
|
import uy.kohesive.injekt.injectLazy
|
||||||
|
|
||||||
class MigrationSourcesController :
|
class MigrationSourcesController :
|
||||||
NucleusController<MigrationSourcesControllerBinding, MigrationSourcesPresenter>(),
|
NucleusController<MigrationSourcesControllerBinding, MigrationSourcesPresenter>(),
|
||||||
FlexibleAdapter.OnItemClickListener {
|
FlexibleAdapter.OnItemClickListener,
|
||||||
|
FlexibleAdapter.OnItemLongClickListener {
|
||||||
|
|
||||||
private val preferences: PreferencesHelper by injectLazy()
|
private val preferences: PreferencesHelper by injectLazy()
|
||||||
|
|
||||||
@ -103,6 +105,12 @@ class MigrationSourcesController :
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onItemLongClick(position: Int) {
|
||||||
|
val item = adapter?.getItem(position) as? SourceItem ?: return
|
||||||
|
val sourceId = item.source.id.toString()
|
||||||
|
activity?.copyToClipboard(sourceId, sourceId)
|
||||||
|
}
|
||||||
|
|
||||||
enum class DirectionSetting {
|
enum class DirectionSetting {
|
||||||
ASCENDING,
|
ASCENDING,
|
||||||
DESCENDING;
|
DESCENDING;
|
||||||
|
Loading…
Reference in New Issue
Block a user