1023 Commits

Author SHA1 Message Date
Peter Serwylo
06088e2b35 Send acra report about crash we are getting, but don't crash F-Droid 2017-04-26 19:39:26 +10:00
Peter Serwylo
7375e09d19 Fail softly, notifying user of failure rather than crashing, 2017-04-26 08:38:41 +10:00
Peter Serwylo
e6c6c28f5f Formatting + PMD fix in response to CR
PMD does not like manually throwing NPEs, even if they have more verbose
information than the default NPE. As such, use an
`IllegalArgumentException` instead.
2017-04-26 08:38:03 +10:00
Peter Serwylo
4b70d81e5c Make install/uninstall/run/upgrade buttons not overlap last updated text
Instead of showing them below the icon, it now puts the icon + name +
author + last updated into a single layout which can grow if the app
name or author wraps to a second line. The buttons are now below this
additional layout.
2017-04-26 08:28:25 +10:00
Peter Serwylo
2a6dcb63bb Check for null in App#iconUrl.
Although I'm unsure of exactly why this is `null`, it seems sensible
that there is a possibility of null icons (e.g. for .zip files or other
media). As such, this just adds a guard condition to ensure that the
`iconUrl` is not null.

Fixes #981.
2017-04-26 08:28:25 +10:00
Peter Serwylo
6a0b16fc7d Increase verbosity around crash site for better ACRA reports.
Received the following crash report, where the user said it crashed
while trying to install the priviledged extension:

```
java.lang.NullPointerException: Attempt to read from field 'android.content.pm.Signature[] android.content.pm.PackageInfo.signatures' on a null object reference
at org.fdroid.fdroid.installer.ApkSignatureVerifier.getApkSignature(ApkSignatureVerifier.java:70)
at org.fdroid.fdroid.installer.ApkSignatureVerifier.hasFDroidSignature(ApkSignatureVerifier.java:54)
at org.fdroid.fdroid.installer.ExtensionInstaller.installPackageInternal(ExtensionInstaller.java:53)
at org.fdroid.fdroid.installer.Installer.installPackage(Installer.java:265)
at org.fdroid.fdroid.installer.InstallerService.onHandleIntent(InstallerService.java:77)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:194)
at android.os.HandlerThread.run(HandlerThread.java:61)
```

Not sure how to address it yet, so adding more specific excetpion for
if it happens in the future.
2017-04-26 08:28:24 +10:00
Peter Serwylo
1eb224fc5e Don't show run button for apps which cannot be launched.
The feedback from ACRA was:

> tried to run an app that doesn't have a launcher (termux api)
2017-04-26 08:28:24 +10:00
Peter Serwylo
4cc6e5bc89 Sort categories alphabetically by name.
This pulls all the categories out of the database at once for sorting,
rather than sorting in SQLite. This is to prevent having to store the
localized category names in the database (and hence having to update
them when the locale is changed).

Fixes #967.
2017-04-26 08:28:24 +10:00
Peter Serwylo
e2c82d2943 Accessibility tweaks in app details.
* Correctly read out "Cancel download"
 * Allow users to hear download progress correctly.
2017-04-26 08:28:24 +10:00
Peter Serwylo
bae5bdb1f4 Force apps in "Installed" list to sort by name.
Previously they were left to be sorted however SQLite parsed the query.
This turned out to result in them beign sorted by repos first, then
names. For example, all of the GP apps would be at the bottom of the
list.

Fixes #965.
2017-04-26 08:28:24 +10:00
Stephen Michel
2272e441c6 lighten app card background in category view for #907 2017-04-25 15:05:19 -04:00
Maestus
07bc33d391 Pressing back button in toolbar (in AppDetails) brings back where it sould 2017-04-23 23:16:19 +02:00
Peter Serwylo
c4fd369feb Merge branch 'dark-mode-fixes' into 'master'
More dark more fixes

See merge request !487
2017-04-20 22:44:31 +00:00
Chirayu Desai
9f50bef04f More dark more fixes
Fixes some leftover items missed in the previous major update.
* Donate view in AppDetails
* What's new view in AppDetails
* The search view
2017-04-21 01:39:39 +05:30
Peter Serwylo
b0803432d8 Ensure PendingIntents use explicit Intents.
The only pending intents that were not explicit were the four from
the NotificationHelper class. These now explicitly specify the
NotificationBroadcastReceiver as their destination, which is not
exported. That then forwards the intents onto relevant methods of
AppUpdateStatusManager.
2017-04-20 17:03:37 +10:00
Hans-Christoph Steiner
471083b8f4 Bump to 0.103-alpha3 2017-04-19 00:19:10 +02:00
Hans-Christoph Steiner
f224483e1b when checking language support, reset locale back to original
With this, it was leaving the app's locale set to the last language on
the LOCALES_TO_TEST list, which is 'zu' (Zulu).  For some dialogs, it
was actually using that locale, so showing OK/Cancel in Zulu despite
the app being in a different language.

