Clean up tabs fragments
No functional changes, just refactoring. The only visual change is that empty text is now positioned at the center which was the initial design (as far as I understand):

See merge request !165
Not sure why it was added initially but now it appears to be unneeded:
the support library does everything right and the lists are themed
properly without any hacks.
Never fallback to UIL for handling image downloads, only use for displaying.
@relan picked up a bug I introduced while refactoring the icon downloading code in !139. This fixes that bug.
Our `IconDownloader` extended `BaseImageDownloader` from UIL. There was an
explicit check in the F-Droid `IconDownloader` which looks for
HTTP/HTTPS/Bluetooth schemes. If it wasn't one of these, it fell back
to the base class. This was what was happening for local cached image
files. As such, when the `getInputStream(...)` method was refactored
to only use F-Droids `DownloadFactory` and not delegate to the base class,
it failed on local "file://" URLs.
This change introduces a `LocalFileDownloader` and makes the `DownloaderFactory`
aware of it.
The `BaseImageDownloader` class only provides support for the following schemes:
* HTTP
* HTTPS
* File
* Android content providers
* Android assets
* Android drawables
F-Droid now supports HTTP, HTTPS, and File URLs. There is not currently any
need for content proiders, assets or drawables to get icons for apps in F-Droid.
If there is a need in the future (e.g. an issue currently discusses loading
icons from installed apps if possible) then that specific `Downloader` can get
introduced to solve the problem.
See merge request !164
Our `IconDownloader` extended `BaseImageDownloader` from UIL. There was an
explicit check in the F-Droid `IconDownloader` which looks for
HTTP/HTTPS/Bluetooth schemes. If it wasn't one of these, it fell back
to the base class. This was what was happening for local cached image
files. As such, when the `getInputStream(...)` method was refactored
to only use F-Droids `DownloadFactory` and not delegate to the base class,
it failed on local "file://" URLs.
This change introduces a `LocalFileDownloader` and makes the `DownloaderFactory`
aware of it.
The `BaseImageDownloader` class only provides support for the following schemes:
* HTTP
* HTTPS
* File
* Android content providers
* Android assets
* Android drawables
F-Droid now supports HTTP, HTTPS, and File URLs. There is not currently any
need for content proiders, assets or drawables to get icons for apps in F-Droid.
If there is a need in the future (e.g. an issue currently discusses loading
icons from installed apps if possible) then that specific `Downloader` can get
introduced to solve the problem.
Cache installed signature
This will later be useful for #122 and others. Also a few more fixes related to signatures and package information.
CC @pserwylo
See merge request !158
These are written manually and mostly don't contain HTML. Some html is
fine if you want to use links or markup, but <p> elements are just
pointless and very seldom used. Be consistent in not using them.
Added tests for multiple repositories providing same apks
Right now, multi repo support works, but is kinda funky. While fixing #324, I accidentally broke this support without realising it. So in the interests of making my approach to #324 more test driven, I've written some tests for multi repo support.
Initially I wrote tests for the actual correct, desirable behaviour. Then when it became apparant that we dont' do this, I commented those tests out (but left them there for hopefully future multi-repo work) and then added tests for the current behaviour to make sure we don't introduce regressions.
Android unit testing framework is nice for testing content providers. It is nice for testing file handling. However I really struggled to get it working with both. Had to do some interesting things with instrumentation and contexts in order to get it to work.
I'm sure Android has nice `Service` testing capabilities too. But given the trouble with instrumentation/contexts/files/providers/etc, it was easier for me to refactor the parts of `UpdateService` that I needed to test into a separate, testable class.
See merge request !163
Make closing of `Downloader`s more concise.
*NOTE: This is only a WIP branch in so far as I haven't tested it, as it was done on the train before my holiday. The code is final though, so if people are happy it works, please merge.*
The base `Downloader` class now wraps the `InputStream` returned by
any child classes, in order to notify the child class when that stream
is closed. This prevents each child class having to figure out a way
to be notified of this.
This helps keep the API concise, because close handling is dealt with
without the need to add any public methods to the `Downloader` class
hierarchy.
Also removed some dead code which was unused.
See merge request !139
Ensure the "no apps to display" doesn't overlap with the category spinner.
There is no layout .xml file for the updated/installed list,
but there is for the available apps list. As a result, the `TextView` containing
the empty list message is added dynamically. With the recent improvements to
the category spinner, a `RelativeLayout` was used instead of a `ListView`. To
remedy this, the layout has been augmented to ensure the dynamically added
`TextView` still displays correctly.
*Before:*

*After:*

See merge request !162
There is no layout .xml file for the updated/installed list,
but there is for the available apps list. As a result, the `TextView` containing
the empty list message is added dynamically. With the recent improvements to
the category spinner, a `RelativeLayout` was used instead of a `ListView`. To
remedy this, the layout has been augmented to ensure the dynamically added
`TextView` still displays correctly.
Came across this whibluetooth swap.
I think it is reasonable to guard against null activities here, because
we are likely not releasing observers correctly, and thus the observer
may receieve a notification when the activity is not attached.
The base `Downloader` class now wraps the `InputStream` returned by
any child classes, in order to notify the child class when that stream
is closed. This prevents each child class having to figure out a way
to be notified of this.
Also removed some dead code which was unused.
Leave only the ones which align with the current multi-repo behaviour
that F-Droid exhibits.
The commented out tests can be uncommented in the future when working
on proper multi-repo support.
(One of) the problems with F-Droid's multiple support is that there is
a primary key on the fdroid_apk table which is a composite of:
* id
* vercode
Which means that two repos providing the same version means one will
update the other, rather than ending up with two different versions.
Instead, there should be some other way to differentiate apks from
different sources. Firstly, it should take into account the signing
cert. Secondly, it may taken into account the hash, because two people
could sign different apks with the same cert and then we are back at
square one.
The new test skeletons right now update three different repos
in different configurations. They do so such that the order of updates
changes and therefore the way in which conflicts between repos are
dealt with are tested.
They should all have the same result (though I'm not sure exactly what
that should be yet).
Set category filter height to 48dp
This improves usability of the category spinner. Divider is now behind
it. This makes the layout visually more compact while keeping actual
touch target 48dp. See
http://www.google.com/design/spec/layout/metrics-keylines.html#metrics-keylines-touch-target-size
Before and after:


See merge request !161
New icon for Privileged Extension
Align Privileged Extension icon with current F-Droid icon. The # sign is associated with privileges because it's usually used by root shell. Lego blocks that can be plugged into each other are also known very well around the world.
"F-Droid Privileged Extension icon" by @relan is licensed under CC-BY-SA 3.0 or GPLv3+.
Smaller size:

Larger size:

Raster images are optimized using `optipng -o7 -zm1-9`.
See merge request !155
Make category filter look Material
Get rid of Gingerbred legacy.
Before and after (note the glitch below the spinner):


See merge request !159