-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: open in web view. Add all the logic required to delegate a URL to be opened by a web view. Currently, only the WebView custom configurations are performed, nothing UI-related. Add a new Router Adapter for WebViow. The new 'OSIABOptions' manages the data that is used by both SystemBrowser and WebView. Each has a class to implement its needs. Add two SwiftUI views to display the WebView: A wrapper that manages unhappy paths and the proper view to display a browser-like experience. Add a Cache Manager protocol and implementation so that WebView can perform clearance when applicable. Add unit tests to test the feature. SonarCloud configuration is updated to exclude UI views. Add the event listener logic for Page Load and Close. Add 'CHANGELOG' entries. References: https://outsystemsrd.atlassian.net/browse/RMET-3425 References: https://outsystemsrd.atlassian.net/browse/RMET-3430 * feat: add interface customisations to webview Add the UI customisations to the WebView interface. This involves a new Navigation View to deal with shared views by the toolbars. Create two new structs for WebView configuration. Add unit tests to test the new features. The WebView also contains Previews to validate all possible UI scenarios. References: https://outsystemsrd.atlassian.net/browse/RMET-3489
- Loading branch information
1 parent
dd3f26c
commit c6c04cb
Showing
30 changed files
with
1,929 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/// Enumerator that holds all possible values for the WebView's toolbar position. | ||
public enum OSIABToolbarPosition: String { | ||
case top = "TOP" | ||
case bottom = "BOTTOM" | ||
|
||
/// Default value to consider in the absence of value. | ||
public static let defaultValue: Self = .top | ||
} |
41 changes: 41 additions & 0 deletions
41
OSInAppBrowserLib/Models/OSIABWebViewConfigurationModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import WebKit | ||
|
||
/// Collection of properties with which to initialize the WebView. | ||
struct OSIABWebViewConfigurationModel { | ||
/// Indicates if HTML5 audio or video should be prevented from being autoplayed. | ||
private let mediaTypesRequiringUserActionForPlayback: WKAudiovisualMediaTypes | ||
/// Indicates if scaling through a meta tag should be prevented. | ||
private let ignoresViewportScaleLimits: Bool | ||
/// Indicates if in-line HTML5 media playback should be enabled. | ||
private let allowsInlineMediaPlayback: Bool | ||
/// Indicates if the rendering should wait until all new view content is received. | ||
private let suppressesIncrementalRendering: Bool | ||
|
||
/// Constructor method. | ||
/// - Parameters: | ||
/// - mediaTypesRequiringUserActionForPlayback: Indicates if HTML5 audio or video should be prevented from being autoplayed. Defaults to nothing being autoplayed. | ||
/// - ignoresViewportScaleLimits: Indicates if scaling through a meta tag should be prevented. Defaults to `false`. | ||
/// - allowsInlineMediaPlayback: Indicates if in-line HTML5 media playback should be enabled. Defaults to `false` | ||
/// - suppressesIncrementalRendering: Indicates if the rendering should wait until all new view content is received. Defaults to `false`. | ||
init( | ||
_ mediaTypesRequiringUserActionForPlayback: WKAudiovisualMediaTypes = [], | ||
_ ignoresViewportScaleLimits: Bool = false, | ||
_ allowsInlineMediaPlayback: Bool = false, | ||
_ suppressesIncrementalRendering: Bool = false | ||
) { | ||
self.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback | ||
self.ignoresViewportScaleLimits = ignoresViewportScaleLimits | ||
self.allowsInlineMediaPlayback = allowsInlineMediaPlayback | ||
self.suppressesIncrementalRendering = suppressesIncrementalRendering | ||
} | ||
|
||
/// Creates a `WKWebViewConfiguration` object with all the model's properties. | ||
func toWebViewConfiguration() -> WKWebViewConfiguration { | ||
let configuration = WKWebViewConfiguration() | ||
configuration.mediaTypesRequiringUserActionForPlayback = mediaTypesRequiringUserActionForPlayback | ||
configuration.ignoresViewportScaleLimits = ignoresViewportScaleLimits | ||
configuration.allowsInlineMediaPlayback = allowsInlineMediaPlayback | ||
configuration.suppressesIncrementalRendering = suppressesIncrementalRendering | ||
return configuration | ||
} | ||
} |
Oops, something went wrong.