#943
2017-04-19 00:19:10 +02:00
Hans-Christoph Steiner
67f40367cd use Languages class as source of locales to test 2017-04-18 21:37:59 +02:00
Hans-Christoph Steiner
3a194026fa test all formats in all languages
We've had a number of crashes due to bad formats in various
translated strings.  This test runs through all of the translated
strings and tests them with the same format values that the
source strings expect.  This is to ensure that the formats in the
translations are correct in number and in type (e.g. {@code s} or
{@code s}.  It reads the source formats and then builds {@code
formats} to represent the position and type of the formats.  Then
it runs through all of the translations with formats of the
correct number and type.

I couldn't get the Resources stuff working in Robolectric, so I
made this an emulator test.

The change to the Swedish translation included in this commit are
fixes for issues that these tests found.

closes #923
2017-04-18 21:26:58 +02:00
Hans-Christoph Steiner
670e6be39a fix fallthrough setting of localized metadata entries
Java's Map.get() returns null if there is no match, so this was always
setting each entry to whatever value was in the highest priority
locale, whether it had contents or what null.  Now, this will fall
through the priority list of locales until it finds actually contents.
2017-04-18 21:26:58 +02:00
Hans-Christoph Steiner
4bb7050725 add Video to Links section of App Details 2017-04-18 21:26:58 +02:00
Hans-Christoph Steiner
6fae74b36d actually use phone's locale when picking descriptive metadata
A TreeSet apparently does not really maintain insertion order, while a
LinkedHashSet does.  This ensures that the insertion order of locales
is preserved in localesToUse so that the prioritization is correct.
2017-04-18 21:26:58 +02:00
Hans-Christoph Steiner
06dff8184b no need to catch an exception, only to throw it
Just let the SecurityException be throwing where it originated.

From PMD: "A catch statement that catches an exception only to wrap it
in a new instance of the same type of exception and throw it should be
avoided".

This cleans up a little from !482.  Ctrl-Alt-L and Ctrl-Alt-O before
committing! :-)
2017-04-18 21:07:16 +02:00
Chirayu Desai
432f45254b PrivilegedInstaller: fallback to default installer for uninstall
* On API >= 24, in cases when the installer package name is not set
  to privext, the system won't let us uninstall.
* Fallback to the DefaultInstaller so that uninstall still works.
2017-04-18 23:59:19 +05:30
Chirayu Desai
db4aa3b519 Installer: Use content URI on API >= 24 for DefaultInstaller fallback
* When there's a permission mismatch (#951, #890), the fallback
  DefaultInstaller is invoked, which enforces file and content schemes
  for API < 24 and >= 24 respectively.
* Use content URI in that case, which allows the fallback to work.
2017-04-18 23:50:05 +05:30
Hans-Christoph Steiner
15d11f6d44 reformat all strings.xml using Android Studio 2.2.3 defaults
This should make dealing with merge conflicts a lot easier, since there
should be less conflicts on things like tabs vs spaces for indenting.
2017-04-18 19:29:50 +02:00
Hans-Christoph Steiner
dfff412dfe remove odd quoting from button_view_all_apps_in_category 2017-04-18 19:29:50 +02:00
Hans-Christoph Steiner
de15f7d5bb remove <plurals> with dev help string in it 2017-04-18 19:29:50 +02:00
Hans-Christoph Steiner
164dc2740c purge translations to deleted 'my_apps_header_number_of_updateable' 2017-04-18 19:29:50 +02:00
Peter Serwylo
b7ef0bd4e1 Also check for misformated plurals, not just regular strings.
The script checks for `<string/>` elements which have misformated
arguments in them. It Now also checks for `<plural><item /></plural>`
elements too.

closes !472
2017-04-18 19:29:50 +02:00
Hans-Christoph Steiner
cfabd2a2c3 properly handle <plurals>
<plurals> handles the grammar needed for numbers/quantities in various
languages.  Like in a number of slavic languages, numbers ending in 0,
1 or others have separate grammar.  In English, there is just 1 and
then all the rest (0 days, 2 days, 3 days, etc). <plurals> does not
handle multiple strings for different quantities, like having a
different string for each number case.  For that, we have to do it in
Java and have multiple <strings>

!472
2017-04-18 19:29:50 +02:00
Hans-Christoph Steiner
77e3d6a6f1 Merge branch 'even-even-more-ui-fixes' into 'master'
More misc UI fixes for 0.103

Closes #949, #937, and #927

