Commit Graph

210 Commits

Author SHA1 Message Date
Mugurell
e3d829ec56 [components] Cleanup - Don't count item padding in ExpandableLayout
ExpandableLayout needs to iterate through all items until the one set as the
limit of the collapsible menu and accumulate the distance.
It adds the items height and margins but also erroneously the padding.

Stop counting the padding if height is counted. Height contains any vertical
padding set.
2021-04-14 16:29:28 +00:00
Mugurell
498195b57a [components] For https://github.com/mozilla-mobile/android-components/issues/9932 - Make ExpandableLayout aware of the sticky footer item index
If the menu starts as collapsed and it has a sticky footer set the bottom item
until which the menu should be collapsed must be shown on top of the sticky
item's view.
As an edgecase, if the same item is the limit of the collapsed menu and also
the sticky footer that will be the last item shown in the collapsed menu but
will be shown with full height.
2021-04-14 16:29:28 +00:00
Mugurell
980305e518 [components] For https://github.com/mozilla-mobile/android-components/issues/9932 - BrowserMenuAdapter is now a StickyItems Adapter
The most important new responsibilities are to update the view of the sticky
item.

BrowserMenu's background is only set on the parent's layout so the Adapter will
have to set that same background to the sticky item's view such that other
items scrolling underneath it will be totally obscured.

Because the menu's background can be set in multiple ways (by setting a value
for mozac_browser_menu_background / by passing a MenuStyle or like in Fenix
having a default theme for all "above" views) BrowserMenu will offer a new
backgroundColor property that as the single source of truth for this which can
then be used by the Adapter.
2021-04-14 16:29:28 +00:00
Mugurell
b627db9a9c [components] For https://github.com/mozilla-mobile/android-components/issues/9932 - Add isSticky support to most of the menu items
Most of the menu items should support this new property and allow AC clients to
configure the menus such that a specific menu item will not be scrolled
off-screen but rather anchored to the top/bottom of the menu following where
the menu is anchored.
2021-04-14 16:29:28 +00:00
Mugurell
475b34fd2b [components] For https://github.com/mozilla-mobile/android-components/issues/9932 - New LayoutManager with support for sticky header / footer
Vertical LinearLayoutManager configured with StickyItemPlacement such that:
- if StickyItemPlacement.TOP the sticky item will not be scrolled upwards
off-screen
- if StickyItemPlacement.TOP the sticky item will not be scrolled downwards
off-screen
2021-04-14 16:29:28 +00:00
mcarare
4c8cca7393 [components] For https://github.com/mozilla-mobile/android-components/issues/10037: Adjust BrowserMenuImageTextCheckboxButton item to fit UX specs. 2021-04-12 07:25:16 +00:00
Mugurell
7155b649c8 [components] For https://github.com/mozilla-mobile/android-components/issues/10032 - Handle menu touches in expandable menu on Samsung devices
Refactored the code so that touches/scrolls are still swallowed while the
menu is expanding after which ExpandableLayout should let all MotionEvents
pass through to be handled by menu items children.
2021-04-12 04:43:07 +00:00
Mozilla L10n Automation Bot
cd1ff86a9f [components] Import l10n. 2021-04-12 00:20:39 +00:00
Mozilla L10n Automation Bot
8fc62d6ac9 [components] Import l10n. 2021-04-11 00:20:31 +00:00
Mugurell
2f5eb09d12 [components] For https://github.com/mozilla-mobile/android-components/issues/10005 - Replace layout manager to effectively change stackFromEnd
The `stackFromEnd` property is not initially set even though
`endOfMenuAlwaysVisible` might be true since when having a bottom expandable
menu, that should always be scrolled to the top.
And we know if we're in that situation only later, after menu is configured and
based on it it can be inferred if it should be collapsed or not.

Setting `stackFromEnd` only after this steps, even if the menu is not yet on
the screen seems to have no effect.

The only solution is to replace menu's layout manager with one that has this
`stackFromEnd` from the beginning.
2021-04-06 15:09:59 +00:00
Mozilla L10n Automation Bot
6e18ad2b07 [components] Import l10n. 2021-04-05 00:22:33 +00:00
Mugurell
1c2b5a60da [components] For https://github.com/mozilla-mobile/android-components/issues/9922 - Calculate menu width only once, before layout
Previously the width could've change while the menu was scrolled or the width
may have been too small / big for the entire list when a larger / narrower
would be initially off screen, waiting for a scroll to be laid out.
2021-04-02 07:05:15 +00:00
Mozilla L10n Automation Bot
b17b68b046 [components] Import l10n. 2021-04-02 00:14:52 +00:00
Mugurell
62436ef348 [components] For https://github.com/mozilla-mobile/android-components/issues/9904 - Add isCollapsingMenuLimit support to most of the menu items
Most of the menu items should support this new property and allow AC clients to
configure the menus to show any one of them as the last one showing in a
collapsed menu.
2021-03-30 14:15:53 +00:00
Mugurell
bdcc3a4003 [components] For https://github.com/mozilla-mobile/android-components/issues/9904 - Refactor BrowserMenu to use ExpandableLayout
To support using the new functionality browser menu should:
- intercept the menu layout before being used to create a new PopupWindow and
possibly wrap it in the ExpandableLayout.
- identify when the menu wants to be shown as collapsed/expanded. This will be
inferred based on the new `isCollapsingMenuLimit` API of BrowserMenuItem.
- offer a straightforward, reliable way to know as soon as possible if the
menu should be anchored to the top or to the bottom of the screen.

