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" /> + +