3206 Commits

Author SHA1 Message Date
Daniel Martí
c1f0414b6c Merge branch 'upgrade-arrow-fix' into 'master'
Fix values-ldrtl placement

Fix rebase error in !235.

See merge request !238
2016-03-29 15:56:55 +00:00
relan
406094b56d Fix values-ldrtl placement 2016-03-29 18:10:00 +03:00
Daniel Martí
7ef4e4245b Merge branch 'upgrade-arrow-rtl' into 'master'
Fix version upgrade string for RTL languages

In right-to-left languages _forward_ is the direction to the left, so leftwards arrow should be used to indicate upgrade:

![upgrade-arrow-rtl](/uploads/238dd85c33c92336e71357e4250aaef3/upgrade-arrow-rtl.png)

For left-to-right languages it remains the same:

![upgrade-arrow-ltr](/uploads/5e06ace9e6bf868ed89684c274f4e813/upgrade-arrow-ltr.png)

Closes #609.

See merge request !235
2016-03-29 13:50:53 +00:00
relan
057f6c167c Skip values-ldrtl while listing languages
ldrtl is a modifier ("layout direction right-to-left"), not a language.
2016-03-29 16:03:59 +03:00
relan
771ac45b8a Add version upgrade string for RTL languages 2016-03-29 15:59:39 +03:00
relan
d54a4b07e5 Move version upgrade arrow string to resources
Hardcoded strings cannot be localized.
2016-03-29 15:59:39 +03:00
Daniel Martí
ec53f4e05c Merge branch 'simplify-downloaders' into 'master'
Simplify Downloaders

This is some groundwork to simplify the Downloader stuff in preparation to moving it to something like an `IntentService`, as part of #601.  This mostly removes unused bits that I've found in the process of writing the `DownloaderService`.  Some of these events will be added back in a more consistent way, so that there is one event type for the same idea throughout the code base.

See merge request !236
2016-03-29 12:46:19 +00:00
Hans-Christoph Steiner
d76d7aa367 remove unused ApkDownloader.EVENT_APK_DOWNLOAD_CANCELLED
This also removes all the related stuff that resulted in
EVENT_APK_DOWNLOAD_CANCELLED being sent. Since EVENT_APK_DOWNLOAD_CANCELLED
ultimately does nothing, that whole bit of plumbing is unused.
2016-03-29 14:13:42 +02:00
Hans-Christoph Steiner
ab709e171a remove ApkDownloader.EXTRA_TYPE, it is entirely unused
This constant is wired up, but ultimately does nothing at all, since all
of the cases in the switch do the exact same thing.
2016-03-29 14:11:40 +02:00
Hans-Christoph Steiner
9c47f56f03 remove unused event message: ApkDownloader.ERROR_DOWNLOAD_FAILED 2016-03-29 14:09:30 +02:00
Hans-Christoph Steiner
2019b7a7c3 make all Downloader downloads cancelable
Allowing all downloads, including updates, to be canceled simplifies the
code and if the user wants to cancel an update, they should be able to. But
canceling updates is not implemented in this commit.
2016-03-29 14:07:51 +02:00
Hans-Christoph Steiner
88b5e284b5 use commons-io via a gradle dependency
This makes it so gradle provides all dependencies, rather than a mix of
classes that are copied in versus imported via gradle.  This library is
already used by the tests, so its not really a new dependency, and proguard
should remove all the unused stuff.
2016-03-29 14:06:52 +02:00
Hans-Christoph Steiner
2578e6bdff remove unused portions of DownloaderFactory
Since this is internal code and not a library for use with other projects,
it should only include the methods that are actually in use. The other
copies are just dead code, which means more stuff to read in order to
figure out.
2016-03-29 14:06:52 +02:00
Hans-Christoph Steiner
9d1743af33 purge disabled Android DownloadManager code
Unfortunately, this approach did not really work out.  It would have been
really nice to rely on the provided DownloadManager stuff, but it has too
many issues, like not working with Tor or other proxies, and being
difficult to tightly integrate.
2016-03-29 14:06:52 +02:00
Hans-Christoph Steiner
acc2a3154f Merge branch 'android-studio-testing-fixes' into 'master'
start porting tests to latest Android Studio/gradle setup

