Commit Graph
175 Commits
Author SHA1 Message Date
Michael Comella 45b9e77392 Bug 1403755: Rm code to insert blanks into top sites. r=liuche
This code was being mistakenly activated when getting top sites for Activity
Stream.

This is the first removal of old top sites code and will mean we can't go back
to old top sites by flipping the `ActivityStream.isEnabled` flag. Since we're
planning to ship AS, this shouldn't matter.


MozReview-Commit-ID: 9VB0RqNHmE0
2017-09-28 14:09:48 -07:00
Michael Comella 12245a2234 Bug 1405404: Add 'de' to list of pocket whitelisted locales. r=liuche
This is used in multi-locale builds, e.g. [1] where all German is "de" but in
[2], we have a separate l10n repo for en-GB.

[1]: https://hg.mozilla.org/releases/l10n/mozilla-beta/de
[2]: https://hg.mozilla.org/releases/l10n/mozilla-beta/en-GB

MozReview-Commit-ID: CXw9aFH9psz
2017-10-03 10:29:49 -07:00
Sebastian Hengst f0d2b77364 Backed out changeset 0bf07287d614 (bug 1405404) for failing android-test. r=backout 2017-10-03 20:18:57 +02:00
Michael Comella 1f31432fbb Bug 1405404: Add 'de' to list of pocket whitelisted locales. r=liuche
This is used in multi-locale builds, e.g. [1] where all German is "de" but in
[2], we have a separate l10n repo for en-GB.

[1]: https://hg.mozilla.org/releases/l10n/mozilla-beta/de
[2]: https://hg.mozilla.org/releases/l10n/mozilla-beta/en-GB

MozReview-Commit-ID: CXw9aFH9psz
2017-10-03 10:29:49 -07:00
Michael Comella ae4d889f67 Bug 1404460: Add test for pocket locale enabling. r=liuche
MozReview-Commit-ID: LHdQuICvVjE
2017-10-02 18:36:41 -07:00
Michael Comella d6f46d0110 Bug 1404460: Add POCKET_ENABLED_TO_LOCALE to asUserPrefs telemetry. r=liuche
After speaking with liuche, we decided it'd be better to add a bit to determine
this rather than combining it with the isPocketEnabled field (which would be
loss of data) or cross-referencing the locale of the submitted event when
checking the Pocket value during telemetry analysis (which is hard to get right
and likely to get out of date).

MozReview-Commit-ID: JKFrdEsEbyp
2017-10-02 17:01:10 -07:00
Michael Comella cfb27ca682 Bug 1404460: Only show Pocket stories in specified locales. r=liuche
Ideally, we'd centralize all queries as to which options are user specified.
However, I wanted to do the smallest change so we can uplift so I filed
bug 1405161 for this centralization.

I opted not to include the "de" locale that is included on desktop because it
does not appear we ever get the "de" locale on Firefox for Android [1].

I tested this patch by changing the system locale between locales with Pocket
on my device (en-US, en-GB, de-DE) and locales without Pocket (ko-KR). The
locale switching system makes this refresh automatically without extra code.

I also intend to test via the in-app locale switcher but that will take time
because I can't do artifact builds with multi-locale so I'm pushing this for
review before I'm finished.

Follow-up changes:
- Add to telemetry
- Hiding the preference in the undesired locales.
- A test for isPocketEnabledByLocaleInner (useful to document how this is
intended to work for locales with variants, different scripts, etc.)

[1]: https://sql.telemetry.mozilla.org/queries/4613#table

MozReview-Commit-ID: 7AVQ8fWub8I
2017-10-02 15:59:42 -07:00
James Willcox 85ddcd8eb0 Back out bug 1395841 - Part 2 for breaking PWA shortcut installation r=me
This reverts commit eadc939a6ecf5eaff2a233f7015e814cc76a33ed.

MozReview-Commit-ID: 2V2oF1PC5cf
2017-10-02 14:14:52 -05:00
Jing-wei Wu 053565febb Bug 1395841 - Part 2: Support creating a shortcut from page option in menu. r=nechen
When page option 'add page shortcut' is clicked, creating a shortcut(not PWA) on launcher.
Also make sure that heavy tasks are executed in background thread.

