Commit Graph

2215 Commits

Author SHA1 Message Date
Steven Knipe
ea9cb18430 [components] Add longClickListener documentation, fix style problems
move TwoStateButton background to match argument order
2021-08-02 12:24:51 +00:00
Steven Knipe
d87ac452f6 [components] Add tinting to TwoStateButton
(requires its own setTintResource function)
2021-08-02 12:24:51 +00:00
Steven Knipe
6efbccee57 [components] Add disableInSecondaryState to TwoStateButton 2021-08-02 12:24:51 +00:00
Steven Knipe
6bb6265dc7 [components] Change enable/disable to primary/secondary, update documentation 2021-08-02 12:24:51 +00:00
Steven Knipe
d3a10b29bc [components] TwoStateButton: add support for longclick listener,
Also fix reversal of enabled/disabled logic
2021-08-02 12:24:51 +00:00
Steven Knipe
2339f9b1d8 [components] Add longClickListener to Toolbar's ActionButton and BrowserToolbar's Button 2021-08-02 12:24:51 +00:00
codrut.topliceanu
3bd5ddb4a0 [components] For https://github.com/mozilla-mobile/android-components/issues/10603 - Adds createdAt to TabSessionState 2021-08-02 10:07:38 +00:00
Sebastian Kaspari
ebf54eb308 [components] TrackingProtectionIconView: Always call updateIcon() to initialize. 2021-07-30 09:32:28 +00:00
Sebastian Kaspari
ce323400dd [components] Run ktlintFormat to fix new ktlint errors. 2021-07-28 12:03:23 +00:00
Michael Comella
06e80c6e10 [components] For https://github.com/mozilla-mobile/android-components/issues/10604: remove remaining unused imports automatically.
This commit was automatically generated with:
```sh
./gradlew ktlint --args="-F"
```
2021-07-27 19:39:04 +00:00
Michael Comella
9f3e6f1a1b [components] For https://github.com/mozilla-mobile/android-components/issues/10604: reuse new TestCoroutineDispatcher in additional tests.
These follow a few more simple patterns I was able to find:
- the testDispatcher is not used anywhere else: remove it
- the testDispatcher is used to set a main dispatcher: this is redundant
to the test rule so remove it both the dispatcher & the main dispatcher
- the testDispatcher is actually used elsewhere: for simplicity, change
the reference to point at the MainCoroutineRule.
2021-07-27 19:39:04 +00:00
Michael Comella
b3c2050afa [components] For https://github.com/mozilla-mobile/android-components/issues/10604: deprecate createTestCoroutinesDispatcher.
This is redundant to the built-in TestCoroutineDispatcher() method.
TestCoroutineDispatcher is also preferred because it has enhanced
testing functionality including defining a context-specific
`runBlockingTest` function, the ability to control `delay` timings, etc.
2021-07-27 19:39:04 +00:00
Arturo Mejia
e4d539f111 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10448 show toolbar permissions indicator when permissions change from their default. 2021-07-27 17:25:23 +00:00
Roger Yang
028c8b491d [components] Closes https://github.com/mozilla-mobile/android-components/issues/10617: Add common domain for icon requests 2021-07-26 17:31:36 +00:00
mcarare
23e050a3c3 [components] For https://github.com/mozilla-mobile/android-components/issues/10670: Add optional parameter to filter recent bookmarks based on added date. 2021-07-23 16:06:47 +00:00
Arturo Mejia
20c74779f3 [components] Closes https://github.com/mozilla-mobile/android-components/issues/10127 expose new GV api for detecting SmartBlock exceptions. 2021-07-22 20:54:06 +00:00
Sammy Khamis
4d75239856 [components] updated lib version and reverted lastUsed to long 2021-07-21 22:48:58 +00:00
Sammy Khamis
575b8a38dc [components] small changes based on recent changes 2021-07-21 22:48:58 +00:00
Sammy Khamis
3015f1fead [components] updated a-s version, fixed some minor changes 2021-07-21 22:48:58 +00:00
Sammy Khamis
0f2fc25fbb [components] updated remote tabs based on a-s tabs update 2021-07-21 22:48:58 +00:00
Mugurell
d67a681ba6 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Add a new mediaSessionActive property to LastMediaAccessState
This new property helps with separating the current responsibilities of
lastMediaAccess such that after this:
- lastMediaAccess is only updated when media starts playing allowing clients to
order media tabs and find the first / last tab with in progress media.
- lastHadMediaSessionActive indicates whether a MediaSession should be active
for this tab and serves as a backup for lastMediaUrl for the situations where a
website might allow media to continue playing even when the users accesses
another page (with another URL) in that same HTML document.
2021-07-21 19:10:46 +00:00
Mugurell
58cf65e681 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Persist and restore tab LastMediaAccessState 2021-07-21 19:10:46 +00:00
Mugurell
097eeb01e2 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Try to update mediaState only for TabSessionState
Renamed "BrowserState.updateTabState" to a more appropriate
"BrowserState.updateTabOrCustomTabState" signaling that it can be used to
update any tab or custom tab.

