Commit Graph

4160 Commits (105a2e5fc68c6d5bbd1aeeb45b346e2667965f9d)

Author SHA1 Message Date
Grisha Kruglov 5bbfd49e1d Refactor History types to eliminate nullability
This introduces a separate HistoryDB type at the PagedHistoryProvider
layer, that doesn't need to deal with positions. Positioning logic in
HistoryDataSource becomes a type conversion between the new type and an
existing History type that UI and ItemKeyedDataSource API is written against.

With this refactor, we entirely eliminate nullability from these types.
3 years ago
Grisha Kruglov 836ff1151b Closes #22764: Convert History.id to an Int position
We were converting Long timestamps into Ints (and getting negative
numbers back), and treating that as, basically, a position for the
paging API; the paging API would pass us back the obscure negative
number back as an offset, and we'll mishandle it resulting in an
infinite loop.

This patch removes all of the Long -> Int conversions, and introduces an
explicit 'position' that is calculated once we have a full page of
results completed.
3 years ago
Mugurell 34c0a17b4d For #22852 - Add a new "Storage access" permission 3 years ago
Arturo Mejia cf31bc408a For #22931 Only enable wallpapers on normal mode 3 years ago
mcarare 00280d3b65 For #20513: Use UrlMetricType for search engine submission url. 3 years ago
Roger Yang 22bcdeafe0 Closes #22736: Do not remove focus from toolbar when scrolling 3 years ago
Arturo Mejia 7a44412619 For #22851 toggle wallpapers when tap on the Firefox logo 3 years ago
rxu 073fd89390 Add default topsite MeiTuan for MozillaOnline builds 3 years ago
Matt Tighe db71d8dfe7 fixes #22889: add bottom spacer to onboarding adapter 3 years ago
Mugurell eb2ec677ca For #22508 - Increase menu height to avoid it become scrollable
Compose enforces a DropdownMenuItem having at least a 64dp height
(48 dp height + 8dp vertical padding) so we need to ensure the parent
doesn't hardcode a smaller height.
3 years ago
Roger Yang 26198330e9 Closes #22671: Show correct time groups header in history 3 years ago
mcarare bbf0ccca54 For #22450: Replace quit icon with AC one. 3 years ago
Grisha Kruglov 33af7d8729 Fix breaking change in KeyProvider
`key` was renamed to `getOrGenerateKey` and is now a `suspend`.
3 years ago
Grisha Kruglov 8de4c0b4db For #22569: Remove allopen plugin and Mockable annotations 3 years ago
rxu b41542dc5e Modify strings for Privacy notice for MozillaOnline builds 3 years ago
Matt Tighe edcccc2f4c fixes #20833: move home recycler bottom margin into standalone item 3 years ago
Gabriel Luong 2c22622edb For #22836 - Replace primary_text_private_theme with fx_mobile_private_text_color_primary color token 3 years ago
Noah Bond 8ca1a7e271 For #22832 - Added parameters to base Text composables 3 years ago
Arturo Mejia 0ac2899570 For #22851 add wallpapers feature flag 3 years ago
Gabriel Luong 41fd47fc06 For #22793 - Update the colors for Scrim Start/End design tokens 3 years ago
Gabriel Luong 35454ec674 For #22793 - Swap the colors for Gradient Start/End design tokens 3 years ago
Gabriel Luong 29fc9c4ea5 For #22793 - Add Icon Gradient Start/End color tokens 3 years ago
Gabriel Luong 543f2000af For #22793 - Rename fx_mobile_icon_color_notice color token to fx_mobile_icon_color_information 3 years ago
Matt Tighe fee26e62a8 Fixes #22688: remove inactive_tabs_recently_closed probe 3 years ago
mcarare b4bf7abfb3 For #22784: Show collection snackbar only if fragment is still attached. 3 years ago
mcarare 0cb4059b12 For #17130: Replace hardcoded strings with string resources. 3 years ago
aime Soriano Pastor 9bfc94b793 For #9294: Add option to clear current site data in quick settings dialog. 3 years ago
MickeyMoz 07d43971c0 Update Android Components version to 97.0.20211208143435. 3 years ago
Jonathan Almeida 01ba8959ce Issue #22757: Check the parent cast to AbstractBrowserTrayList first
We re-use the same ViewHolders in search term groups, so when we need to
cast to a AbstractBrowserTrayList for tab reordering, we need to check
our parent correctly first.
3 years ago
Christian Sadilek 6637f61088
Support tab movement/reordering (#22751)
* Adds basic support for tab reordering via drag-and-drop selected tabs

* ktlint/detekt formatting

* Use defaultTabsFilter (now not private) instead of getter

* Convert from position+filter API to target+placeAfter
Unfortunately I still need the filter passed around a bit

* Handle inactive tabs' holder being children of the RecyclerView of the normal tabs
Don't go through LayoutManager needlessly

* Non-working use tabID the whole way. Does not compile.

* Fix to do direct tab ID and use grid setting directly

* Remove non-null assertion. Now fully works for "other" tabs.

* Prevent grouped tabs from being dragged

* Remove unused import

* Add/fix comments

* Do API version check and use deprecated startDrag if too old.

* Build process fails: both outdated and too new, so reverting to just too new

* Use deprecated function and suppress warning

* fix space

* Suppress "TooManyFunctions" on DefaultTabsTrayController

* Repeatedly update tab movement during drag

* Remove multi-tab movement, only allow dragging if tab groups disabled, fix tab positioning during movement
I'm forced to suppress LongParameterList to get the settings information where it needs to go though

* Remove settings argument and corresponding long args suppression: instead get settings from parent AbstractBrowserTrayList's context

* New UI: Select a tab and then, while holding down, start dragging

* Revert to using before/after boolean to accomodate delays
Move drag transparency to start of drag

* Use new BlankDragShadowBuilder and DraggableItemAnimator to handle tab movement

* Replace Pair<>s with data classes

* Only drag if exactly 1 tab selected, don't consume drag event if not used

* Auto-scroll tab tray while dragging near top/bottom edge

* Remove unexpected scrolling on tab bind (triggered when tab is selected)

* Fix broken scroll behavior during dragging

* Cleanup for ktlint/detekt

* Constantly set elevation during drag in case of update
Clean code at drag start

* Add custom drag start behavior

* Add drag distance constant, do all touch-drag behavior in OnTouchListener

* Disable parent vertical scrolling on drag start, fix detekt ComplexCondition

* Minor cleanup/comments

* Revert removal of scroll on bind, this was related to something different

* Correction to prepareForDrop to match documentation- doesn't seem to have any effect

* Simplify via unchecked typecast, use ViewCompat

* Use ViewConfiguration.scaledTouchSlop instead of arbitrary 30px

* Added tabReorderingFeature flag, split drag interactor to separate function to satisfy complexity requirement

Co-authored-by: Steven Knipe <ssk97@case.edu>
Co-authored-by: ssk97 <knipesteven@gmail.com>
Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
3 years ago
Christian Sadilek f919e97445 Closes #21759: Do not render home fragment when launching to tab
Co-authored-by: Sebastian Kaspari <s.kaspari@gmail.com>
3 years ago
Christian Sadilek 229c410437 Introduce timeout for capturing thumbnail in BrowserAnimator 3 years ago
Christian Sadilek ae0dba29b1 Prevent flash when navigating to home 3 years ago
Mugurell 604f188970 For #22445 - Improve the scrolling behavior for Recently visited
One important issue was that the items are smaller that the width of the
screen and so a bit of the next column would be showing also and user could
interact with this only peaking items and a long press would open a dropdown
menu with no place to anchor it.
To mitigate this:
- the items will now snap to the next position when scrolling so that we'll
always show at least one column in it's entirety.
- menus are enabled only if more than half of the item is visible effectively
disabling clicks on that peaking area of neighbour columns.

This patch also updates the divider for history groups which previously wasn't
showing.
3 years ago
Gabriel Luong 596072729d For #22701 - Replace whats_new_notification_color with fx_mobile_icon_color_notice color token 3 years ago
Sarah Khan e18cf36117 For #22495 - Disable inactive tabs survey 3 years ago
Noah Bond 73cfd0b145 For #22691 - Add Composables for Primary and Secondary text 3 years ago
Gabriel Luong e20ef25bd1 For #22637 - Add new color tokens provided by the mobile styles to FirefoxTheme 3 years ago
Christian Sadilek 26713a58c8 Refactor: Move historymetadata classes in separate package 3 years ago
Roger Yang 3d33a9422c Close #20701: Dismiss keyboard when scrolling home screen 3 years ago
rxu 4d9a58c156 Add distribution_id into first session ping 3 years ago
Gabriel Luong 3c82a34aa1 For #22592 - Refactor hideOnboardingIfNeeded() calls when the home menu items are tapped 3 years ago
Mugurell 5c3fedd707
For #22534 - Show history highlights and groups in "Recently visited" (#22535)
* For #22534 - Update homescreen section name to "Recently visited"

* For #22534 - Show both history highlights and groups in Recently visited

For now the metadata groups don't support scoring so as an interim solution we
will show up to 9 items, evenly distributes, first favoring groups sorted by
date then history highlights pre-sorted by default.

Tapping a history highlight will switch to it's already open tab if available
or create a new one in which to load it if needed.

A "Remove" option will also be available for history highlights to remove it
from the screen and also from history.
Currently removing a group / highlight will not query new ones to again show up
to 9 items, this will be implemented separately.

* For #22534 - Rename and refactor historymetadata to recentvisits

The updated feature supports more than history metadata so updating the overall
naming scheme seems needed.
To signal that this is a homescreen feature the entire package is moved to home

* For #22534 - Update UI tests to account for the new items space on the screen

Saw failures about not finding the collection section on screen.
This is probably happening because w are now adding the recent visits to
homescreen above the collections section pushing it off screen.

Since the collections might be obstructed by the toolbar shown on top as a
quick solution we'll scroll to the next homescreen section so that the
collections will be shown above in their entirety.

* Update app/src/main/java/org/mozilla/fenix/home/recentvisits/RecentVisitsFeature.kt

Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>

* Update app/src/main/java/org/mozilla/fenix/home/recentvisits/RecentVisitsFeature.kt

Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>

Co-authored-by: Gabriel Luong <gabriel.luong@gmail.com>
Co-authored-by: Christian Sadilek <christian.sadilek@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
3 years ago
Noah Bond de1c6b0dae
Tab group count telemetry (#22479)
* For #22410 - Refactored tab sorter metrics into a middleware

* For #22410 - Created distribution metric for tab group sizes

* For #22410 - Created tests for tabs tray middleware

* For #22410 - Merge fixes

* For #22410 - Added PR number to metric

* For #22410 - Fixed unit tests post merge. Added waitUntilIdle to new tests.

* For #22410 - Added missing line to middleware to have the Store process actions

* For #22410 - Updated metric expiration to December

* For #22410 - PR Feedback

* For #22410 - Removed else from middleware when
3 years ago
Gabriel Luong 7c2d9bd8a8 For #22595 - Remove unused OnboardingAutomaticSignInViewHolder 3 years ago
Gabriel Luong 91da5318e3 For #22211 - Use Hero images for Recent Bookmarks 3 years ago
Arturo Mejia 3f86a5d6f9 Improve loading URLs 3 years ago
Sebastian Kaspari e341109ced Issue #12731: Disable suspending of engine sessions under memory pressure in Nightly 3 years ago
Mugurell 548efefcbb For #22442 - Don't display individual tab if part of the Jump back in tabs group
We'll show as a recent tab the next most recent tab not part of the last active
search group.
3 years ago
Mugurell 685da115c9 For #22442 - Don't display history group if already in Jump back in 3 years ago