diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /mobile/android/android-components/components/browser/engine-system/README.md | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/android-components/components/browser/engine-system/README.md')
-rw-r--r-- | mobile/android/android-components/components/browser/engine-system/README.md | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/mobile/android/android-components/components/browser/engine-system/README.md b/mobile/android/android-components/components/browser/engine-system/README.md new file mode 100644 index 0000000000..e49a486156 --- /dev/null +++ b/mobile/android/android-components/components/browser/engine-system/README.md @@ -0,0 +1,58 @@ +# [Android Components](../../../README.md) > Browser > Engine-System + +[*Engine*](../../concept/engine/README.md) implementation based on the system's WebView. + +## Usage + +See [concept-engine](../../concept/engine/README.md) for a documentation of the abstract engine API this component implements. + +### Setting up the dependency + +Use Gradle to download the library from [maven.mozilla.org](https://maven.mozilla.org/) ([Setup repository](../../../README.md#maven-repository)): + +```Groovy +implementation "org.mozilla.components:browser-engine-system:{latest-version}" +``` + +### Initializing + +It is recommended t create only one `SystemEngine` instance per app. + +```Kotlin +// Create default settings (optional) and enable tracking protection for all future sessions. +val defaultSettings = DefaultSettings().apply { + trackingProtectionPolicy = EngineSession.TrackingProtectionPolicy.all() +} + +// Create an engine instance to be used by other components. +val engine = SystemEngine(context, defaultSettings) +``` + +### Integration + +Usually it is not needed to interact with the `Engine` component directly. The [browser-session](../session/README.md) component will take care of making the state accessible and link a `Session` to an `EngineSession` internally. The [feature-session](../../feature/session/README.md) component will provide "use cases" to perform actions like loading URLs and takes care of rendering the selected `Session` on an `EngineView`. + +### View + +`SystemEngineView` is the Gecko-based implementation of `EngineView` in order to render web content. + +```XML +<mozilla.components.browser.engine.system.SystemEngineView + android:id="@+id/engineView" + android:layout_width="match_parent" + android:layout_height="match_parent" /> +``` + +`SystemEngineView ` can render any `SystemEngineSession` using the `render()` method. + +```Kotlin +val engineSession = engine.createSession() +val engineView = view.findViewById<SystemEngineView>(R.id.engineView) +engineView.render(engineSession) +``` + +## License + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/ |