1124 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
6d0bde716e fully replace language pref handling with Languages class
closes #908
2017-04-07 14:50:53 +02:00
Hans-Christoph Steiner
019964387a get language names from system, instead of hard coded list
closes #858
2017-04-07 14:50:53 +02:00
Peter Serwylo
9521b9a72c Add guard contidion to prevent notifying when inappropriate.
Although the adapter tries to keep in sync with the app status update
manager, there may be times when this is not successful. In such
circumstances, it seems safe to just guard against invalid situations,
rather than trying to assert an error or fall over.

Fixes #922.
2017-04-07 22:40:29 +10:00
Peter Serwylo
42965701a3 Show "Run" button next to a successfully installed app.
There was some confusion in the user tests about how to launch an app
once it was installed. Hopefully this small change goes towards fixing
some of that confusion. Instead of just showing "X installed
successfully" in the app list, it now shows a "Run" button next to it.
2017-04-07 22:40:29 +10:00
Peter Serwylo
34c741f835 Clear up confusion around "Tick" icon when updating app.
When navigating to Updates -> Show Apps and then downloading an item, it
shows the download progress inline for that item. After this is
complete, it then shows a tick icon next to the item. The long term goal
should be to remove the list item from under "Show Apps" so that it is
only shown at the top of the "Updates" view. However this will require
more work. In the meantime, we can alleviate some confusion by replacing
the "Tick" icon with a button that says "Update" (like the other buttons
in the Update view).
2017-04-07 22:40:29 +10:00
Peter Serwylo
1f035a9696 Don't re-use existing pending intents.
When dismissing an "X installed successfully" intent, it should also
dismiss the relevant item from the "Updates" screen. This was not
happening. Upon investigation, I noticed that when I dismissed a
notification, it was passing through the Apk which I installed over a
day ago. This is because it was reusing a previous pending intent rather
than creating a new one.
2017-04-07 22:40:29 +10:00
Peter Serwylo
05d6929eb6 Remove unused preference "Update History".
Now that we've moved the first screen to "Latest", we always want to do
our best to show something there. This preference is pretty redundant in
light of this.
2017-04-07 22:08:29 +10:00
Peter Serwylo
d41b0d330f Only show "New" next to apps added in the last two weeks.
Previously, the definition of "New" was whether or not the added and
last updated dates were the same. This made sense, because we only
showed apps from the past few weeks (depending on preferences) as new.

Now that we show up to 200 apps in the first screen, regardless of age,
this check is no longer helpful.
2017-04-07 22:02:16 +10:00
Peter Serwylo
c5051e8813 Extract "days since date" to Utils 2017-04-07 22:02:16 +10:00
Peter Serwylo
3b9f841117 Try to always show something in "Latest"
It seems pointless to only restrict "Latest" to items within the last X
days. When you only have the GP repo enabled, or other repos with less
apps that are updated less frequently than the main repo, this screen
always ends up empty. This change shows the last 200 updated items
instead of those updated in the last X days.
2017-04-07 22:02:16 +10:00
Peter Serwylo
ab5ea39f7c Show empty state feedback for latest + categories
The text is more comprehensive on the main screen than on categories,
because this is the view that all users will see when they first open
F-Droid.

Fixes #879.
2017-04-07 22:02:14 +10:00
Peter Serwylo
510ec5f7c7 Adding ability to query last repo update and number of repos.
This will be used to improve the empty state handling of the main list
of latest apps.
2017-04-07 21:58:30 +10:00
Peter Serwylo
d83c15d0d4 Show "Updating repositories" banner in main UI.
Previously this was only shown in the notifications.
This does not show the full progress of the update, but at least it
provides a rudimentary level of feedback. In the future it can be
modified to show more substantial feedback if required.
2017-04-07 21:56:42 +10:00
Hans-Christoph Steiner
1054d57b02 Merge branch 'new-ui--more-fixes' into 'master'
More misc UI fixes, mainly for older devices.

Closes #906 and #866

See merge request !465
2017-04-07 07:47:42 +00:00
Hans-Christoph Steiner
a710eeef3a Merge branch 'fix-913--vector-issues' into 'master'
Force the build tools to generate .pngs for each vector.

Closes #913

See merge request !466
2017-04-07 07:41:37 +00:00
Peter Serwylo
432eee0f83 Force the build tools to generate .pngs for each vector.
This results in a slightly larger apk (e.g. 500KiB), but it reduces the
scope for bugs greatly. We still get all the benefits of only having to
maintain a single density-independent vector (rather than several
density dependent PNGs and all the work that involves).

The class of bugs that it solves is that there are several places where
vectors cannot be used, and you wont notice when developing on a device
newer than 5.0. For example, notification icons, `TextView`
and its `android:drawableStart` attribute.