To encourage more people to use and add to the test suite, I've been working on making it work nicely with Android Studio and gradle.  I've also setup the possibility for JUnit tests that run on the host machine, not the emulator.  Those are run with `gradle test`.  I added a JUnit test of `HttpDownloader` too.

See merge request !233
2016-03-29 11:45:33 +00:00
Hans-Christoph Steiner
4538cf1ed0 suppress PMD JUnit4 warnings until tests are ported to JUnit4
#607 https://gitlab.com/fdroid/fdroidclient/issues/607
2016-03-29 12:30:30 +02:00
Hans-Christoph Steiner
9656de0147 remove checkstyle ExplicitInitialization check
"Variable explicitly initialized to 'false' (default value for its type)"

I never remember what the default init value of booleans are, so this error
is quite annoying to me, and I can't see the harm of this behavior.
checkstyle says: "So in this case, x gets initialized to 0 twice, and bar
gets initialized to null twice. So there is a minor inefficiency."
2016-03-29 10:57:55 +02:00
Hans-Christoph Steiner
538830d5a3 ignore checkstyle AvoidStaticImport for test frameworks
For whatever reason, both JUnit and Google recommend using static method
imports when writing tests.
2016-03-29 10:57:55 +02:00
Hans-Christoph Steiner
3fcdfe85bb move main project files into standard gradle/Android Studio layout
This makes it a lot easier to setup all the testing stuff.  Mostly,
I'm tired of fighting Android Studio's fragility, so I want to remove
as much non-standardness as possible in the hopes of improving that
situation.

closes #534 https://gitlab.com/fdroid/fdroidclient/issues/534
2016-03-28 12:12:37 +02:00
Hans-Christoph Steiner
f9063b5058 remove Preferences check out of HttpDownloader
This is the last Android code in the whole suite of Downloader subclasses,
so now we can write JUnit tests for them all, and avoid the fragility of
tests running on the emulator.
2016-03-28 12:05:35 +02:00
Hans-Christoph Steiner
f2621dcb55 avoid android.* classes to allow for direct JUnit tests
When running tests on the host machine, android.jar contains no code at all
which is totally stupid.  We can keep android.util.Log in there because it
does not affect the logic at all.  Then just set that android.jar to return
generic values using:

 unitTests.returnDefaultValues = true
2016-03-28 12:05:35 +02:00
Hans-Christoph Steiner
a1d6917ec7 remove Context/LocalBroadcastManager from Downloader for testing
If there is no LocalBroadcastManager, then the Downloader tests can be done
with pretty plain JUnit and then do not require the Android emulator to run
2016-03-28 12:05:35 +02:00
Daniel Martí
35764b90c0 Bump to 0.100-alpha2 v0.100-alpha2 2016-03-27 19:20:55 +01:00
Hans-Christoph Steiner
ba9f32e9f4 Merge branch 'fix-409--nfc-swap-crash' into 'master'
Fix crash when returning to swap after cancelling

Fixes #409. The problem was that there was some listeners being added for broadcast events when the swap view was shown. These were never removed, and so cancelling swap, then returning to it would spin up a _new_ activity with new views, while the old listeners were still around. When the old listeners received events, they would try to talk to their associated `Activity`. This no longer existed, so a crash ensued.

While I was fixing the specific bug associated with #409, I took the opportunity to make more of the event listeners well behaved in the swap process. I don't think any of them were liable to cause crashes, but were likely to cause some weirdness at some point in time if they were not fixed.

*Note:* This swap view was an exercise in moving away from `Fragment`s towards an `Activity` with individual `View`s. I'm going to call this a bit of a failure at this point, because there is so much work that needs to be invested in implementing lifecycle stuff in our custom views. `Fragment`s naturally come with lifecycle methods that are familiar to other Android dev's looking to contribute to this project (even if they are a little difficult to understand at times). Implementing our own custom Views instead still results in similar classes of bugs (i.e. talking to an `Activity` when the view no longer is part of that activity).

A classic example of this is in my usage of the `onDetachedFromWindow` function in the `View`. I have no idea if this is the best place to unregister listeners or not. In a Fragment, it would be a matter of `onPause` or one of the more well defined lifecycle methods. Empirically, `onDetachedFromWindow` seems to be well behaved. The other alternative would be for the Activity to explicitly invoke a `onRemoved` type method each view when it knows it is transitioning from one state to the next. However at this point, we are then really into reimplementing `Fragment` land.

