Restore using LazyRow's "contentPadding" property to add padding to just the
items while the entire section is allowed to extend to the edges of the screen
and so have enough room to draw items shadows without them being clipped.
While testing I observed that the Rect returned from `boundsInWindow()`
- will have the full height and width of the composable even if scrolled
offscreen vertically
- will only have the height and width of what part of the composable is shown
pn the screen.
Possibly because of the interactions of a vertically scrollable RecyclerView
and the LazyRow the composable is shown in.
To account for this the method calculating how much of the composable is shown
on screen will also now receive the real composable size as an argument.
This fixes the following two scenarios resulting in improper recordings:
- sponsored stories were recorded as shown as part of the impressions recording
for all the stories (both recommended and sponsored). Separated the two.
- sponsored stories were not recorded as shown if the user doesn't scroll.
This could happen if just toggling categories which would result in a new list
of stories to show. Will recheck after the time to settle if the composable is
shown.
The toolbar may appear over the Pocket stories causing our functionality for
reporting when a specific story is visible to misreport.
At the moment hardcoding the toolbar height in the visibility checks seems like
the best solution to ensure reliable data.
A new way to be able to reliably record actual impressions of sponsored stories
was needed and based on this data we can ensure we are promoting fresh stories
(with fewer impressions) or the ones with a higher priority.
The design asks for a new row in between the primary and the secondary text so
I went with making "ListItemTabSurface" public allowing for customizing the
content it will show but keeping the same layout and general UX.
This would shorten the time needed to layout all Pocket recommended stories
content in one go, though it may lead to shorten hiccups over a bigger period
of time.