Fixes #913.
2017-04-07 15:56:16 +10:00
Peter Serwylo
655c4bfdd3 Reinstate the About dialog.
Currently available as the first entry in Preferences. Used to be
available in the main action bar menu.

Fixes #906.
2017-04-07 09:55:14 +10:00
Peter Serwylo
5ef5288e3a Prevent preferences fragment from crashing when resuming.
It was assuming there is always a priv ext preference. However, we
remove the priv ext preference the first time the fragment is opened. In
these circumstances, the preference no longer exists, resulting in a
NPE.
2017-04-07 09:55:14 +10:00
Peter Serwylo
05f6f08832 Add Profiler class for diagnosing performance problems.
Unused for now, but like with the `LoggingQuery`, it is helpful to
be used for debugging purposes. For example, used this to quickly
figure out that it took 7 seconds to fix the PRNG stuff in FDroidApp
onCreate().
2017-04-07 09:55:14 +10:00
Peter Serwylo
f83adbef44 Repeat grid pattern every 5 items
Previously it would show a grid patter for the first five items, and
then resort to list items. This continues the grid pattern indefinetly.

Fixes #866.
2017-04-07 09:55:13 +10:00
Peter Serwylo
fada693ac9 Remove AppDetails (in preference to AppDetails2).
Also removed associated layouts which are no longer required.
2017-04-07 08:34:41 +10:00
Peter Serwylo
3efb3a3043 Remove category provider stuff specific to old 3 tab layout.
We no longer prefix the list of categories with "Whats New", "Recently
Updated", and "All". The new UI doesn't require this. The only place
they were being used now were in the tests.
2017-04-07 08:34:40 +10:00
Peter Serwylo
c2d5f57fbd Remove now-unused queries from AppProvider. 2017-04-07 08:30:31 +10:00
Peter Serwylo
a8e6daadc3 Removed now-unused ArrayAdapterCompat class. 2017-04-07 08:30:31 +10:00
Peter Serwylo
d7fbd868b9 Remove app list adapters from old 3 tab layout. 2017-04-07 08:30:31 +10:00
Peter Serwylo
65afc83b16 Removed app list fragments from old 3 tab layout. 2017-04-07 08:30:31 +10:00
Peter Serwylo
6f80fbd945 Removed PreferencesActivity.
This is now a top level view inside MainActivity.
2017-04-07 08:30:31 +10:00
Peter Serwylo
4db31ef975 Removed FDroid.java, no longer used. 2017-04-07 08:30:31 +10:00
Peter Serwylo
7b9219e701 Removed TabManager
Only used in old FDroid activity which is about to be removed.
2017-04-07 08:30:30 +10:00
Peter Serwylo
4dc18f0a88 Removed AppListFragmentPageAdapter
Only used in old FDroid activity which is about to be removed.
2017-04-07 08:30:30 +10:00
Hans-Christoph Steiner
e28e29455e Merge branch 'new-ui--feedback-from-alpha' into 'master'
Implement a handful of UX tweaks in response to alpha feedback

Closes #879

See merge request !464
2017-04-06 10:39:49 +00:00
Peter Serwylo
8faf151c90 Remove 1 second pause between installing and updating UI.
This was implemented before because the main screen of the three tab
layout needed to update in response to the list of installed apps being
installed. When we scan the list of installed apps upon starting
F-Droid, we didn't want to have to requery for the list of installed
apps every time we found a new installed app. For this reason, we
"debounced" these requests (accumulated them for 1 second, and then let
go of a notification only after 1 second of inactivity).

This is no longer a feature, and so we can afford to fire the
notification instantly.
2017-04-05 16:44:53 +10:00
Peter Serwylo
24a6e9590d Wait until installed app service is ready before updating app details.
We were jumping the gun before, and asking to refresh the app details
adapter before the installed app service was able to notify us of a
change to the apps installed version.

This should be refactored to use broadcast receivers instead of
content observers (which are tied to the implementation of a content
provider). However this is currently a straight port from app details 1
to app details 2.
2017-04-05 16:37:55 +10:00
Peter Serwylo
50044629ab Remove placeholder whatsNew text completely.
Now that we are releasing this, we need to remove the "Whats New"
placeholder text.
2017-04-05 15:50:18 +10:00
Peter Serwylo
b0afa3e2fe Using custom icon for notification rather than the launcher icon.
On newer devices, it takes the icon, removes colour, and uses that. This
looks weird because:

 * The head and body look too close together once you remove the shading
   from the launcher icon.

 * The eyes dissapear because they are white (not transparent) in the
   launcher icon.
