2005 Commits

Author SHA1 Message Date
Daniel Martí
0ced75d451 Bump to 0.82 0.82 2015-03-23 16:44:45 +01:00
Daniel Martí
bb775bde08 Run translation fixing scripts 2015-03-23 16:43:38 +01:00
Daniel Martí
61f9d3ac86 Run fix-apostrophes 2015-03-23 12:21:08 +01:00
F-Droid Translatebot
cb9ef84027 Translation updates 2015-03-23 08:55:31 +00:00
Daniel Martí
bc69c8d6ed Run fix-apostrophes 2015-03-19 19:43:18 +01:00
F-Droid Translatebot
0736aef5fc Translation updates 2015-03-19 18:37:46 +00:00
Daniel Martí
40308ce8cb Prepare changelog for release 2015-03-19 19:35:12 +01:00
Peter Serwylo
eaea0e2c23 Fix #85: Remove downloaded index files that hang around.
If the download process is interrupted, a "dl-" file hangs around in
F-Droid's cache directory. If the download succeeds, extracts an xml
file from the downloaded .jar file, and then the rest of the process
is interrupted, then a "index-*.xml" file hangs around in F-Droids
files directory.

This fix removes these two types of left over files when F-Droid
is started. In addition, it also makes it so that the downloaded
repo indexes are now more clearly named "index-*-downloaded" (with no
extension, because the code which does it doesn't know whether it is
a .jar or .xml file, and it doesn't matter anyway). Also, it extracts
the .xml files to the cache directory too (instead of the files dir)
and names them "index-*-extracted.xml".

There is some code which removes the old "dl-" files that will become
redundant after the first time it is executed on a users device after
upgrading F-Droid. It is a very small amount of code run on startup,
so I am not concerned about the performance implications of leaving it
there, but I put a comment explaining that it can be removed in the
future.

Includes minor formatting changes, and a few annotations.
2015-03-19 07:38:54 +11:00
Daniel Martí
8e394563e4 A couple more things in the changelog 2015-03-16 20:28:24 +01:00
Peter Serwylo
3abb426fc3 Added a message when any of the app lists are empty.
Previously, a few people have been confused by an empty list when they first
open F-Droid (e.g. if they are not connected to the internet, and repos didn't
update). This provides some feedback so that there is never a blank screen.

Fixes Issue #34.
2015-03-16 21:42:10 +11:00
Daniel Martí
c2eb9a9b67 Bump to 0.81-test 0.81-test 2015-03-15 19:14:04 +01:00
Daniel Martí
f77f9c5435 Run remove-partial-arrays 2015-03-15 19:13:30 +01:00
Daniel Martí
8b03a0c196 Update the changelog with recent fixes/changes 2015-03-15 17:29:11 +01:00
Daniel Martí
680a468b6c Don't use fragment adapter if it's null (fixes #82) 2015-03-15 17:13:42 +01:00
Daniel Martí
06ae1bc044 Merge branch 'fix/issue-5-guess-repo-path' of https://gitlab.com/pserwylo/fdroidclient 2015-03-15 16:58:06 +01:00
Peter Serwylo
09029dd193 Merge branch 'refresh_header_161' into 'master'
Refresh AppDetails header on package state change (fix #161)

Update the application details to display the correct state on
application install/uninstall.

Should fix issue #161
https://gitlab.com/fdroid/fdroidclient/issues/161

See merge request !56
2015-03-13 14:03:25 +00:00
Romain Vimont
f0a8780755 Use the same fragment id for portrait & landscape
To refresh the header, we retrieve the fragment from its id.

But the landscape layout used another id for the same fragment, so it
could not be retrieved, leading to a NullPointerException in landscape.

Therefore, use the same fragment id as in the portrait layout.
2015-03-13 14:48:58 +01:00
Romain Vimont
cb3b2e0d8e Refresh AppDetails header on package state change
Update the application details to display the correct state on
application install/uninstall.

Should fix issue #161
https://gitlab.com/fdroid/fdroidclient/issues/161
2015-03-13 14:48:58 +01:00
Peter Serwylo
74b285a77f Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).

This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.

The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.

Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-14 00:44:17 +11:00
Peter Serwylo
d7c19c76c9 Merge branch 'npe_135' into 'master'
Do not manually call onChange() (fix NPE)

If the AppDetails activity has been destroyed by the system during an
application installation/remove, it is recreated once it should be
displayed again (this behavior can be forced by enabling "Don't keep
activities" in Android developer options).

In onCreate(), it passes its instance of myInstallerCallback to an
Installer. In onActivityResult() (which is called before onResume()),
this installer calls a method (onSuccess() or onError()) on this
callback. The implementation of these methods (the anonymous inner class
assigned to myInstallerCallback) dereference myAppObserver, which is
still null, because it will be initialized in onResume(), so a
NullPointerException is thrown.

However, the problem is not only that myAppObserver.onChange() is called
when myAppObserver is null, but that it should not be called manually at
all: it is a ContentObserver, so it is automatically called when
registered to the content resolver. As a consequence, this callback was
called twice.

Removing these calls fix both problems.

Should fix issue #135
https://gitlab.com/fdroid/fdroidclient/issues/135

See merge request !58
2015-03-13 12:37:34 +00:00
Romain Vimont
eef1e0a406 Externalize application changed actions
When we receive notifications indicating that the app has changed, the
App object needs to be changed and the view updated.

These notifications can be received from two sources:
 - the ContentObserver;
 - onActivityResult().

Thus, the implementation should not be related to the ContentObserver
(in theory, we might want to keep only the onActivityResult()
notification). Therefore, move it to a separate method in AppDetails.

This also preventively avoids bugs when the ContentObserver is null.
2015-03-13 10:57:29 +01:00
Romain Vimont
578084ff96 Revert "Do not manually call onChange() (fix NPE)"
This reverts commit 47e065442edc108d4bb38f9daaa7cdb3fff26b49.

Now that the ContentObserver is created when activity is started (even if not
resumed), then it will be non-null during onActivityResult(). Therefore,
the calls to onChange() will not lead to NullPointerException anymore.

The reason why we want to manually call onChange() is that the
ContentObserver notifications may happen several seconds later:
https://gitlab.com/fdroid/fdroidclient/merge_requests/58#note_948719
2015-03-13 10:26:42 +01:00
Romain Vimont
cda80f5de6 Register ContentObserver when activity is started
The ContentObserver was registered only when the activity was in resumed
state. However, in started but paused state (when the activity is
visible but not in focus), we still want to receive these notifications
to update the view.

Therefore, register it on start and unregister it on stop.

As a consequence, myAppObserver will be non-null during
onActivityResult().
2015-03-13 10:22:06 +01:00
Romain Vimont
4e2ab4c048 Call super.onPause() first
super.onPause() should always be called first:
http://developer.android.com/training/basics/activity-lifecycle/pausing.html#Pause
2015-03-13 10:18:26 +01:00
Romain Vimont
47e065442e Do not manually call onChange() (fix NPE)
If the AppDetails activity has been destroyed by the system during an
application installation/remove, it is recreated once it should be
displayed again (this behavior can be forced by enabling "Don't keep
activities" in Android developer options).

In onCreate(), it passes its instance of myInstallerCallback to an
Installer. In onActivityResult() (which is called before onResume()),
this installer calls a method (onSuccess() or onError()) on this
callback. The implementation of these methods (the anonymous inner class
assigned to myInstallerCallback) dereference myAppObserver, which is
still null, because it will be initialized in onResume(), so a
NullPointerException is thrown.

However, the problem is not only that myAppObserver.onChange() is called
when myAppObserver is null, but that it should not be called manually at
all: it is a ContentObserver, so it is automatically called when
registered to the content resolver. As a consequence, this callback was
called twice.

Removing these calls fix both problems.

Should fix issue #135
https://gitlab.com/fdroid/fdroidclient/issues/135
2015-03-12 16:21:19 +01:00
Daniel Martí
070054892e Run optipng -o9 on all png images 2015-03-11 23:35:03 +01:00
Daniel Martí
bd6e2a3046 Bump gradle plugin to 1.0.1
I tried 1.1.3, but it failed. Needs further investigation.
2015-03-11 23:32:05 +01:00
Daniel Martí
6eff521459 Bump build-tools to 22.0.0 2015-03-11 23:09:42 +01:00
Daniel Martí
186c1fecea Merge branch 'crash_uninstall_167' of https://gitlab.com/rom1v/fdroidclient 2015-03-11 23:05:16 +01:00
Romain Vimont
89bedfda13 Do not crash on app uninstall
Immediately after an app uninstall, the associated App will be updated
by a call to reset() in the AppObserver.onChange().

But before receiving this event, the activity and the fragments resume,
leading to a call to getInstalledStatus(…). At this stage, we don't know
that the app has been removed yet, but the package manager already
removed it. Therefore, PackageManager.getInstallerPackageName(…) throws
an IllegalArgumentException.

In that case, consider that the application has been uninstalled.

Should fix issue #167
https://gitlab.com/fdroid/fdroidclient/issues/167
2015-03-11 20:32:15 +01:00
Daniel Martí
ba544cf5f1 Merge branch 'fix_compilation' into 'master'
Escape apostrophe in resources

In XML resources files, apostrophes must be escaped.

(fix compilation)

See merge request !55
2015-03-11 18:22:40 +00:00
Romain Vimont
0570c85133 Escape apostrophe in resources
In XML resources files, apostrophes must be escaped.

(fix compilation)
2015-03-11 15:50:03 +01:00
Daniel Martí
4a5d732c01 Run remove-unused-trans 2015-03-10 16:14:10 +01:00
Daniel Martí
116947082a Run fix-ellipsis 2015-03-10 16:12:23 +01:00
F-Droid Translatebot
d88ad55504 Translation updates 2015-03-10 16:00:42 +01:00
Daniel Martí
d338046329 Bump to 0.80-test 0.80-test 2015-03-08 20:38:44 +01:00
Daniel Martí
00195be469 lint text output is no longer useful 2015-03-08 20:37:36 +01:00
Daniel Martí
996f81ced2 Run remove-partial-arrays 2015-03-08 20:34:58 +01:00
Daniel Martí
d76f7e13b3 Add script to remove partially translated arrays
They may crash the client, so better use the original english instead
2015-03-08 20:34:56 +01:00
Daniel Martí
7bb9615355 Rewrite reomve-unused-trans in python
This makes it no longer depend on lint, and also adds support for arrays
2015-03-08 20:29:05 +01:00
Daniel Martí
8c7a821e8d Place some xml closing tags separate for readability
This also means that diffs will get better if more lines are added to the end
of each attribute list
2015-03-05 16:06:10 +01:00
Daniel Martí
27f5793fd8 Run tools/remove-unused-trans.sh 2015-03-05 14:13:39 +01:00
Daniel Martí
8ed63c7e7a Run tools/fix-ellipsis.sh 2015-03-05 14:13:22 +01:00
Daniel Martí
911b95dc87 Add tools/fix-apostrophes.sh and run it 2015-03-05 14:11:33 +01:00
F-Droid Translatebot
f062de9092 Translation updates 2015-03-05 11:58:10 +01:00
Peter Serwylo
d3a22d0876 Merge branch 'feature/optional-jar-dependencies' into 'master'
Default to building F-Droid with precompiled dependencies, with option for source dependencies.

I hope this isn't to controversial, I've tried to very clearly articulate my thinking behind it in the commit message for 6594357c and also document the feature in detail in F-Droid/libs/README.md.

When I first contributed to F-Droid, it had zero dependencies, and so was a matter of checking it out and running `ant debug`. I'd like future contributors to be able to experience this too, by checking out the code and then running `gradle assembleDebug`.

I've ensured that the premise of building libraries from source is still front and centre though, and building from source is a matter of running `gradle -PsourceDeps assembleDebug` as documented in F-Droid/libs/README.md.

I'd appreciate if somebody (hopefully with all of the dependencies already checked out and building) would be able to test this for me, and provide feedback. Happy to answer any questions which remain unanswered after reading the commit message and the F-Droid/libs/README.md file.

See merge request !49
2015-03-04 23:10:19 +00:00
Peter Serwylo
ccdb161de4 Final fixup before merge. Rebuild binary deps, minor fixes.
Binary deps were not getting build and cleaned from the binaryDeps
subdirectory of "libs". Also, reverted the android support appcompat
library target to android-19, as there was no need to change it.
2015-03-03 18:44:36 +11:00
Peter Serwylo
aa38418c91 Bump support libraries to v20. Gradle doesn't build them by source for now.
The support libraries expect to be using the gradle plugin version 0.10.0.
We are currently on version 1.0.0. They use APIs in their build script which
have moved or been removed, and so the build just breaks when we run it with
the 1.0.0 plugin. I tried some magic to make it work in various ways, but
kept failing. As such, I've reverted the `gradle -PsourceDeps` build to not
build the support libraries from source. In the future, we should be able to
change this if they change the plugin version to a more recent one.

Note that the ant build script still hasn't been modified, and so will be
using the binary support-v4 library, but should build appcompat-v7 from source.

Was going to bump to Support v21, however there is some behaviour change which
causes a crash. They have removed the progress view from the toolbar/actionbar.
This breaks the AppDetails activity. As such, I'll leave that for the future.

For now, there will be a slight difference between building with
ant (which uses support v-almost-21) and gradle (which uses v20).
This will stay the case until we get around to completely porting
the app to v21, and fixing any bugs or UI sadness that arises.
2015-03-03 00:46:43 +11:00
Peter Serwylo
eec57945c0 Default to binary dependencies, with option for source builds.
NOTE: This commit does not touch the ant build system at all,
only gradle.

There are currently 23 gradle projects which require configuration,
let alone building, in order to build F-Droid. This takes a non-trivial
amount of time/memory/cpu. Additionally, it also provides difficulties
when importing the project into Android Studio - which is the IDE that
many potential contributors will be using. Finally, I have over 100mb
of data in the extern/ folder, and the support libraries require almost
every single Android SDK to be installed, which is several GB. This is
not a friendly environment to encourage people to submit merge requests.

However, I'm very mindful of the need for an open source project such
as F-Droid to be able to be built from source. So to make sure we have
the best of both worlds, I've ensured that building all dependencies
from source is still possible.

The F-Droid/libs/README.md file explains in greater detail how to
do this (i.e. "gradle -PsourceDeps build").

As much as possible, I've tried to make the binary dependencies fetched
from jcenter. However there are still libraries which either haven't
integrated required changes for F-Droid back upstream, or don't have
mavenCentral/jcenter binaries available.

Android preference fragment has been changed to the original
upstream repository. The one we had before was because upstream
hadn't merged a MR for gradfle support yet. However, that has
now been merged. This version still doesn't exist in jcenter though.

In order for libsuperuser to build from upstream, using
`gradle -PsourceDeps`, we need to include a few gradle plugins
from jcenter which are never actually used (used by upstream to
release to jcenter).

Even though support-v4 is included through jcenter, it is kept in
the libs directory, so that ./ant-prepare.sh can use it.

Update support preference fragment to newer version. There has been
bugfixes commited, so lets include them in the version we are using.
2015-03-01 10:21:51 +11:00
Peter Serwylo
2da1a5acd4 Merge branch '172-typo' into 'master'
Fix #172:  typo in English strings

Fix typo in English string (Do you ant >> Do you want)

See merge request !54
2015-02-28 22:42:10 +00:00