Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended webview checks #389

Merged
merged 4 commits into from
May 20, 2021

Conversation

nielsvanvelzen
Copy link
Member

Fixes #383

Adds an additional button to open the webview settings, it allows changing the used webview more easily. User needs to manually open the app again after changing it.
For the second alert (outdated webview) pressing on the background will cancel the dialog and never show it again. Adding an additional button was too much work because I'd need to make my own layout for it.

image
image
note: this one actually says "open settings" instead of "settings" but I was too lazy to re-capture

@Maxr1998 Maxr1998 self-requested a review May 14, 2021 21:29
@Maxr1998 Maxr1998 added this to In progress in v2.3.0 via automation May 14, 2021
@Maxr1998 Maxr1998 added the enhancement New feature or request label May 14, 2021
Comment on lines 116 to 117
appPreferences.ignoreWebViewChecks = false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging left-overs?

Suggested change
appPreferences.ignoreWebViewChecks = false

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@nielsvanvelzen
Copy link
Member Author

image
Updated screenshot

@Maxr1998
Copy link
Member

Maybe the "ignore" should be at the bottom?

@nielsvanvelzen
Copy link
Member Author

image

@@ -56,13 +59,20 @@ class MainActivity : AppCompatActivity() {
bindService(Intent(this, RemotePlayerService::class.java), serviceConnection, Service.BIND_AUTO_CREATE)

// Check WebView support
if (!isWebViewSupported()) {
if (!appPreferences.ignoreWebViewChecks && !isWebViewSupported()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It already checks for ignore here, but there's no way to ignore from the "unsupported" dialog below.. seems like an oversight?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should definitely not work on the app when I'm half asleep 😅

@nielsvanvelzen
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@CarlosOlivo
Copy link
Contributor

You forgot to handle the note, also necessary for devices without gapps (or alternative store like Aurora Store || F-Droid).

In some cases, a matching Activity may not exist, so ensure you safeguard against this.

android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.webview (has extras) }
	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2067)
	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1727)
	at android.app.Activity.startActivityForResult(Activity.java:5320)
	at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
	at android.app.Activity.startActivityForResult(Activity.java:5278)
	at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:560)
	at android.app.Activity.startActivity(Activity.java:5664)
	at androidx.core.content.ContextCompat.startActivity(ContextCompat.java:251)
	at androidx.fragment.app.FragmentHostCallback.onStartActivityFromFragment(FragmentHostCallback.java:166)
	at androidx.fragment.app.Fragment.startActivity(Fragment.java:1377)
	at androidx.fragment.app.Fragment.startActivity(Fragment.java:1365)
	at org.jellyfin.mobile.fragment.WebViewFragment.initialize$lambda-9$lambda-6(WebViewFragment.kt:161)
	at org.jellyfin.mobile.fragment.WebViewFragment.lambda$Pt7vAIcI7Sig4ZNp7P1oGVz8n9g(Unknown Source:0)
	at org.jellyfin.mobile.fragment.-$$Lambda$WebViewFragment$Pt7vAIcI7Sig4ZNp7P1oGVz8n9g.onClick(Unknown Source:6)
	at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

@nielsvanvelzen
Copy link
Member Author

Thanks @CarlosOlivo, added an additional check to see if the intent can be resolved 👍

Maxr1998
Maxr1998 previously approved these changes May 20, 2021
}

// Only show button if the intent can be resolved
if(marketIntent.resolveActivity(context.packageManager) != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(marketIntent.resolveActivity(context.packageManager) != null) {
if (marketIntent.resolveActivity(context.packageManager) != null) {

@Maxr1998 Maxr1998 merged commit dd8a2e9 into jellyfin:master May 20, 2021
v2.3.0 automation moved this from In progress to Done May 20, 2021
@nielsvanvelzen nielsvanvelzen deleted the extended-webview-checks branch May 21, 2021 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Webview is too old, but I just installed ROM and GApps (2.3.0-beta1)
3 participants