Send manga/chapter/page details when sharing a chapter page

(cherry picked from commit 004e1c98ee27881f1d70b0b74a912eee81b37e94)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt
This commit is contained in:
Jay 2020-05-23 04:07:36 -04:00 committed by Jobobby04
parent 573768482f
commit 2583be9923
2 changed files with 2 additions and 3 deletions

View File

@ -861,11 +861,9 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
val manga = presenter.manga ?: return val manga = presenter.manga ?: return
val chapter = page.chapter.chapter val chapter = page.chapter.chapter
val text = "${manga.title}: ${chapter.name}, ${getString(R.string.chapter_progress, page.number)}"
val stream = file.getUriCompat(this) val stream = file.getUriCompat(this)
val intent = Intent(Intent.ACTION_SEND).apply { val intent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_TEXT, text) putExtra(Intent.EXTRA_TEXT, getString(R.string.share_page_info, manga.title, chapter.name, page.number))
putExtra(Intent.EXTRA_STREAM, stream) putExtra(Intent.EXTRA_STREAM, stream)
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION
type = "image/*" type = "image/*"

View File

@ -575,6 +575,7 @@
<string name="custom_filter">Custom filter</string> <string name="custom_filter">Custom filter</string>
<string name="set_as_cover">Set as cover</string> <string name="set_as_cover">Set as cover</string>
<string name="cover_updated">Cover updated</string> <string name="cover_updated">Cover updated</string>
<string name="share_page_info">%1$s: %2$s, page %3$d</string>
<string name="page_downloaded">Page copied to %1$s</string> <string name="page_downloaded">Page copied to %1$s</string>
<string name="downloading">Downloading…</string> <string name="downloading">Downloading…</string>
<string name="download_progress">Downloaded %1$d%%</string> <string name="download_progress">Downloaded %1$d%%</string>