3009 Commits

Author SHA1 Message Date
relan
32413a2753 Put empty text below the categories spinner
When an on-screen keyboard is used to enter a search query, empty text
can overlap categories spinner on small screens.
2015-11-13 08:19:57 +03:00
Daniel Martí
f7a0063495 proguard: only keep zipsigner 2015-11-12 20:21:48 +01:00
F-Droid Translatebot
e0c09853b9 Pull translation updates from Weblate
Translators:

ageru               French
Benedikt Geißler    German
Kiril LastName      Bulgarian
Marcelo Santana     Portuguese (Brazil)
Marvin W            German
2015-11-09 17:12:35 +01:00
Daniel Martí
ad4e53098a Merge branch 'clean-up-tabs-fragments' into 'master'
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):

![screenshot](/uploads/1f930f283dae86f20675c11c861183f2/screenshot.png)


See merge request !165
2015-11-09 16:09:20 +00:00
relan
b533bc2112 Remove unused string swap_tap_to_select_apps 2015-11-09 15:51:18 +03:00
relan
3bbcca9966 Remove unused string update_all 2015-11-09 15:47:20 +03:00
relan
96ffb5f0fd Remove unused layouts 2015-11-09 15:45:47 +03:00
relan
7fdcd706fd Split tabs layouts
Use separate layouts for the three tabs. This simplifies code and improves
maintainability.
2015-11-09 15:43:09 +03:00
relan
950854318b Add styles for app list and empty text
Those styles will be used in the three layouts that will define the
look of the fragments.
2015-11-09 15:43:09 +03:00
relan
080527bf2e Remove ThemeableListFragment
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.
2015-11-09 15:42:52 +03:00
relan
817cac3002 Remove dead code in CanUpdateAppsFragment
Remove unused layout creation code. If needed, it can be re-added later as
an XML resource which is a much more maintainable way to define layouts.
2015-11-09 15:08:53 +03:00
Daniel Martí
3e44ab2474 Merge branch 'download-local-files-through-fdroid' into 'master'
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
2015-11-08 10:07:27 +00:00
Peter Serwylo
1a5bd84fad Never fallback to UIL for handling image downloads, only use for displaying.
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.
2015-11-08 10:30:23 +11:00
F-Droid Translatebot
447dbe73ea Pull translation updates from Weblate
Translators:

ageru                French
Phạm Nguyễn Hoàng    Esperanto
Phạm Nguyễn Hoàng    Vietnamese
2015-11-07 14:03:48 +01:00
Daniel Martí
3df93940c8 Merge branch 'installed-sig' into 'master'
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
2015-11-07 13:01:21 +00:00
Daniel Martí
eefbee969e Store installed app signature in cache
This means we can fetch the signatures only once instead of every time we need
them. Start by using the cache in AppDetails.
db-version/51
2015-11-07 13:57:34 +01:00
Daniel Martí
bb9426763c Remove <p> from comments
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.
2015-11-07 13:25:01 +01:00
Daniel Martí
40092a07dd Don't duplicate repo info in UpdateException
The exception already contains the repo object, so don't hard-code the
address in the message string again.
2015-11-07 13:19:30 +01:00
Daniel Martí
4412b0a557 CI: Bump sdk to 24.4.1 2015-11-07 13:15:54 +01:00
Daniel Martí
dd9a7207ac Bump to 0.98-alpha0 after stable 2015-11-07 13:15:21 +01:00
Daniel Martí
94b30a54a6 Merge branch 'test-multi-repos' into 'master'
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
2015-11-07 11:45:47 +00:00
Peter Serwylo
47196234fe Merge branch 'improve-downloader-close-handling' into 'master'
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
2015-11-06 22:47:11 +00:00
Peter Serwylo
5307d56ee5 Merge branch 'fix-empty-message-display' into 'master'
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:*

![before](/uploads/15e8dca7a98c6ed2e302e33934cddd52/before.png)

*After:*

![after](/uploads/88de17059d84c6c2bf97d108f3504905/after.png)

