summaryrefslogtreecommitdiffstats
path: root/mobile/android/android-components/samples
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /mobile/android/android-components/samples
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mobile/android/android-components/samples')
-rw-r--r--mobile/android/android-components/samples/browser/src/androidTest/assets/index.html6
-rw-r--r--mobile/android/android-components/samples/browser/src/main/assets/extensions/borderify/borderify.js2
-rw-r--r--mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js11
-rw-r--r--mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.template.json4
-rw-r--r--mobile/android/android-components/samples/browser/src/main/java/org/mozilla/samples/browser/BaseBrowserFragment.kt1
-rw-r--r--mobile/android/android-components/samples/crash/build.gradle1
-rw-r--r--mobile/android/android-components/samples/firefox-accounts/build.gradle1
-rw-r--r--mobile/android/android-components/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt9
-rw-r--r--mobile/android/android-components/samples/toolbar/build.gradle1
9 files changed, 23 insertions, 13 deletions
diff --git a/mobile/android/android-components/samples/browser/src/androidTest/assets/index.html b/mobile/android/android-components/samples/browser/src/androidTest/assets/index.html
index 9f5632c044..1b7817eef2 100644
--- a/mobile/android/android-components/samples/browser/src/androidTest/assets/index.html
+++ b/mobile/android/android-components/samples/browser/src/androidTest/assets/index.html
@@ -1,5 +1,5 @@
<html>
-<body>
-<h1 id="website_title">Hello World!</h1>
-</body>
+ <body>
+ <h1 id="website_title">Hello World!</h1>
+ </body>
</html>
diff --git a/mobile/android/android-components/samples/browser/src/main/assets/extensions/borderify/borderify.js b/mobile/android/android-components/samples/browser/src/main/assets/extensions/borderify/borderify.js
index af58957d88..b9a5d6bc18 100644
--- a/mobile/android/android-components/samples/browser/src/main/assets/extensions/borderify/borderify.js
+++ b/mobile/android/android-components/samples/browser/src/main/assets/extensions/borderify/borderify.js
@@ -2,4 +2,4 @@
* 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/. */
-document.body.style.border = "5px solid red"; \ No newline at end of file
+document.body.style.border = "5px solid red";
diff --git a/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js b/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js
index 950936be4c..f3ee460d9b 100644
--- a/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js
+++ b/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/background.js
@@ -6,7 +6,7 @@
* inadvertently match elements in the article content. */
// Counts to three and sends a greeting via the browser action of a newly created tab.
-browser.tabs.onCreated.addListener((tab) => {
+browser.tabs.onCreated.addListener(tab => {
let counter = 0;
let intervalId = setInterval(() => {
var message;
@@ -16,9 +16,12 @@ browser.tabs.onCreated.addListener((tab) => {
message = "Hi!";
clearInterval(intervalId);
}
- browser.browserAction.setBadgeTextColor({tabId: tab.id, color: "#FFFFFF"});
- browser.browserAction.setBadgeText({tabId: tab.id, text: message});
+ browser.browserAction.setBadgeTextColor({
+ tabId: tab.id,
+ color: "#FFFFFF",
+ });
+ browser.browserAction.setBadgeText({ tabId: tab.id, text: message });
}, 1000);
});
-browser.browserAction.setBadgeBackgroundColor({color: "#AAAAAA"}); \ No newline at end of file
+browser.browserAction.setBadgeBackgroundColor({ color: "#AAAAAA" });
diff --git a/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.template.json b/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.template.json
index 04dc17aa2f..57e0949ec0 100644
--- a/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.template.json
+++ b/mobile/android/android-components/samples/browser/src/main/assets/extensions/test/manifest.template.json
@@ -16,7 +16,5 @@
"default_title": "Test",
"default_popup": "popup.html"
},
- "permissions": [
- "tabs"
- ]
+ "permissions": ["tabs"]
}
diff --git a/mobile/android/android-components/samples/browser/src/main/java/org/mozilla/samples/browser/BaseBrowserFragment.kt b/mobile/android/android-components/samples/browser/src/main/java/org/mozilla/samples/browser/BaseBrowserFragment.kt
index 7cef15d75f..bf5efccc2b 100644
--- a/mobile/android/android-components/samples/browser/src/main/java/org/mozilla/samples/browser/BaseBrowserFragment.kt
+++ b/mobile/android/android-components/samples/browser/src/main/java/org/mozilla/samples/browser/BaseBrowserFragment.kt
@@ -82,6 +82,7 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Activit
feature = SessionFeature(
components.store,
components.sessionUseCases.goBack,
+ components.sessionUseCases.goForward,
binding.engineView,
sessionId,
),
diff --git a/mobile/android/android-components/samples/crash/build.gradle b/mobile/android/android-components/samples/crash/build.gradle
index 9ea07c4d9f..776cb2d8f4 100644
--- a/mobile/android/android-components/samples/crash/build.gradle
+++ b/mobile/android/android-components/samples/crash/build.gradle
@@ -42,6 +42,7 @@ dependencies {
implementation ComponentsDependencies.kotlin_coroutines
implementation ComponentsDependencies.androidx_appcompat
+ implementation ComponentsDependencies.androidx_core_ktx
implementation ComponentsDependencies.google_material
implementation ComponentsDependencies.androidx_recyclerview
}
diff --git a/mobile/android/android-components/samples/firefox-accounts/build.gradle b/mobile/android/android-components/samples/firefox-accounts/build.gradle
index c6a7d616e9..cade498470 100644
--- a/mobile/android/android-components/samples/firefox-accounts/build.gradle
+++ b/mobile/android/android-components/samples/firefox-accounts/build.gradle
@@ -45,6 +45,7 @@ dependencies {
implementation project(':lib-fetch-httpurlconnection')
implementation ComponentsDependencies.androidx_constraintlayout
+ implementation ComponentsDependencies.androidx_core_ktx
implementation ComponentsDependencies.kotlin_coroutines
diff --git a/mobile/android/android-components/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt b/mobile/android/android-components/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt
index 06f889d441..55d243d4cd 100644
--- a/mobile/android/android-components/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt
+++ b/mobile/android/android-components/samples/sync/src/main/java/org/mozilla/samples/sync/MainActivity.kt
@@ -278,15 +278,20 @@ class MainActivity :
events.forEach {
when (it) {
is AccountEvent.DeviceCommandIncoming -> {
- when (it.command) {
+ val cmd = it.command
+ when (cmd) {
is DeviceCommandIncoming.TabReceived -> {
- val cmd = it.command as DeviceCommandIncoming.TabReceived
var tabsStringified = "Tab(s) from: ${cmd.from?.displayName}\n"
cmd.entries.forEach { tab ->
tabsStringified += "${tab.title}: ${tab.url}\n"
}
txtView.text = tabsStringified
}
+ is DeviceCommandIncoming.TabsClosed -> {
+ var urlsStringified = "Tabs closed from: ${cmd.from?.displayName}\n"
+ cmd.urls.forEach { url -> urlsStringified += "${url}\n" }
+ txtView.text = urlsStringified
+ }
}
}
is AccountEvent.ProfileUpdated -> {
diff --git a/mobile/android/android-components/samples/toolbar/build.gradle b/mobile/android/android-components/samples/toolbar/build.gradle
index 896f3c77f1..80c58683dc 100644
--- a/mobile/android/android-components/samples/toolbar/build.gradle
+++ b/mobile/android/android-components/samples/toolbar/build.gradle
@@ -53,5 +53,6 @@ dependencies {
implementation ComponentsDependencies.kotlin_coroutines
implementation ComponentsDependencies.androidx_appcompat
+ implementation ComponentsDependencies.androidx_core_ktx
implementation ComponentsDependencies.androidx_recyclerview
}