diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b0a3c9..fd9db1f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### Next Release +* Fix: Password Reset button doesn’t work +* Fix: After the login is succeeded, you can never go back to the app automatically + ### 2.7.4 * Fix: Inpage text is not appropriate when the size is recommended * Fix: Inpage text for on-boarding user has 2 patterns at random diff --git a/virtusize/src/main/java/com/virtusize/android/ui/VirtusizeWebViewFragment.kt b/virtusize/src/main/java/com/virtusize/android/ui/VirtusizeWebViewFragment.kt index 71b389d6..cd0e3ad5 100644 --- a/virtusize/src/main/java/com/virtusize/android/ui/VirtusizeWebViewFragment.kt +++ b/virtusize/src/main/java/com/virtusize/android/ui/VirtusizeWebViewFragment.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Context import android.content.DialogInterface import android.content.Intent +import android.graphics.Color import android.net.Uri import android.os.Build import android.os.Bundle @@ -148,41 +149,51 @@ class VirtusizeWebViewFragment : DialogFragment() { resultMsg: Message, ): Boolean { if (resultMsg.obj != null && resultMsg.obj is WebView.WebViewTransport) { - val popupWebView = WebView(view.context) - popupWebView.settings.javaScriptEnabled = true - popupWebView.settings.javaScriptCanOpenWindowsAutomatically = true - popupWebView.settings.setSupportMultipleWindows(true) - popupWebView.settings.userAgentString = System.getProperty("http.agent") - popupWebView.webViewClient = - object : WebViewClient() { - override fun shouldOverrideUrlLoading( - view: WebView, - url: String, - ): Boolean { - if (VirtusizeURLCheck.isExternalLinkFromVirtusize(url)) { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) - try { - startActivity(intent) - } finally { - return true + val popupWebView = + WebView(view.context).apply { + setBackgroundColor(Color.TRANSPARENT) + layoutParams = + ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + ViewGroup.LayoutParams.MATCH_PARENT, + ) + settings.javaScriptEnabled = true + settings.javaScriptCanOpenWindowsAutomatically = true + settings.setSupportMultipleWindows(true) + settings.setDomStorageEnabled(true) + settings.userAgentString = System.getProperty("http.agent") + webViewClient = + object : WebViewClient() { + override fun shouldOverrideUrlLoading( + view: WebView, + url: String, + ): Boolean { + if (VirtusizeURLCheck.isExternalLinkFromVirtusize(url)) { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) + try { + startActivity(intent) + } finally { + return true + } + } + if (showSNSButtons) { + return VirtusizeAuth.isSNSAuthUrl( + requireContext(), + virtusizeSNSAuthLauncher, + url, + ) + } + return false } } - if (showSNSButtons) { - return VirtusizeAuth.isSNSAuthUrl( - requireContext(), - virtusizeSNSAuthLauncher, - url, - ) + webChromeClient = + object : WebChromeClient() { + override fun onCloseWindow(window: WebView) { + binding.webView.removeAllViews() + } } - return false - } - } - popupWebView.webChromeClient = - object : WebChromeClient() { - override fun onCloseWindow(window: WebView) { - binding.webView.removeAllViews() - } } + val transport = resultMsg.obj as WebView.WebViewTransport binding.webView.addView(popupWebView) transport.webView = popupWebView