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
Return to SearchResults on "Up" navigation from AppDetails
When arriving to the AppDetails screen from SearchResults, the Up navigation should return to SearchResults screen and not its actual parent.
Not only is this behavior intuitive, it is a commonly accepted UX paradigm on the platform.
See merge request !147
Instead, keep downloading until the `InputStream` returns -1.
Also, required updates to the UI so that when the download size is
not known, there is still a reasonable response to the user.
Note that this still fails when using the Android download manager
if the download attempts to get resumed, and the server did not
send a Connection: close, Content-Length, or Transfer-Encoding: Chunked
header.
See http://www.google.com/design/spec/style/typography.html
Remove useless attributes; add styles with proper paddings, size and color
for caption and body text. Unfortunately, line spacing attributes are
supported only since Jelly Bean.
Some were wrapped in BuildConfig.DEBUG, some weren't. Move all of them to
debugLog.
The ones that require building complex strings are left with an explicit
BuildConfig.DEBUG if so that the strings aren't constructed.
Since now we don't have problems with list item height, we can use two
different text labels for unsigned and unverified repositories
indication. Code now only switches visibility for them.
This is technical detail that should not be exposed to users, at least
not before repositories list which are the main data in the activity.
Last update label didn't work properly anyway: it was not updated on
repositories refresh, just on activity creation.
Only enable the light if it's a default. The vibration was causing issues
since we don't have the vibrate permission, and the sound is unnecessary.
Fixes#346.
Found it when trying to add a repo manually:
E/AndroidRuntime(30549): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.replaceAll(java.lang.String, java.lang.String)' on a null object reference
E/AndroidRuntime(30549): at org.fdroid.fdroid.views.ManageReposActivity$AddRepo.normalizeUrl(ManageReposActivity.java:547)
E/AndroidRuntime(30549): at org.fdroid.fdroid.views.ManageReposActivity$AddRepo.validateRepoDetails(ManageReposActivity.java:358)
E/AndroidRuntime(30549): at org.fdroid.fdroid.views.ManageReposActivity$AddRepo.access$700(ManageReposActivity.java:218)
E/AndroidRuntime(30549): at org.fdroid.fdroid.views.ManageReposActivity$AddRepo$4.afterTextChanged(ManageReposActivity.java:342)
E/AndroidRuntime(30549): at android.widget.TextView.sendAfterTextChanged(TextView.java:7698)
Analogous to the server commit that removes it on its side. If an index
includes it, we will fail silently since unrecognised tags are ignored.
SQLite doesn't allow deleting columns, so don't do a DB version bump to try to
remove it. It will be gone on new installs, and it doesn't keep current
installs from working. Tested both cases.
This avoids problems in a few corner cases:
* The description is empty (it would probably throw an exception)
* The description doens't end in newlines (as seen in #422)
For the general case that was already working, the result is the same.