Created two new "BrowserState.updateTabState" and
"BrowserState.updateCustomTabState" extension methods to allow updating the
state of either tabs or custom tabs depending on the properties needing update.

By this we are forcing the clients to choose what type of SessionState they
want updated and in so limiting the situations in which the old API would try
to update any SessionState and could throw a ClassCastException if in the
"update" lambda parameter callers would try to update a property not existing
in one SessionState implementation but available in other.
2021-07-21 19:10:46 +00:00
Mugurell
0c7b4d7866 [components] For https://github.com/mozilla-mobile/android-components/issues/10632 - Migrate TabSessionState's lastMediaAccess to LastMediaAccessState
LastMediaAccessState contains both
- lastMediaAccess - timestamp for the last time media started playing
(which is reset to 0 when GV deactivates the MediaSession)
- lastMediaUrl - tab url when media started playing

By combining this two properties we'll know that a tab has in progress media
even when:
- the user navigates to another page in the same document
but media continues to play, MediaSession exists, lastMediaAccess is not reset,
- media starts playing in another tab
but the previous media tab has the same url as lastMediaUrl.

After media starting to play in a tab only if
- user navigated to another website and
- MediaSession is deactivated (happens when navigating to another website or
when media starts playing in another tab)
will we consider that this tab doesn't anymore have in progress media.
2021-07-21 19:10:46 +00:00
Stefan Arentz
a719bbf6ce [components] For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master branch to main (https://github.com/mozilla-mobile/android-components/pull/10647)
* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHub Workflows)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Pull Request Template)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (README)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (l10n.toml)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (GitHubPlugin.kt)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (Documentation & Comments)

* For https://github.com/mozilla-mobile/android-components/issues/10137 - Rename master to main (TaskCluster)
2021-07-21 09:59:30 -04:00
Sebastian Kaspari
f29656ddc0 [components] Revert string removal by 06c42dd893188a7da69ac2eba10f4fc1d44fab3d
Some of those strings seem to be used by Fenix only.
2021-07-20 20:27:13 +02:00
Sebastian Kaspari
f14b267388 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update dependencies to support Jetpack Compose and add first prototype components.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upgrade to Gradle 7.
* Update Android Gradle Plugin to 7.0.0 Beta 2.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Generate BuildConfig with VERSION_CODE and VERSION_NAME fields in library modules (for Glean).
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add first component using Jetpack Compose: compose-browser-toolbar.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Introduce Jetpack Compose bindings for lib-state.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Upstream Jetpack Compose toolbar prototype from Reference Browser.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add TargetTab helper for observing specific tabs.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add compose-engine component for adding Jetpack Compose bindings to a concept-engine implementation.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Add new sample app (samples-compose-browser) for prototyping browser UI using Jetpack Compose.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Update to Beta 3 of the Android Gradle plugin.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Allow usage of http when substituting maven repositories in CI.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Rename TabTarget helper to just Target.
* Issue https://github.com/mozilla-mobile/android-components/issues/10335: Make BrowserToolbar follow target tab too.
* Add awesomebar prototype using Jetpack Compose.
* Update to Gradle 7.0.2.
2021-07-20 16:22:26 +00:00
codrut.topliceanu
1e510d2772 [components] For https://github.com/mozilla-mobile/android-components/issues/10624 - Adds recoverable param to RemoveAllTabsAction
...to be used by UndoMiddleware.kt to prevent closed tabs from being recoverable
2021-07-19 14:49:23 +00:00
Sebastian Kaspari
9fb6953940 [components] Upgrade Android Gradle Plugin to 4.2.2 and Gradle to 6.7.1. 2021-07-19 09:32:44 +00:00
Sebastian Kaspari
28a76101be [components] Update Kotlin to 1.5.10 (and Coroutines to 1.5.0 and Room to 2.3.0). 2021-07-19 09:32:44 +00:00
Mugurell
cd404dfd7b [components] For https://github.com/mozilla-mobile/android-components/issues/10555 - BrowserToolbarBehaviorTest cleanup
This commented method seems to be a leftover from the previous refactoring.
"behavior.forceExpand(..)" now calls "expandWithAnimation" for which we already
have a test at line 450.
2021-07-16 12:37:29 +00:00
Mugurell
acf8635f10 [components] For https://github.com/mozilla-mobile/android-components/issues/10555 - Use INPUT_HANDLING_UNKNOWN as the default of InputResultDetail
We need to wait until having a response from GeckoView on how it handled the
touch only after which we'll know whether to animate the toolbar or not.