MozReview-Commit-ID: 8KtwdXENtEd
2017-09-28 10:57:48 +08:00
Chenxia Liu 46af8b990f Bug 1401179 - Add snackbar for bookmark add/remove actions on newtab. r=mcomella
MozReview-Commit-ID: 7DzoyDSWmVq
2017-09-22 18:08:07 -07:00
Michael Comella 7b9eaf8226 Bug 1402005: Add telemetry for Learn More clicks. r=liuche
MozReview-Commit-ID: GA4UBZ4fpK6
2017-09-22 17:32:03 -07:00
Michael Comella 247a30dc7d Bug 1402005: Add a learn more link to Top Sites. r=liuche
Explanation of our motivations are added in code comments.

In testing locally, the link I was sent to was:
- https://support.mozilla.org/1/mobile/58.0a1/Android/en-US/activity-stream

Existing code does not use a referrer so I didn't add one:
http://searchfox.org/mozilla-central/rev/56ad02e34d0d36ca4d5ccaa885d26aff270b8ff7/mobile/android/base/java/org/mozilla/gecko/preferences/LinkPreference.java#44

MozReview-Commit-ID: GTY1ku07uWy
2017-09-22 17:04:53 -07:00
Chenxia Liu eb06dfbdd4 Bug 1402481 - Reverse incorrect sign of margin calculation. r=mcomella
MozReview-Commit-ID: ICS81o8pLOE
2017-09-22 09:12:38 -07:00
Chenxia Liu 93e822057f Bug 1402145 - Use adapter child position rather than view position. r=mcomella
MozReview-Commit-ID: ESi8MMYC1lp
2017-09-22 09:09:23 -07:00
Michael Comella 54c2e383a0 Bug 1400825: Collapse top sites if there are no sites. r=liuche
MozReview-Commit-ID: D0eNQBp6IZB
2017-09-22 13:56:13 -07:00
Sebastian Kaspari 4c02d5e3ba Bug 1400825 - Show option for removing suggested sites from top sites. r=mcomella
MozReview-Commit-ID: LyAqnlMfQvr
2017-09-22 19:59:08 +02:00
Michael Comella b7fe006c16 Bug 1399683: Change padding of content view rather than self in onSizeChanged. r=sebastian
To be honest, I'm not sure why this works. onSizeChanged seems to be a callback
to notify the user that your layout has completed and not a place to update
layout params. However, it makes *slightly* more sense that you could update
your children's layout from this view, which is what this patch changes the
code to do.

I think I could figure out why this works if I dug further into [1] but I have
other things to focus on.

I don't think this is the most correct solution, but it is likely the smallest
and least risky change we can make to fix this issue, which is ideal because
we'd like to uplift this to the 57 Beta.

A more correct solution would override the Activity Stream RecyclerView and
provide different desired measurements to its parent so that the new size is
set *during* layout rather than after it, which would make the layout process
more efficient. However, this type of code is less commonly written day-to-day
by developers so it's harder to write, harder to maintain, and I'd have to read
a lot of [1] in order to write it. :)

[1]: https://developer.android.com/guide/topics/ui/how-android-draws.html

MozReview-Commit-ID: AceUvDYGWCR
2017-09-21 15:40:55 -07:00
Chenxia Liu 45554f0680 Bug 1401404 - Add telemetry for AS content prefs. r=francois,mcomella
MozReview-Commit-ID: 3IiDeghnhgX
2017-09-21 17:29:27 -07:00
Chenxia Liu 6c6b0ddad1 Bug 1400408 - Add telemetry for clicking on "MORE" link. r=francois,mcomella
MozReview-Commit-ID: Kp8X8dbyzN9
2017-09-20 16:06:51 -07:00
Chenxia Liu 412a7c11a1 Bug 1400408 - Fill in basic documentation of existing Pocket telemetry. r=mcomella
MozReview-Commit-ID: FiZI6ebihD9
2017-09-20 17:11:37 -07:00
Michael Comella abbd2cded0 Bug 1401733: Make StreamOverridablePageIconLayout caches static. r=liuche
Unfortunately, I can't reproduce so I'm unable to verify this fix works for
sure. However, I verified the behavior of the StreamOverridablePageIconLayout
remained the same after these changes.

