From a3f1b09da170daa8da52186c65e5a428a632c20e Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Fri, 26 May 2023 14:27:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20H5=E9=93=BE=E6=8E=A5=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E9=80=82=E9=85=8D=E4=BC=98=E5=8C=96=20https://jira.shanqu.cc/b?= =?UTF-8?q?rowse/GHZS-2450?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/halo/assistant/fragment/WebFragment.kt | 17 +++++++++++++++++ app/src/main/res/layout/fragment_web.xml | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt index 211a5f664e..42ab52f4cc 100644 --- a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt @@ -173,6 +173,10 @@ class WebFragment : LazyFragment(), IScrollable { closeBtn.visibility = View.VISIBLE closeBtn.setOnClickListener { requireActivity().finish() } } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + mBinding?.fullscreenContainer?.elevation = 10F.dip2px().toFloat() + mBinding?.closeBtn?.elevation = 11F.dip2px().toFloat() + } } else { initMenu() } @@ -461,6 +465,19 @@ class WebFragment : LazyFragment(), IScrollable { return true } + override fun onShowCustomView(view: View, callback: CustomViewCallback) { + super.onShowCustomView(view, callback) + fullscreenContainer.removeAllViews() + fullscreenContainer.visibility = View.VISIBLE + fullscreenContainer.addView(view) + } + + override fun onHideCustomView() { + super.onHideCustomView() + fullscreenContainer.visibility = View.GONE + fullscreenContainer.removeAllViews() + } + override fun onProgressChanged(view: WebView, newProgress: Int) { webProgressbar.progress = newProgress if (newProgress == 100) { diff --git a/app/src/main/res/layout/fragment_web.xml b/app/src/main/res/layout/fragment_web.xml index 32b24148c4..8b2e01cc78 100644 --- a/app/src/main/res/layout/fragment_web.xml +++ b/app/src/main/res/layout/fragment_web.xml @@ -12,6 +12,12 @@ android:layout_height="match_parent" android:fitsSystemWindows="true" /> + +