See merge request !232
2016-03-25 10:22:47 +00:00
Daniel Martí
5195281848 CHANGELOG: Add 0.99.1 changelog entry 2016-03-22 12:50:49 +00:00
Daniel Martí
4c83b2c0c6 Add Hindi to the languages list 2016-03-21 15:46:22 +00:00
F-Droid Translatebot
f30cea33e3 Pull translation updates from Weblate
Translators:

ageru                     French
Ajeje Brazorf             Sardinian
Mohamad Hasan Al Banna    Indonesian
Paresh Chouhan            Hindi
YFdyh000                  Simplified Chinese
YF                        Simplified Chinese
2016-03-21 15:36:35 +00:00
Daniel Martí
a61fb677bc Merge branch 'fix-603--translate-categories-crash' into 'master'
Pass through a known good `Context` to `translateCategories`

All the good work to make sure that `getActivity()` actually returned
a proper context, obtaining a final reference to that known good activity
object, and then using that in the background thread is thrown away.
The reason was because the `translateCategories` method would go and
call `getActivity()` all over again. This changes the `translateCategories`
helper function so that it asks for a `Context`. This way, a known
good `Context` can be passed in, rather than having to perform a check
to see if `getActivity()` is good again.

Fixes #603 (Hopefully)

See merge request !231
2016-03-21 15:08:46 +00:00
Peter Serwylo
a7d757cdb2 Remove unused code and fix some typos.
The old swap code used to delegate to the `AppDetails` activity when
touching an app in the swap view. Now it shows the install button
and download feedback inline. The code which used to exist is no
longer required.
2016-03-21 22:36:15 +11:00
Peter Serwylo
d46efb1d84 Correctly start and stop listening for repo update events during swap.
This fixes the following bugs:
 * `BroadcastReceiver` was never being created due to incorrect guard
   condition `if (pollForUpdatesReceiver != null)` (should have been
   `== null`).
 * Called `unregisterReceiver` rather than `registerReceiver`.
 * Even if it did work, it didn't make an effort to unregister the receiver.