As per my bug comments, using the new version of onCreateView may fix this
problem and is "more correct" than this fix but it's speculative and it's too
dangerous to make speculative fixes this close to the 57 merge. Instead, we do
this surefire fix and lose a little correctness.

The onCreateView fix moved to bug 1401779.

MozReview-Commit-ID: DSq9jEgz6gL
2017-09-20 16:43:25 -07:00
Chenxia Liu aa4506d27e Bug 1400950 - Don't draw divider above Highlights title. r=mcomella
MozReview-Commit-ID: GHXKAhlbc7I
2017-09-19 18:38:16 -07:00
Chenxia Liu 7ac3ae6d5f Bug 1400950 - Update AS panel color. r=mcomella
MozReview-Commit-ID: C290c5OsmzE
2017-09-19 18:21:33 -07:00
Chenxia Liu 86cab77839 Bug 1395792 - Hide Highlights empty state when Highlights are disabled. r=mcomella
MozReview-Commit-ID: FMFTAFuWLqh
2017-09-19 17:49:41 -07:00
Chenxia Liu e195a41a01 Bug 1395792 - Destroy loaders on reload. r=mcomella
MozReview-Commit-ID: GccHdTISpky
2017-09-18 20:17:25 -07:00
Chenxia Liu 07feefeded Bug 1395792 - Add show/hide to onBindVH. r=mcomella
MozReview-Commit-ID: H4bAlcaVCld
2017-09-18 19:55:41 -07:00
Chenxia Liu 1d7fa7950e Bug 1395792 - Add listener for AS SharedPreferences. r=mcomella
MozReview-Commit-ID: 9bW9bYjVyhr
2017-09-18 19:39:59 -07:00
Michael Comella ea3e35b693 Bug 1400397: Do not try to reload failed highlight images. r=liuche
MozReview-Commit-ID: FnLcSfDrytS
2017-09-15 16:10:31 -07:00
Michael Comella b0ee9fa381 Bug 1400397: Use Icons if overridePageURL fails to load. r=liuche
Icons apparently doesn't fade images, however, so it looks bad. Also, we try to
request the image each time we bind, so scrolling up and down will create
additional pop-in, which also sucks.

MozReview-Commit-ID: 246pokTMFl7
2017-09-15 14:31:29 -07:00
Michael Comella e0771238ec Bug 1400072: Specify card size in onBind instead of onCreate. r=liuche
I believe this doesn't affect this bug because I think the ViewHolders are
recreated on rotation but for any other type of change, only bind will be
called so for correctness, we should update the size in bind.

MozReview-Commit-ID: 3ojO4TF89i4
2017-09-15 14:05:21 -07:00
Michael Comella 1dfe8029d7 Bug 1400072: Rm unused variable tilesMargin. r=liuche
MozReview-Commit-ID: G6Z3dUnKWLl
2017-09-15 10:51:50 -07:00
Michael Comella 045c0b2fc7 Bug 1400072: Cache tilesSize in swapCursor. r=liuche
In this sense, it acts as a refresh function, binding all of our UI state at
the same time, helping to prevent bugs where the UI gets out of sync.

For example, this fixes this bug because now the tileSize gets updated when we
swap the cursor, not just when we the page is initially constructed.

MozReview-Commit-ID: 7V2gFyiOJ1R
2017-09-15 10:48:28 -07:00
Michael Comella 29e2e6aa21 Bug 1400072: Pass in tilesSize when needed, rather than caching. r=liuche
This will help prevent the cache from going out of date.

MozReview-Commit-ID: GdUXF0oOSiK
2017-09-15 10:39:36 -07:00
Michael Comella 9dc483cb50 Bug 1400072: Make num tiles a constant. r=liuche
Since it's a constant, there's no reason to keep passing it around everywhere.
Also, the code that relied on it being a dynamic value is probably broken so
there's no reason to continue passing it around.

That being said, there is bug 1397854, which would have TopSites be 4 rows with
no pages, but this code is quite messy so I think it'd be worth trying to
refactor this code further before trying to implement that.

MozReview-Commit-ID: IoMNHVt67c4
2017-09-15 10:30:08 -07:00
Michael Comella 1bba49e0c3 Bug 1400072: Move TOP_SITE_COLUMNS/ROWS -> TopSitesPage. r=liuche
The TopSitesPage should really own details about the appearance of top sites.

