Materialize app list
Improve the look of app list items. Note that compact mode is removed because it does not make much sense, see the screenshots.
Before (default layout, compact layout):


After:


Affects #471 and #467. Those bugs will still be relevant because there are other places with wrong padding and font style.
See merge request !157
If getSystemService(Context.DOWNLOAD_SERVICE) returns null, we should not go
ahead with using AsyncDownloaderFromAndroid. This would result in NPE and
crashes.
Fixes#442.
As the comment says, this should not be on until it can be opted out from. The
biggest problem is unwanted repo updates, e.g. when a user is on a mobile
connection.
Fixes#435.
The idea was good, but it applied the second-precise date format everywhere.
This broke dates on apps and apks, which have the format yyyy-MM-dd on the
index.
Fix this by having two sets of funcs in Utils, one for dates (precise to a
day) and one for times (precise to a second). We should use the latter for
dates we ourselves measure, like the last repo update time.
Add night theme
[Screenshot](http://i.imgur.com/gVK5M0G.png)
The screenshot is huge, so making it an image in markdown takes up a lot of space. Hence link.
See merge request !149
Similar to the dark theme, but dropping blue in favour of very dark shades of
grey.
Removed colorEdgeEffect to simplify the sharing of the style between dark and
night themes. It should default to colorPrimary anyway, so we're good.
Fixes#345.
This change primarily affects the AppDetails links section to make them easier to click. It also strips down the UI a bit to provide a cleaner interface as well as some modest Material Design tweaks.
Fixes#389.
Ddownload index, even when not presented with a Content-Length header (Fixes 430)
This works for the index download, but still does not work for downloading .apks correctly. That is, the Android Download Manager needs one of:
* `Content-Length: ...`
* `Connection: close`
* `Transfer-Encoding: Chunked`
headers to be set to work correctly. In the absence of all three of these, problems ensue. In fact in my toy web server, even the `Connection: close` did not seem to work correctly, but I'd be happy to be corrected on that. Either way, this is an improvement on what was there before.
For reference, here is my toy PHP web server, which can be saved in the root of the F-Droid repo and invoked with:
> `php -S 10.0.0.4:8888 no-headers.php`
```
<?php
function streamFile( $file ) { $size = filesize( $file );
$contents = file_get_contents( $file );
$buffer = (int)( $size / 5 );
$bytes = 0;
while ( $bytes < $size ) {
$toStream = min( $size - $bytes, $buffer );
echo substr( $contents, $bytes, $toStream );
$bytes += $toStream;
// Sleep to allow progress to be viewed in F-Droid
sleep( 1 );
}
}
$index = "/fdroid/repo/index.jar";
$firefox = "/fdroid/repo/fennec-40.0.multi.android-arm.apk";
// Test downloading a large .apk to see how it behaves
if ( $_SERVER['REQUEST_URI'] == "/fdroid/repo/fennec-40.0.multi.android-arm.apk" ) {
$file = $firefox;
} else {
$file = $index;
}
// Android Download Manager requires this (if not using Content-Length or Transfer-Encoding
// headers, but I can't seem to get it to work as expected).
header( "Connection: Close" );
streamFile( dirname( __FILE__ ) . $file );
```
See merge request !150