feat: H5链接游戏适配优化 https://jira.shanqu.cc/browse/GHZS-2450
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user