See merge request !162
2015-11-06 22:43:27 +00:00
Peter Serwylo
12d5c5c7b4 Format to make checkstyle happy. Remove unused code. 2015-11-07 09:40:44 +11:00
Peter Serwylo
002d356ece 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.
2015-11-07 09:05:10 +11:00
Peter Serwylo
94410c5dbc Code formatting to pass checkStyle. 2015-11-07 08:39:23 +11:00
Peter Serwylo
3ad429aa6b Guard against null activity.
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.
2015-11-07 08:39:23 +11:00
Peter Serwylo
f388f32fcf Don't use download manager for Bluetooth downloads.
The F-Droid Bluetooth downloader must be used for these, as it is a
custom protocol and Android download manager only understands HTTP
and HTTPS.
2015-11-07 08:39:23 +11:00
Peter Serwylo
012cdce37b Make closing of Downloaders more concise.
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.
2015-11-07 08:36:17 +11:00
Peter Serwylo
938c992023 Comment out tests for future, desirable behaviour.
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.
2015-11-07 08:05:13 +11:00
Peter Serwylo
1c179848b7 Added tests for current multi-repo behaviour.
This is the bare minimum of what must be maintained going forward.
Ideally the behaviour sohould be better, but that is for the future.
2015-11-07 08:05:13 +11:00
Peter Serwylo
0685c16efe More work on multi-repo tests, currently broken due to F-Droid being broken.
(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.
2015-11-07 08:05:13 +11:00
Peter Serwylo
f794d1e7a5 Infrastructure for doing test driven development to support multiple repo dev.
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).
2015-11-07 08:05:13 +11:00
Peter Serwylo
8d1e20b7fd Remove TargetApi(8) because that is our min-sdk now. 2015-11-07 08:05:13 +11:00
Peter Serwylo
b6218c6d05 Refactored code which inserts apps into database to make testable.
Putting it in the UpdateService made it a little tricky to test, so
I moved it out to a separate class called `RepoPersister`.
2015-11-07 08:05:13 +11:00
F-Droid Translatebot
c6a8bd2139 Pull translation updates from Weblate
Translators:

Dimos D            Greek
Dmitry Mikhirev    Russian
Michalis           Greek
Szöllősi Attila    Hungarian
2015-11-05 12:06:14 +01:00
Daniel Martí
c74e272de7 Bump build-tools to 23.0.2 2015-11-05 12:00:42 +01:00
Daniel Martí
6483106a46 Merge branch 'category-filter-height' into 'master'
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:

![before](/uploads/b52b3c84675c8b3ef5896e90967dafd4/before.png)
![after](/uploads/a07efee75bdfe5356378fa9960da8730/after.png)


See merge request !161
2015-11-05 10:16:38 +00:00
relan
0bd995a731 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
2015-11-05 11:56:18 +03:00
Daniel Martí
d242440fe3 Fix all InlinedApi lint warnings 2015-11-01 20:16:31 +01:00
Daniel Martí
ca9e390e60 lint: ignore UnusedAttribute 2015-11-01 20:09:31 +01:00
Daniel Martí
81db276f8d Avoid showAsAction=always whenever possible
In AppDetails, work around it by using ifRoom and placing that button
first so that it gets preference. The rest aren't affected at all.
2015-11-01 20:06:17 +01:00
Daniel Martí
6db5da2cf7 Fix string formatting issues found by lint 2015-11-01 19:54:37 +01:00
F-Droid Translatebot
c5a36f34f2 Pull translation updates from Weblate
Translators:

agilob                   Polish
Allan Nordhøy            Norwegian Bokmål
Kiril LastName           Bulgarian
Kristoffer Grundström    Swedish
Mladen Pejaković         Serbian
2015-11-01 19:49:07 +01:00
Daniel Martí
41d2c69d2e Remove unused ic_info_white drawable
The layout code that uses it is now commented out. This commit can be
reverted once the layout code is used again in the future.
2015-11-01 19:43:45 +01:00
Daniel Martí
41fbbd9825 Exclude more license/notice files from apk
This reduces the final apk size by an additional 5KB.
2015-11-01 19:38:29 +01:00
Daniel Martí
04e8117c3e Bump to 0.97-alpha8 v0.97-alpha8 2015-10-31 10:12:07 +01:00
F-Droid Translatebot
079e704375 Pull translation updates from Weblate
Translators:

Anders Jonsson           Swedish
Kristoffer Grundström    Swedish
Mladen Pejaković         Serbian
2015-10-31 10:09:53 +01:00
Daniel Martí
7c2b7ef280 checkstyle fix 2015-10-31 10:09:23 +01:00
Daniel Martí
4bfae52a9e Merge branch 'privileged-extension-icon' into 'master'
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:

![privileged-small](/uploads/5af03c7d7e7c50f3669b72f2c913c08f/privileged-small.png)

Larger size:

![privileged-large](/uploads/9408b31a92e154e1e8a9cd3953889d94/privileged-large.png)

Raster images are optimized using `optipng -o7 -zm1-9`.

See merge request !155
2015-10-29 15:43:20 +00:00