If we cannot display all search engines then we want to show a smaller number so that the last one is
cut-off (we only display half of it). The previous version did not calculate the next smallest half
correctly: Instead of displaying 3.5 engines if we have space for 3.7 engines, we only displayed 2.5.
MozReview-Commit-ID: KfopL9td3ba
On Android N, the tab button flickers when drawing animations such as the loading progress bar,
or even the tab count increment, over the tabs button. Using hardware layers appears to fix
this. For consistency we could use this across most devices, except those running 4.4 or earlier.
There the button background (light gray) is drawn black with hardware layers, so we should stick
with the default on such devices.
MozReview-Commit-ID: H5VWEkrRbVf
(Backed out changeset 9575e608cabe)
loadUncachedFavicon allows loading favicons from the internet, whereas
getSizedFaviconForPageFromLocal restricts itself to the favicon cache.
(LoadFaviconTask's last parameter is (boolean) onlyFromLocal, which is
set to true in getSizedFaviconForPageFromLocal.
We could probably replace this with an Enum to make the parameter's purpose
more obvious.
MozReview-Commit-ID: C9uwcG0h0N
By default CalendarView doesn't receive sufficient height on pre-lollipop
devices, in fact the entire dialog won't even appear unless we manually
assign height. This is slightly hacky, but necessary to ensure correct
layouting. (We previously assigned both height and width to the CalendarView,
however that results in all kinds of odd behaviour - this change is necessary
only to have acceptable behaviour on older devices.)
MozReview-Commit-ID: H7wzHsrOJy4
Squashing CalendarView makes it look bad and hard to use - by allowing
it to expand to the dialog width we get a usable CalendarView.
Note that this breaks on Android 4.x. On these devices CalendarView is
implemented using a ListView, which for some reason isn't given
any space during layouting - this results in the actual days in the month
being hidden (we do however see the weekday titles / month title).
MozReview-Commit-ID: wHNx1xG3JK
Our current decision criteria is arbitrary: there's no good reason not
to use a CalendarView here. Moreover our previous criteria would result
in small tablets showing different views depending on orientation (Nexus 7:
CalendarView in landscape, pickers in portrait mode).
MozReview-Commit-ID: 8H0HTmCnzfP
Parsing the session store JSON data to restore the last session's tabs is both
- computationally relatively expensive
- involving disk I/O
therefore, we shouldn't be doing it on the main thread.
To make sure the session data is actually ready, subsequent code running from a different thread that needs to access it (loading the startup tab, the Recent Tabs panel reading the "Tabs from last time") checks that session store data processing has actually finished and waits if necessary.
MozReview-Commit-ID: EYf1fdglIrA
For session data parsing, we need to know whether we were invoked with an external URL or not. Since we want to move session data parsing forward to an earlier point in time, but also continue needing that external URL info during initialize() as well, we'll factor out those calculations into their own functions which can then be called from both places.
MozReview-Commit-ID: HFlT8uxC9yz
Android Studio doesn't recognise our version guards and is consequentially always showing two errors in GeckoApp, which makes it more difficult to spot when you've introduced an actual error.
MozReview-Commit-ID: LpNIwHOhEWE
Switchboard might not have any data during onCreate, instead we should query
switchboard when actually deciding whether to show the prompt.
MozReview-Commit-ID: DdulFoWHiF9
The concept of "background data" (as it exists in the Android options menu)
doesn't exist in the Android APIs - I think it should be covered under
isConnected. Thus, I removed our `isBackgroundDataEnabled` method.
One other network consideration, however: we may want to consider stopping
uploads on roaming.
In the previous implementation, we did not queue the ping for upload if
the network was not connected (in order to conserve disk space). However,
this doesn't allow us to see all of the days the user interacted with
the device (e.g. for engagement) so in this implementation, we always
queue the ping and stop in the UploadService if we're not connected.
MozReview-Commit-ID: 1mjnHq3l7Jj
These values are what are actually used UI telemetry (perhaps because the enums were added after the strings?). They're also a little less obnoxious than the enum names.
MozReview-Commit-ID: K5i2Hr4DR4J