From 1f7d2f72f5bcedae99d55ece1a0220a2a15c8fac Mon Sep 17 00:00:00 2001 From: Avinash Sharma Date: Wed, 1 Jan 2025 22:27:37 +0530 Subject: [PATCH] htmlgames: smoother games (fixes #4927) --- .../org/ole/planet/myplanet/ui/viewer/WebViewActivity.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/viewer/WebViewActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/viewer/WebViewActivity.kt index c0b529fe92..59d46f3ca0 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/viewer/WebViewActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/viewer/WebViewActivity.kt @@ -1,5 +1,6 @@ package org.ole.planet.myplanet.ui.viewer +import android.content.pm.ActivityInfo import android.graphics.Bitmap import android.net.Uri import android.os.Build @@ -27,15 +28,17 @@ class WebViewActivity : AppCompatActivity() { fromDeepLink = !TextUtils.isEmpty(dataFromDeepLink) val title: String? = intent.getStringExtra("title") link = intent.getStringExtra("link") ?: "" + if (title == "2048") { + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + } else { + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED + } clearCookie() if (!TextUtils.isEmpty(title)) { activityWebViewBinding.contentWebView.webTitle.text = title } activityWebViewBinding.contentWebView.pBar.max = 100 activityWebViewBinding.contentWebView.pBar.progress = 0 - setListeners() - setupWebView() - activityWebViewBinding.contentWebView.wv.loadUrl(link) activityWebViewBinding.contentWebView.finish.setOnClickListener { finish() } setWebClient() }