In addition, the creation and listening with the `BroadcastReceiver is
now done in a way similar to the other swap views:
 * Create it as a `final` member variable.
 * `registerReceiver` when view is inflated.
 * `unregisterReceiver` when view is detached.
2016-03-21 22:33:18 +11:00
Peter Serwylo
cfe2f71e4d Correctly unregister receiver in "qr code" swap view.
Previously the receiver was added but never removed. The result
is that once a swap session is cancelled, the receiver still
gets broadcasts.
2016-03-21 22:23:54 +11:00
Peter Serwylo
c29aff2167 Correctly unregister receiver in "connecting" swap view (Fixes #409)
Previously the receiver was added but never removed. The result
is that once a swap session is cancelled, the receiver still
gets broadcasts.

This is what was causing the bug in #409. It was trying to access
the `Activity` once it had been closed, and another swap session started
with a new activity.
2016-03-21 22:22:57 +11:00
Peter Serwylo
b19861226a Correctly unregister receiver in "join wifi" swap view.
Previously the receiver was added but never removed. The result
is that once a swap session is cancelled, the receiver still
gets broadcasts.
2016-03-21 22:21:09 +11:00
Peter Serwylo
8e28172942 Pass through a known good Context to translateCategories
All the good work to make sure that `getActivity()` actually returned
a proper context, obtaining a final reference to that known good activity
object, and then using that in the background thread is thrown away.
The reason was because the `translateCategories` method would go and
call `getActivity()` all over again. This changes the `translateCategories`
helper function so that it asks for a `Context`. This way, a known
good `Context` can be passed in, rather than having to perform a check
to see if `getActivity()` is good again.
2016-03-21 20:42:13 +11:00
Daniel Martí
1af6dbc19e Merge branch 'support-library-23.2.1' into 'master'
Update Support Library components to 23.2.1

As far as I can see from the release notes, 23.2.1 does not fix any bugs that could affect F-Droid. Anyway, it's better to be up-to-date.

See merge request !228
2016-03-17 15:13:59 +00:00
relan
82ed44fac0 Update Support Library components to 23.2.1 2016-03-17 17:43:50 +03:00
Daniel Martí
1d44a5f2e6 Merge branch 'ci-image' into 'master'
CI: Bump docker image

Also use a specific tag instead of latest, so that pushing latest on
Docker Hub won't break older branches and tags.

See merge request !229
2016-03-17 12:05:17 +00:00
Daniel Martí
3b76db0227 tools: check-string-format is python3
This has always been python3, so it was probably a typo. Fixes CI since
we may no longer have python2 installed.
2016-03-16 16:15:07 +00:00
Daniel Martí
fded4c9f2e CI: Bump docker image
Also use a specific tag instead of latest, so that pushing latest on
Docker Hub won't break older branches and tags.
2016-03-16 16:15:07 +00:00
F-Droid Translatebot
87d73e2d01 Pull translation updates from Weblate
Translators:

Ajeje Brazorf          Sardinian
Danial Behzadi         Persian
nikos                  Greek
Olexandr Nesterenko    Ukrainian
Sérgio Marques         Portuguese (Portugal)
Svetoslav Yordanov     Bulgarian
2016-03-15 21:08:54 +00:00
Daniel Martí
5ed4977b9d Merge branch 'master' into 'master'
gitlab-ci: enable lint, log posting, and caching

Some work to improve the CI functions, and first stab at getting parts running in parallel.

See merge request !211
2016-03-15 20:33:10 +00:00
Hans-Christoph Steiner
d4992831c0 gitlab-ci: enable lint and run tools scripts in parallel
* splitting out the tools script allows less things to happen on the
  main job, and runs the tools script in parallel, which should speed
  things up.

* `gradle check` also runs lint, and anything else we might add to
  that meta-target.

* `gradle build` also runs tests, `gradle assemble` does not
2016-03-15 20:54:29 +01:00
Hans-Christoph Steiner
e18e7a7067 gitlab-ci: cache downloaded things between builds
This stores the Android SDK tarball and gradle caches between builds
to speed things up.  Since the unpacked SDK gets unpacked very time,
updating the version is just a matter of changing the variable.  Since
only the gradle caches are stored, i.e. the jars and gradle binaries,
updates there will only add more files to the cache.
2016-03-15 14:29:28 +01:00
Daniel Martí
8bba6670a0 Merge branch 'fix-repository' into 'master'
UI: disabled repo name if apk is incompatible



See merge request !226
2016-03-13 15:51:31 +00:00
Paresh Chouhan
c34ceeffe4 UI : Repository : *Repo Name* is disabled if apk is incompatible. 2016-03-13 20:10:32 +05:30
Daniel Martí
4c9012557e Merge branch 'inconsistent-code-style' into 'master'
Code Style : Changed variable names to be consistent with other variable names

variable names are inconsistent in other files as well. At some places it is `mVariableName` and in some places it is `variableName`.  

suggestion : rename all public variables to `publicVaraible` and all private variables to `mPrivateVariable` ?  

we can use http://udacity.github.io/android-nanodegree-guidelines/index.html

See merge request !225
2016-03-11 16:39:54 +00:00
Daniel Martí
d5f0a6397f Remove empty translation that slipped through v0.100-alpha1 2016-03-10 17:17:40 +00:00
Daniel Martí
0655abe3b9 Bump to 0.100-alpha1
Also update CONTRIBUTING, since we're now going to use three digits in
the version codes for the second part in each version.
2016-03-10 16:53:01 +00:00
F-Droid Translatebot
8f24759a33 Pull translation updates from Weblate
Translators:

Adrià García-Alzórriz      Catalan
Adrià García-Alzórriz      Spanish
Benedikt Volkmer           German
Irvan Kurniawan            Indonesian
Licaon Kter                Romanian
Marcelo Santana            Portuguese (Brazil)
Massimiliano Caniparoli    Italian
Mladen Pejaković           Serbian
Mohamad Hasan Al Banna     Indonesian
naofum                     Japanese
Pander                     Dutch
Phạm Nguyễn Hoàng          Vietnamese
riotism                    Chinese (Hong Kong)
Tobias Bannert             German
Verdulo                    Esperanto
Verdulo                    Polish
2016-03-10 16:48:08 +00:00
Paresh Chouhan
c5aa3f91b1 CodeStyle : Fixed inconsistent variable name, changed mctx to mCtx 2016-03-08 12:47:35 +05:30