Most of the refactoring from this patch was needed for the last part.
Previously the PopupWindow was created with a menu and then we used different
methods to infer where to place the menu.
Now we needed to know this before creating the PopupWindow since as per the
UX specs the menu should be expandable only when it is anchored to the bottom.
2021-03-30 14:15:53 +00:00
Mugurell
2c91d40118 [components] For https://github.com/mozilla-mobile/android-components/issues/9904 - Add ExpandableLayout as a menu wrapper used by PopupWindow
This new layout is specifically designed for one particular purpose:
wrapping a bottom placed menu to allow it to:
- first being displayed as collapsed until a specific menu item index
- inform about touches in the empty space left by the collapsed view
- automatically expand when users swipes up it will expand.
Once expanded it will remain so.

This was the only viable solution for allowing bottom anchored PopupWindows
to be expanded and collapsed.
2021-03-30 14:15:53 +00:00
Mozilla L10n Automation Bot
a999cf4597 [components] Import l10n. 2021-03-30 00:21:24 +00:00
mcarare
084d327d6a [components] For https://github.com/mozilla-mobile/android-components/issues/9840: Add support for icon, label and custom checkbox menu item. 2021-03-29 09:34:48 +00:00
mcarare
75582d0d3c [components] No issue: REVERT renaming add-ons to extensions. 2021-03-18 13:36:22 +00:00
mcarare
cdc4719255 [components] For https://github.com/mozilla-mobile/android-components/issues/9873: Move extension sub-menu in the placeholder set by client apps. 2021-03-17 09:54:36 +00:00
mcarare
8e7358c07e [components] For https://github.com/mozilla-mobile/android-components/issues/9873: Update Add-ons naming to Extensions. 2021-03-17 09:54:36 +00:00
Mozilla L10n Automation Bot
fbe06980e1 [components] Import l10n. 2021-03-14 00:22:50 +00:00
Mozilla L10n Automation Bot
98e4f66268 [components] Import l10n. 2021-03-01 00:16:06 +00:00
Mozilla L10n Automation Bot
b3ce384e2c [components] Import l10n. 2021-02-25 00:28:15 +00:00
Mozilla L10n Automation Bot
83cc420397 [components] Import l10n. 2021-02-23 00:27:48 +00:00
Mozilla L10n Automation Bot
e2ba42940d [components] Import l10n. 2021-02-20 00:22:57 +00:00
Mozilla L10n Automation Bot
814ac109c3 [components] Import l10n. 2021-02-06 00:14:29 +00:00
Mozilla L10n Automation Bot
9bd22333d0 [components] Import l10n. 2021-02-05 00:27:06 +00:00
Roger Yang
f5c4421496 [components] Revert "For https://github.com/mozilla-mobile/android-components/issues/9101 - Show BrowserMenu at the right location on Android <=23"
This reverts commit 8365d2d7dfe0400e7a9243b64b33033fec1fd90d.
2021-02-02 14:54:31 +00:00
Mozilla L10n Automation Bot
0245ee0aeb [components] Import l10n. 2021-01-26 00:18:52 +00:00
Mozilla L10n Automation Bot
a074547dd9 [components] Import l10n. 2020-12-29 00:20:41 +00:00
Mozilla L10n Automation Bot
e6368dc807 [components] Import l10n. 2020-12-24 00:20:09 +00:00
Mugurell
5a022dcfa7 [components] For https://github.com/mozilla-mobile/android-components/issues/9101 - Show BrowserMenu at the right location on Android <=23
Have the menu placed exactly above the anchor.
2020-12-07 09:37:19 +00:00
Sebastian Kaspari
60c4cf4b2a [components] Update AndroidX dependencies. 2020-12-02 12:17:31 +00:00
Mozilla L10n Automation Bot
f2ea2e579a [components] Import l10n. 2020-11-16 00:17:46 +00:00
Christian Sadilek
b69eec6b77 [components] Closes https://github.com/mozilla-mobile/android-components/issues/8867: Correctly handle PageAction enabled state 2020-11-04 17:36:29 +00:00
Mozilla L10n Automation Bot
1b28c11a02 [components] Import l10n. 2020-11-04 00:21:39 +00:00
Mozilla L10n Automation Bot
665146892b [components] Import l10n. 2020-10-31 00:21:41 +00:00
Tiger Oakes
b1a7210c5b [components] For https://github.com/mozilla-mobile/android-components/issues/7833: Generate concept-menu items for addons 2020-10-20 17:30:59 +00:00
mcarare
be0274fb71 [components] For https://github.com/mozilla-mobile/android-components/issues/8593: Allow extensions to be moved to main browser menu. 2020-10-15 17:57:24 +00:00
Mozilla L10n Automation Bot
50454aa9ac [components] Import l10n. 2020-10-11 00:17:15 +00:00
Mozilla L10n Automation Bot
35c8de4ab5 [components] Import l10n. 2020-10-05 00:29:08 +00:00
Mozilla L10n Automation Bot
51662a3fe3 [components] Import l10n. 2020-10-04 00:25:33 +00:00
Mozilla L10n Automation Bot
7286b82036 [components] Import l10n. 2020-09-30 10:13:19 +00:00
Tiger Oakes
a035a49d2c [components] For https://github.com/mozilla-mobile/android-components/issues/7833: Introduce async drawable menu item 2020-09-29 02:51:25 +00:00
Mozilla L10n Automation Bot
b427b25d68 [components] Import l10n. 2020-09-25 00:22:10 +00:00
Mozilla L10n Automation Bot
dbb6c1e9e1 [components] Import l10n. 2020-09-22 09:28:45 +00:00
Mozilla L10n Automation Bot
bd3ac9a8dd [components] Import l10n. 2020-09-14 00:08:17 +00:00
Mozilla L10n Automation Bot
ad197c4761 [components] Import l10n. 2020-09-10 13:02:00 +02:00
Mozilla L10n Automation Bot
f67c8d27e1 [components] Import l10n. 2020-09-09 00:05:30 +00:00