2017-04-05 15:41:57 +10:00
Peter Serwylo
2ab5c6a1c6 Correctly update the list item in updates view after install.
Prior to this, it would still show the "Ready to update" list item.
Now it updatpes the description to say "successfully installed" and
removes the "Update" button.
2017-04-05 15:23:28 +10:00
Peter Serwylo
8a69816648 Only automatically redirect to package manager when viewing app.
If you open AppDetails, initiate a download + install, and then navigate
away, it still pops open the install dialog for you. This is because it
never deregisters the broadcast receiver.

This change maintains the behaviour of always having the broadcast
receiver. This is because it is only added when the download
completes, and would require further refactoring to change that.
Instead, we listen for the receiver, but we ask if the AppDetails view
for the apk in question is actually visible to the user. If not, we
don't try to initiate the package manager.
2017-04-05 15:09:44 +10:00
Peter Serwylo
be11a785e5 Make the "Updates" badge only show number of items needing action.
Previously it showed the number of things which were eligible for
update. This will become less and less important the more people we can
switch over to automatic updates. However, given the privext vs unknown
sources thing, we will always have a lot of users who need to be
notified that they need to take further action to complete an install.
2017-04-05 15:01:55 +10:00
Peter Serwylo
0b7dc64fb6 Show apps in name order.
Prior to this, they were in whatever order they came from the metadata.
This resulted in weidrness because the repo which was updated last will
have its apps shown last. We are trying to move away from the repo
update order being important.

In the future, this sort order should take into account better
heuristics, but for now this is at least deterministic.
2017-04-05 13:26:56 +10:00
Peter Serwylo
c6efdbb20c Repos added later should take higher priority.
The database still treats repos with a _low_ number as _low_ priority.
This means it sounds weird when you say "Repo with priority 1 is the
least important", but other than that, everything works as expected now.

Technically we could recreate the query to update the repo metadata
within DBHelper, but that is difficult because it is sort of build into
the content providers. Unfortunately, we are unable to access content
providers from the DBHelper.

In the future if we are able to migrate away from content providers to a
more dumb data access layer, then we could reuse the query to update the
metadata priorities in the DBHelper. However that is a tomorrow problem.
2017-04-04 16:26:42 +10:00
Hans-Christoph Steiner
21fd522e95 only set installer to privext on versions where its required
To limit the possible oddness of having the installer package being
something different than F-Droid, only set it to priv ext on android-24
and newer, since its required there.
2017-03-31 20:07:56 +02:00
Hans-Christoph Steiner
a9a37747cb Merge branch 'uninstall' into 'master'
Set installer package name to privext if using that

See merge request !454
2017-03-31 18:00:41 +00:00
Hans-Christoph Steiner
e2ab447315 Merge branch 'privext-updates' into 'master'
InstallerFactory: Check for privext before checking if apk to be installed is privext

Closes #911

See merge request !459
2017-03-31 17:45:11 +00:00
Peter Serwylo
c3424f9ff3 Update AppDetailsAdapterTest for apps that don't have screenshots.
While here, also added a couple of new test cases to better ensure the
adapter plays nicely with its items when receiving an app with specific
states.
2017-03-31 12:12:19 +02:00
Hans-Christoph Steiner
b08dfdcb80 move "What's New" placeholder to where its used
There is still quite a bit to figure out in the data format of the
per-package "What's New" entries, and its breaking the tests, so move
the placeholder code to the one spot where the placeholder whatsNew
entry is used.
2017-03-31 12:11:56 +02:00
Hans-Christoph Steiner
d90c773161 do not show screenshots view in AppDetails if none are available
App.getAllScreenshots() works nicely here, but its probably a temporary
measure until we figure out how to handle the various kinds of
screenshots (TV, Wear, etc).
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
28bcbc548a use central method to setup Jackson in locked down setup
This is based on @pserwlyo's work.  The App and Apk classes currently
need just the public instance variables auto-filled by Jackson, so
everything else is considered opt-in, via @JsonProperty declarations.
This is currently only used for setLocalized(), setUsesPermission(),
and setUsesPermissionSdk23().

# Conflicts:
#	app/src/test/java/org/fdroid/fdroid/updater/IndexV1UpdaterTest.java
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
9d026bbdbc use string name for JacksonInject to make it easy to read
java
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
f86b65e12a rename Apk.repo to match App.repoId and Repo.id
Somehow, the Apk class has its Repo ID variable confusingly named just
"repo", which throughout the code is used to represent an instance of
Repo.
2017-03-31 09:09:31 +11:00
Hans-Christoph Steiner
6f58c2a13d make Jackson inject repoId rather than looping later to add it
repoId is used in Repo, App, and Apk instances to point to the Repo data
in the database.  It does not come from the index files, but rather the
client database.
2017-03-31 09:09:31 +11:00