The edgecase scenario of having pull to refresh enabled even before having a
response from GeckoView will still work because "canOverscrollTop()" only
checks for the touch to not be handled by the browser to pan the page.
2021-07-16 12:37:29 +00:00
Sebastian Kaspari
4863bc3b15 [components] Issue https://github.com/mozilla-mobile/android-components/issues/10335: Use Java 11. 2021-07-15 14:57:23 +00:00
Mozilla L10n Automation Bot
b0d9d7ea29 [components] Import l10n. 2021-07-14 00:17:00 +00:00
codrut.topliceanu
6d605efc6e [components] For https://github.com/mozilla-mobile/android-components/issues/10588 - ERROR_SECURITY_SSL no longer shows Advanced button 2021-07-13 12:20:32 +00:00
mcarare
055e0f160f [components] For https://github.com/mozilla-mobile/android-components/issues/10571: Add optional icon tint for Toolbar Button. 2021-07-12 07:44:59 +00:00
Ionut Cristian Bedregeanu
60aa8bcb57 [components] Send the mutable list of menu items as parameter 2021-07-09 07:42:38 +00:00
Ionut Cristian Bedregeanu
266499b6f2 [components] For https://github.com/mozilla-mobile/android-components/issues/10559 - Adds showAddonsInMenu in WebExtensionBrowserMenuBuilder
Adds `showAddonsInMenu` in WebExtensionBrowserMenuBuilder to allow the option of removing `Add-ons`
item even if another extensions are displayed
Add unit tests to test if 'Add-ons' item visibility is updated properly
2021-07-09 07:42:38 +00:00
Mugurell
4e14471fa6 [components] For https://github.com/mozilla-mobile/android-components/issues/10470 - Persist and restore lastMediaAccess of TabSessionState 2021-07-08 17:08:25 +00:00
Mugurell
11b0ca6e98 [components] For https://github.com/mozilla-mobile/android-components/issues/10470 - Add a new lastMediaAccess property for TabSessionState
This new property will be a timestamp of the last time media started playing in
the current page or be 0 if media hadn't started playing or another page loaded
in this tab so media was stopped.

To observe the media changes and update this property LastMediaAccessMiddleware
will have to be set on BrowserStore.
2021-07-08 17:08:25 +00:00
Mozilla L10n Automation Bot
451641af27 [components] Import l10n. 2021-07-08 00:21:14 +00:00
Jonathan Almeida
ac53ae76e1 [components] Close https://github.com/mozilla-mobile/android-components/issues/10382: Handle exceptions thrown in RemoteTabsStorage 2021-07-07 03:33:22 +00:00
Christian Sadilek
2c9aef155c [components] Catch and log history metadata write exceptions 2021-07-05 19:44:27 +00:00
codrut.topliceanu
ac072ce9b3 [components] For https://github.com/mozilla-mobile/android-components/issues/10537 - Applies tint to imageView instead of drawable
`Drawable.setTint` did not correctly apply the tint received from Fenix. Switching to `imageView.setTintResource` fixes the issue.
2021-07-01 13:53:54 +00:00
Mozilla L10n Automation Bot
d1e1633948 [components] Import l10n. 2021-06-29 00:20:20 +00:00
Mozilla L10n Automation Bot
d3cd8fd9bb [components] Import l10n. 2021-06-26 00:20:19 +00:00
Sebastian Kaspari
78e0f282e8 [components] TrackingProtectionIconView: Use correct icon for OFF_FOR_A_SITE state. 2021-06-22 14:39:59 +00:00
Arturo Mejia
497d1d2c35 [components] Improvements to site permissions 2021-06-21 12:12:35 +00:00
Mozilla L10n Automation Bot
a77588fae1 [components] Import l10n. 2021-06-20 00:17:33 +00:00
Grisha Kruglov
ccb0a5014b [components] Extension functions for converting URLs to search terms 2021-06-17 19:36:48 +00:00