2137 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
d91fbe7b0e rework swap startup putting SwapService first
SwapService is the thing that needs to be always running, and the last
thing killed.  So it should start first, and stop last.  So now, the user
clicking the button starts SwapService, which starts SwapWorkflowActivity.
This also eliminatings the "Loading" screen in favor of just showing the
StartSwapView with various inline progress indicators.
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
035a89e5f6 move all current View tracking to SwapWorkflowActivity
This information is only ever used in SwapWorkflowActivity and nowhere else
so if it needs to be stored, it could be stored via saveInstanceState().
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
39f23f6876 add required length limits to swap strings for the translators 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
9dc9a23a41 fix all RtL lint errors in swap layouts 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
89f5127f6d turn inline Install button into Cancel button during download 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
bc14e62e46 receive Downloader error messages in swap 2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
f0158063fb show full error messages from UpdateService
The "cause" is the Exception that was caught and embedded into the
UpdateException, so it has more info on what happened.
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
ad3fd26756 immediately regenerate swap repo when user changes app selections
Instead of waiting for the user to make all the app selections, then click
next, this constantly regenerates the swap repo on each click of the app
list.  This means that the swap repo is more likely to be immediately ready
when the user clicks next.
2019-05-24 10:00:08 +02:00
Hans-Christoph Steiner
b5d94b7476 convert swap error "back" button to "Try again"
The Android back button provides a working back function, and the Swap
"close" button on the upper left already provides a reset function. So this
turns the "back" button to be a "try again" button which re-runs the
connection process.
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
5851ea73e0 move ConnectingView to pure XML view, and remove Receiver superclass
The Receiver superclass is not reusing difficult code, but it is hiding the
simple list of UI configuration that it does.

This also eliminates the "error" TextView and just reuses the existing
TextView for error messages.
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
5ddc287ab3 move NfcView to pure XML view 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
a9aafa080d move JoinWifiView to pure XML view 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
1e1ea03bc3 move ConfirmReceiveView to pure XML SwapView with logic in Presenter 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
d5f2e26ea7 use one method everywhere for the "swap back" requests 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
014fb0b99d move WifiQrView and SendFDroidView to pure XML views
This puts the logic in the "Presenter": SwapWorkflowActivity
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
69ce8dbe8c move all WiFi/QR logic to Presenter (SwapWorkflowActivity) 2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
ea3b47f705 purge CacheSwapAppsService in favor of InstalledAppProvider
The most expensive part of this whole process is calculating the hash of the
whole APK.  InstalledAppProvider already caches that, and the rest is OK to
query.  If any particular part of the query is expensive, it could also be
moved to InstalledAppProviderService.
2019-05-24 10:00:07 +02:00
Hans-Christoph Steiner
85410504da LocalRepoService for setting up the local swap repo
This moves all logic for setting up the local fdroid repo to its own
IntentService.  That makes it much easier to interact with since things can
just use the static helper method to request it to update, and it'll do the
right thing.
2019-05-24 10:00:01 +02:00
Hans-Christoph Steiner
9fc1ecd5a4
doh! only change translations in Weblate, or suffer merge conflicts! 2019-05-21 14:50:47 +02:00
Hans-Christoph Steiner
c5a6445239 fix bottom bar loading the wrong "Updates" string
closes #1785
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
1cc14b3499 show progress spinner on Updates Tab if index is being updated
The "Congrats, your apps are up to date" message isn't quite right in this
context.

closes #1769
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
dffc8e5925 make sure ImageLoader is inited before trying to use it
closes #1782
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
86908ceeaa the calculated ETag should be compared to the stored ETag
Thanks to @amiraliakbari for tracking this down!

closes fdroid/fdroidclient#1737
2019-05-20 14:14:29 +02:00
Hans-Christoph Steiner
8d60f40e98 Merge branch 'snackbars' into 'master'
Show snackbars with undo buttons. Fix #1756.

Closes #1756