MozReview-Commit-ID: LPfHGcUTv00
2017-09-15 10:26:19 -07:00
Chenxia Liu 5cbd0b4cd8 Bug 1393174 - Add "More" link to Pocket AS title. r=mcomella
MozReview-Commit-ID: kromR87f43
2017-09-14 17:54:50 -07:00
Michael Comella c95f28d5a5 Bug 1397888: Display pin icon in top-left of top sites card if pinned. r=liuche
I don't scale the pin size/margins based on the dynamic tile size. This could
mean we get into situations where the pin crowds out the top site tile but I
don't know if this would happen in practice.

MozReview-Commit-ID: Ct8EP3dPr6N
2017-09-13 17:16:40 -07:00
Michael Comella 35e25b0b24 Bug 1397888: Remove pin icon from top sites title. r=liuche
MozReview-Commit-ID: GTmfUzvD0k2
2017-09-13 16:58:39 -07:00
Chenxia Liu 91fe14b36e Bug 1399042: Move NO_POSITION check for IndexOutOfBoundsException in onItemClick. r=mcomella
MozReview-Commit-ID: GAs6HOwp8ru
2017-09-13 14:31:51 -07:00
Michael Comella 608da86598 Bug 1393579: Show subdomain.domain for pages without titles in top sites. r=liuche
MozReview-Commit-ID: 9SugVwZDbD7
2017-09-12 13:58:51 -07:00
Michael Comella 6fb90e1488 Bug 1388396: Use IconRequestBuilder.forActivityStream in AS UI. r=sebastian
MozReview-Commit-ID: jLVtXk0hJZ
2017-09-11 17:27:22 -07:00
Michael Comella b1774c2156 Bug 1398368: Drop malformed Pocket Top Stories. r=liuche
I tested this through the unit tests I added.

In theory, we could also validate URLs to make sure they're valid but users
should see 404s if they're not valid so this seems like unnecessary code.

MozReview-Commit-ID: 3XqsMawLabj
2017-09-12 16:36:21 -07:00
Sebastian Kaspari 029e8bd7dd Bug 1389296 - TopSitesCard: Only load icon if we have a non-empty non-null page URL. r=mcomella
MozReview-Commit-ID: D7oTM9oJ3zT
2017-09-04 16:02:00 +02:00
Sebastian Hengst dfdc91dfab Backed out changeset 77f982a2f17b (bug 1388396) 2017-09-13 09:50:29 +02:00
Michael Comella 7ed8015edb Bug 1388396: Use IconRequestBuilder.forActivityStream in AS UI. r=sebastian
MozReview-Commit-ID: jLVtXk0hJZ
2017-09-11 17:27:22 -07:00
Michael Comella aa0f4a38ea Bug 1391413: Show 2 lines of top sites titles for distributions. r=sebastian
MozReview-Commit-ID: JcW22s8oDMG
2017-09-11 13:27:54 -07:00
Michael Comella 66f66f92eb Bug 1391413: Always show page titles for distributions. r=sebastian
This is the desired behavior but as per comment 8, it breaks a few existing
distributions' titles so we'll display two lines for those distributions in
the upcoming changesets.

MozReview-Commit-ID: CKFbHXbs3HT
2017-09-07 15:30:00 -07:00
Michael Comella f4dd59c247 Bug 1393577: Change AS context menu title to subdomain.domain.tld. r=liuche
Unlike the previous changeset, we don't strip common subdomains because
"m.youtube.com" and "www.mozilla.org" can be informative and don't look bad
when you have a tld.

MozReview-Commit-ID: BOPH73pzAfh
2017-09-08 14:38:50 -07:00
Michael Comella 9b481cebb8 Bug 1393577: Change highlight domain title to subdomain.domain. r=liuche
We strip common subdomains from subdomain.domain because things like
"m.youtube" and "www.mozilla" look really bad.

MozReview-Commit-ID: wmWdcL8p8C
2017-09-08 14:43:40 -07:00
Michael Comella 8113f7c952 Bug 1395645: Increase Pocket Stories refresh to once an hour. r=liuche
I haven't tested this because it's very time-consuming for such a simple
change.

MozReview-Commit-ID: 7f4LLlBbrLw
2017-09-08 14:22:21 -07:00