This commit is contained in:
chenjuntao
2023-05-26 14:27:10 +08:00
parent 1798dfb64d
commit a3f1b09da1
2 changed files with 23 additions and 0 deletions

View File

@ -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) {

View File

@ -12,6 +12,12 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true" />
<FrameLayout
android:id="@+id/fullscreen_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<com.gh.gamecenter.common.view.NestedScrollWebView2
android:id="@+id/webview"
android:layout_width="match_parent"