See merge request fdroid/fdroidclient!823
2019-05-20 12:09:30 +00:00
Hocuri
dbfe267540
Show snackbars with undo buttons. 2019-05-13 17:55:09 +02:00
Hans-Christoph Steiner
291e4c4c3c change 'fragment' name to avoid confusion, Swap doesn't use Fragments 2019-05-13 15:01:37 +02:00
Hans-Christoph Steiner
9d6c95d51d move menu handling to SwapView and SwapWorkflowActivity
The menus originate in the Activity, so avoid pushing it to the Views.
2019-05-13 15:01:37 +02:00
Hans-Christoph Steiner
fe59522666 SwapView base class so all swap views can just be XML
Almost all of the nearby/swap view classes could be condensed into a single
base class that is instantiated in the view XML.  This is the first step
towards making that happen.

It also lays the groundwork where "steps" are all SwapViews.  The
original concept of "steps" put all steps together, whether
F-Droid could control them or not.  For example, the Views were
mixed with the system Bluetooth prompts.  This is the first step
towards converting the steps to always be SwapViews, which are
always under control of this app.

When coming back to a SwapView/step, it does not seem feasible to handle
automatically restarting things like permissions and Bluetooth prompts. If
there is a way, it should be possible to first load the proper SwapView
instance, then trigger the system prompt.  The makes the SwapView a pure
View, without any Controller in it.
2019-05-13 15:01:32 +02:00
Hans-Christoph Steiner
6a8f5fb4a7 rename SwapAppsView things to "Swap Success" 2019-05-13 14:55:13 +02:00
Hans-Christoph Steiner
568abe9f3b rename swap_blank to swap_start_swap to match View name 2019-05-13 14:55:13 +02:00
Hans-Christoph Steiner
68cc241bc0 rename ConfirmReceive to ConfirmReceiveView to match standard 2019-05-13 14:55:13 +02:00
Hans-Christoph Steiner
9aa73b95e4 rename SwapConnecting to ConnectingView to match standard 2019-05-13 14:55:13 +02:00
Hans-Christoph Steiner
40c52821fa standardized code format for all swap layout XML 2019-05-13 14:55:13 +02:00
Hans-Christoph Steiner
1d359f82ce actually use index added/lastUpdated dates in UTC
The date/time written to index.xml and index-v1.json should always be in
UTC format.  These formats are often in the form of just a date, e.g.
2019-04-28.  Those are then converted to UNIX seconds, which includes the
time.  In the date only case, the time is assumed to be 00:00, which will
be different per time zone.

index-v1.json is better since it mostly uses Java-style UNIX time in millis
but the dates/times are parsed then stored in the local database in the old
format yyyy-MM-dd_HH:mm:ss which will result in different UNIX times when
the device is in different time zones.

fdroid/fdroidclient#1757
2019-05-10 16:30:23 +02:00
Hans-Christoph Steiner
c0c5721f6a Normalize Repo.lastUpdated values to contain the date and time
This also converts old Repo.lastUpdated values rather than just failing.
index.xml handling used to store the Repo "Last Updated" date used to store
the value as just an ISO date (2019-04-29), then the time was added.  So if
date/time parsing fails, this falls back to trying to parse just the date.
null is returned when parsing fails, and the Latest Tab shows nothing if
the Last Updated is null.

Some related tests were also tweaked.

Hopefully:
closes fdroid/fdroidclient#1757
2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
d62c0cf723 AppDetails: use inline OnClickListeners in Android style
no need to declare variables that are used in one place.  Also, reordered
related lines a bit for clarity.
2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
a71489a102 set max width on places where the translations get too long
closes #1678
2019-05-10 14:13:23 +02:00
ioTY
67af661640 Check whether fdroidPrivileged enabled 2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
af1040443e ignore Errors and Exceptions in background services
Throwable includes Errors and Exceptions.  Fixes stacktraces like these:

java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$3.done(AsyncTask.java:325)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
	at java.util.concurrent.FutureTask.run(FutureTask.java:242)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
	at org.apache.commons.io.FileUtils.isSymlink(FileUtils.java:3107)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1616)
	at org.fdroid.fdroid.DeleteCacheService.onHandleWork(DeleteCacheService.java:32)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
	at android.os.AsyncTask$2.call(AsyncTask.java:305)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	... 3 more
java.lang.NoSuchMethodError: No virtual method toPath()Ljava/nio/file/Path; in class Ljava/io/File; or its super classes (declaration of 'java.io.File' appears in /system/framework/core-oj.jar)
	at org.apache.commons.io.FileUtils.isSymlink(FileUtils.java:3107)
	at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1616)
	at org.fdroid.fdroid.DeleteCacheService.onHandleWork(DeleteCacheService.java:32)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
	at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
	at android.os.AsyncTask$2.call(AsyncTask.java:305)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)
2019-05-10 14:13:23 +02:00
Hans-Christoph Steiner
5cce64e153
version code 1007000 2019-05-10 14:13:15 +02:00
AmirAli Akbari
f76f9357d7 IndexV1Updater: Closing JarFile on end of use. Closes issue #1382. 2019-05-10 10:34:16 +00:00
Hans-Christoph Steiner
b8dba454e3 gitlab-ci: only run Espresso tests on emulators newer than 25 2019-04-23 16:34:57 +02:00
Hans-Christoph Steiner
d7453d878d fix lint: Repeated word "do" in message: possible typo 2019-04-17 15:51:21 +02:00
Hans-Christoph Steiner
3915abccc0 version code 1006050 2019-04-10 00:59:51 +02:00
Rafael Fontenelle
28b5744fe9 Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rafael Fontenelle <rafaelff@gnome.org>
Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (20 of 20 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rui Mendes <xz9@protonmail.com>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-rBR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (428 of 428 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/pt_BR/

Translated using Weblate: Portuguese (Brazil) (pt-BR) by Rafael Fontenelle <rafaelff@gnome.org>

Currently translated at 100.0% (20 of 20 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/pt_BR/
2019-04-10 00:58:54 +02:00
Hosted Weblate
95787b637e Translated using Weblate: Chinese (Traditional) (zh-rTW) by Jeff Huang <s8321414@gmail.com>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/zh_Hant/
2019-04-10 00:41:42 +02:00
Hosted Weblate
fe7d836f28 Translated using Weblate: French (fr) by Arnaud Jacquemin <arnaud.jacquemin+weblate@free.fr>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/fr/
2019-04-10 00:40:54 +02:00
Hosted Weblate
5c64e722b8 Translated using Weblate: Galician (gl) by Iván Seoane <ivanrsm1997@gmail.com>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/gl/

Translated using Weblate: Galician (gl) by Iván Seoane <ivanrsm1997@gmail.com>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/gl/

Translated using Weblate: Galician (gl) by Iván Seoane <ivanrsm1997@gmail.com>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/gl/
2019-04-10 00:40:54 +02:00
Hosted Weblate
aa1ea98244 Translated using Weblate: Sardinian (sc) by Ajeje Brazorf <lmelonimamo@yahoo.it>
Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/sc/
2019-04-10 00:40:54 +02:00
Hosted Weblate
2147f952cd Translated using Weblate: Basque (eu) by Osoitz <oelkoro@gmail.com>
Currently translated at 100.0% (21 of 21 strings)

Translation: F-Droid/F-Droid metadata
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid-metadata/eu/

Translated using Weblate: Basque (eu) by Osoitz <oelkoro@gmail.com>

Currently translated at 100.0% (429 of 429 strings)

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/eu/

Update translation files:  ()

Updated by "Squash Git commits" hook in Weblate.

Translation: F-Droid/F-Droid
Translate-URL: https://hosted.weblate.org/projects/f-droid/f-droid/
2019-04-10 00:40:54 +02:00