-
Notifications
You must be signed in to change notification settings - Fork 164
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
Updates android-browser-helper and enables WebView fallback on config #126
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,10 @@ def twaManifest = [ | |
shortcuts: <%= generateShortcuts() %>, | ||
// The duration of fade out animation in milliseconds to be played when removing splash screen. | ||
splashScreenFadeOutDuration: <%= splashScreenFadeOutDuration %>, | ||
generatorApp: '<%= generatorApp %>' // Apllication that generated the Android Project | ||
generatorApp: '<%= generatorApp %>', // Apllication that generated the Android Project | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: type in "Apllication" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
// The fallback strategy for when Trusted Web Activity is not avilable. Possible values are | ||
// 'customtabs' and 'webview'. | ||
fallbackType: '<%= fallbackType %>' | ||
] | ||
|
||
android { | ||
|
@@ -110,6 +113,8 @@ android { | |
resValue "integer", "splashScreenFadeOutDuration", twaManifest.splashScreenFadeOutDuration.toString() | ||
|
||
resValue "string", "generatorApp", twaManifest.generatorApp | ||
|
||
resValue "string", "fallbackType", twaManifest.fallbackType | ||
} | ||
buildTypes { | ||
release { | ||
|
@@ -161,5 +166,5 @@ preBuild.dependsOn(generateShorcutsFile) | |
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:1.1.0' | ||
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:1.2.0' | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
the abbreviated format. --> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="<%= packageId %>"> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this get added in by Android Studio or do we need it for WebView? It's seems a little ugly including it even if we don't need WebView, but on the other hand it's not that much overhead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs to be added for the WebView to work on Android 9 and below. We could conditionally add it, only when the fallback is type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed the "could" on the text. Fixed that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's easy enough let's do it, I don't think it's blocking though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
<application | ||
android:allowBackup="true" | ||
|
@@ -70,6 +71,9 @@ | |
|
||
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts" /> | ||
|
||
<meta-data android:name="android.support.customtabs.trusted.FALLBACK_STRATEGY" | ||
android:value="@string/fallbackType" /> | ||
|
||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
|
@@ -86,6 +90,9 @@ | |
|
||
<activity android:name="com.google.androidbrowserhelper.trusted.FocusActivity" /> | ||
|
||
<activity android:name="com.google.androidbrowserhelper.trusted.WebViewFallbackActivity" | ||
android:configChanges="orientation|screenSize" /> | ||
|
||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="@string/providerAuthority" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test as well to check that
webview
works?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done