|
@@ -6,6 +6,7 @@ import android.view.ViewGroup
|
|
import androidx.core.view.isVisible
|
|
import androidx.core.view.isVisible
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
import coil.loadAny
|
|
import coil.loadAny
|
|
|
|
+import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
|
import eu.kanade.tachiyomi.R
|
|
import eu.kanade.tachiyomi.R
|
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
|
import eu.kanade.tachiyomi.data.database.models.Manga
|
|
import eu.kanade.tachiyomi.data.track.TrackManager
|
|
import eu.kanade.tachiyomi.data.track.TrackManager
|
|
@@ -177,16 +178,34 @@ class MangaInfoHeaderAdapter(
|
|
|
|
|
|
binding.mangaCover.longClicks()
|
|
binding.mangaCover.longClicks()
|
|
.onEach {
|
|
.onEach {
|
|
- controller.activity?.copyToClipboard(
|
|
|
|
- view.context.getString(R.string.title),
|
|
|
|
- controller.presenter.manga.title
|
|
|
|
- )
|
|
|
|
|
|
+ showCoverOptionsDialog()
|
|
}
|
|
}
|
|
.launchIn(controller.viewScope)
|
|
.launchIn(controller.viewScope)
|
|
|
|
|
|
setMangaInfo(manga, source)
|
|
setMangaInfo(manga, source)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private fun showCoverOptionsDialog() {
|
|
|
|
+ val options = listOfNotNull(
|
|
|
|
+ R.string.action_share,
|
|
|
|
+ R.string.action_save,
|
|
|
|
+ // Can only edit cover for library manga
|
|
|
|
+ if (manga.favorite) R.string.action_edit else null
|
|
|
|
+ ).map(controller.activity!!::getString).toTypedArray()
|
|
|
|
+
|
|
|
|
+ MaterialAlertDialogBuilder(controller.activity!!)
|
|
|
|
+ .setTitle(R.string.manga_cover)
|
|
|
|
+ .setItems(options) { _, item ->
|
|
|
|
+ when (item) {
|
|
|
|
+ 0 -> controller.shareCover()
|
|
|
|
+ 1 -> controller.saveCover()
|
|
|
|
+ 2 -> controller.changeCover()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .setNegativeButton(android.R.string.cancel, null)
|
|
|
|
+ .show()
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Update the view with manga information.
|
|
* Update the view with manga information.
|
|
*
|
|
*
|