mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Send manga/chapter/page details when sharing a chapter page
This commit is contained in:
		| @@ -580,9 +580,13 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>() | ||||
|      * Called from the presenter when a page is ready to be shared. It shows Android's default | ||||
|      * sharing tool. | ||||
|      */ | ||||
|     fun onShareImageResult(file: File) { | ||||
|     fun onShareImageResult(file: File, page: ReaderPage) { | ||||
|         val manga = presenter.manga ?: return | ||||
|         val chapter = page.chapter.chapter | ||||
|  | ||||
|         val stream = file.getUriCompat(this) | ||||
|         val intent = Intent(Intent.ACTION_SEND).apply { | ||||
|             putExtra(Intent.EXTRA_TEXT, getString(R.string.share_page_info, manga.title, chapter.name, page.number)) | ||||
|             putExtra(Intent.EXTRA_STREAM, stream) | ||||
|             flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_GRANT_READ_URI_PERMISSION | ||||
|             type = "image/*" | ||||
|   | ||||
| @@ -569,7 +569,7 @@ class ReaderPresenter( | ||||
|             .subscribeOn(Schedulers.io()) | ||||
|             .observeOn(AndroidSchedulers.mainThread()) | ||||
|             .subscribeFirst( | ||||
|                 { view, file -> view.onShareImageResult(file) }, | ||||
|                 { view, file -> view.onShareImageResult(file, page) }, | ||||
|                 { _, _ -> /* Empty */ } | ||||
|             ) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user