See merge request !477
2017-04-18 17:28:35 +00:00
Hans-Christoph Steiner
4920b5f75f Weblate fix sync for 0.103 2017-04-18 15:16:35 +00:00
Hans-Christoph Steiner
0119138f38 Weblate pull for 0.103-alpha3 2017-04-17 22:59:48 +00:00
Peter Serwylo
131eece46c Fix issue with some cards not displaying in "Latest" view.
But in constraint layout which was fixed in 1.0.2.

Fixes #949.
2017-04-17 17:32:14 +10:00
Peter Serwylo
2fbfcb66b0 Make categories read out correctly by screenreader. 2017-04-17 17:31:32 +10:00
Peter Serwylo
93e39d895c Fix for API 15- having really busted navigation 2017-04-17 17:31:32 +10:00
Peter Serwylo
17ad6167a3 Fix broken padding in AppDetails2 on older devices.
Right + Left in addition to End + Start for support on older devices.
2017-04-17 17:31:32 +10:00
Peter Serwylo
6c12707720 Update AppDetails buttons after upgrading app to latest version.
Prior to this, it would only update the "Uninstall"/"Run"/"Upgrade"
buttons after a fresh install, or an uninstall.

This change is a bit more liberal in how often we try to update the
view, due to a race condition with PackageManager and AppDetails2.
AppDetails2 listens for InstalledAppProviderService in onResume, but
sometimes that is too late (the notification has already fired).
2017-04-17 17:31:32 +10:00
Peter Serwylo
a9b2ac9388 Don't clip the shadows underneath app details buttons.
Minor UI quirk, it was cutting off the drop shadow for these buttons.
2017-04-17 17:31:32 +10:00
Peter Serwylo
3c1b66dcd1 Let buttons go all the way to the left, not just to the icon.
On languages with longer translations, there is not enough space to fit
the relevant translations on a single line of the button.

Fixes #937.
2017-04-17 17:31:32 +10:00
Hans-Christoph Steiner
97fd3f0bad support "What's New" and "Video" fields from index-v1
fdroidserver currently only supports a single WhatsNew field that
comes from the CurrentVersionCode of the app.  Google Play and
fastlane supply support a WhatsNew field per-release, but we don't use
that data anywhere, and implementing that in the data structures would
add a lot of complexity since Apk would then need to have its own
"localized" section like App does.

The "Video" field is just a URL pointing to a video.

closes #910
2017-04-14 01:31:33 +02:00
Hans-Christoph Steiner
656b3185b2 added Esperanto and Shqip back to the language chooser
I added Esperanto because someone asked, and Shqip since it is not
available in Android 5.1 and people who speak Shqip would be likely to
open the language menu to switch away from English, then they'd see
Shqip as an option.  This still won't take effect until those
languages are fully translated.

closes #941
2017-04-14 01:09:33 +02:00
Hans-Christoph Steiner
8cb277e90d AppDetails2: add missing paddingEnd to match paddingRight 2017-04-14 01:09:33 +02:00
Hans-Christoph Steiner
3121a106e0 fix "DefaultLocale: Implied default locale in case conversion"
The point here is to use the English work all lowercase, so make sure
that the English lowercasing rules are always active, regardless of
the system's locale.
2017-04-14 01:09:33 +02:00
Hans-Christoph Steiner
e6844a5f4f do not override original description with nulls
The original single language description gets stuck straight into
App.description by Jackson.  getLocalizedEntry() might return a null,
in which case it was overriding the original description.  This only
overrides the original description if there is actually a localized
description.
2017-04-14 01:09:33 +02:00
Chirayu Desai
c2685bf14e Fixes for dark mode, needed after the UX Overhaul
* Replace hardcoded color values with references to style.xml,
  which in turn has different values for light and dark theme.
* Force reload the activity to get the theme applied.

TODO:
* Swap uses it's own theme, need to figure out a way to
  handle that. Currently the main Nearby screen which you get
  to from the bottom navigation is ok, but anything after
  that is light / custom themed.
2017-04-13 19:34:18 +05:30
Hans-Christoph Steiner
46adf47fdf Merge branch 'even-more-ui-fixes' into 'master'
Even more ui fixes

Closes #931

See merge request !471
2017-04-11 21:07:02 +00:00
Hans-Christoph Steiner
ecaf2362f2 Revert "Merge branch 'replicant-fsdg-compliance' into 'master'"
This reverts merge request !452
2017-04-11 14:50:40 +00:00
Peter Serwylo
b9129e8a35 Provide feedback to user when installing previous version.
Given the only feedback available to the user that they initiated a
download once clicking the version from the list is up top, this scrolls
the recycler view to the top to show that feedback.

Also shows the selectable background when they touch the version list
items.
2017-04-11 15:37:42 +10:00