From 7b493fca8f5755ed0016f5cda9810eccd9b0455e Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Tue, 20 Jul 2021 17:07:33 -0400 Subject: [PATCH] Android 12: Recents URL sharing for webview urls --- .../eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt index 39a2a0ea71..303f00c531 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/BaseWebViewActivity.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.webview +import android.app.assist.AssistContent import android.content.res.Configuration import android.graphics.Color import android.os.Build @@ -11,6 +12,7 @@ import android.webkit.WebChromeClient import android.webkit.WebView import android.widget.LinearLayout import androidx.core.graphics.ColorUtils +import androidx.core.net.toUri import androidx.core.view.isInvisible import androidx.core.view.isVisible import eu.kanade.tachiyomi.R @@ -136,6 +138,11 @@ open class BaseWebViewActivity : BaseActivity() { } } + override fun onProvideAssistContent(outContent: AssistContent?) { + super.onProvideAssistContent(outContent) + binding.webview.url?.let { outContent?.webUri = it.toUri() } + } + private fun refreshPage() { binding.swipeRefresh.isRefreshing = true binding.webview.reload()