4157 Commits

Author SHA1 Message Date
Peter Serwylo
69b58c7646 Whats New: Added list of recently updated apps to the main view.
Smooshes the recently updated and recently added lists into one,
and adds a status line under each app saying which of the two it
is (i.e. "Recnelty Updated" or "Whats New".
2017-03-03 13:14:05 +11:00
Peter Serwylo
517301194b Swap: Added splash screen to "Nearby" tab on main screen.
It doesn't load up the entire swap activity at this point. Instead it
is an entry point to direct the user to that activity.

Also added stubs for the remaining screens which need to be implemented
to the MainAdapter and MainController.
2017-03-03 13:14:05 +11:00
Peter Serwylo
b151374a6c Introduce new main activity, currently mostly empty.
This activity so far has a bottom navigation bar with 5 tabs.
The tabs can be changed, but no content is shown.
2017-03-03 13:14:05 +11:00
Peter Serwylo
f0d4f8f01a Make autoDownloadUpdatesUpdateService part of the public API of UpdateService.
This will be a requirement for an 'Update All' button in the UI.
2017-03-03 13:14:05 +11:00
Peter Serwylo
226554c026 Toolbar instead of ActionBar in RepoDetailsActivity. 2017-03-03 13:14:05 +11:00
Peter Serwylo
d8dc1698d6 Toolbar instead of ActionBar in ManageReposActivity. Remove need for Fragment in manage repos.
The fragment was quite straightforward to roll into the activity. Most
of the code moved across almost exactly as is.

Also added a theme for the toolbar so that in the future it will be
easier to support dark/night themes as well.
2017-03-03 13:14:05 +11:00
Peter Serwylo
30701ff9ac Change theme to not have an action bar.
This will temporarily break activities which depend on the action bar until
the following commits replace their dependencies with a Toolbar instead.
2017-03-03 13:14:04 +11:00
Peter Serwylo
1bb82fa077 No longer limit VectorDrawables to AppDetails2.
It was recently added to FDroidApp, so no longer neccesary in
AppDetails2.
2017-03-03 13:14:04 +11:00
Peter Serwylo
ba82cfcfc5 Bumped support lib versions. Added dependencies for new UI.
The following official Android support libraries were added:
 * recyclerview-v7
 * cardview-v7
 * design
 * support-vector-drawable
 * constraint-layout
 * palette
2017-03-03 13:14:01 +11:00
Peter Serwylo
04182b64aa Merge branch 'mvp76--notifications_742' into 'master'
Notification improvements from mvp76

See merge request !443
2017-03-01 03:42:39 +00:00
Peter Serwylo
eb3c6e6e0b Fix lint warnings.
Removed unused translations from values-* folders.
Used `app:srcCompat` instead of android:src for some `ImageView`s
2017-03-01 13:41:48 +11:00
mvp76
d43b31a701 Fix checkstyle errors 2017-02-28 23:43:23 +01:00
mvp76
0b53f69427 Remove static from appMapping 2017-02-28 23:15:31 +01:00
mvp76
238dff5c10 Update download progress for OBB files 2017-02-28 22:45:41 +01:00
mvp76
1418a419ea Remove "InstallError" entries when clearing notification
I.e. either the user "swiped" the notification away or clicked on it to
view the error message (and thus the notification was auto canceled)
2017-02-28 22:24:26 +01:00
mvp76
a8509ae833 Added a comment about the key being the downloadUrl 2017-02-28 22:07:40 +01:00
mvp76
7b446daf3f Make AppUpdateStatusManager a singleton 2017-02-28 21:57:51 +01:00
mvp76
a4c187f3e1 Add strings for first time installs 2017-02-28 20:56:35 +01:00
mvp76
04d2d004a3 Add logic to show/hide notifications based on appdetails screen
Also, add code to AppDetails2 to match AppDetails, keeping track of
currently viewed app. Moved the nulling of this info to onStop instead
of onPause, since alerts may be shown on top of the details page, while
still visible.
2017-02-28 20:56:35 +01:00
mvp76
d2cc4fcb05 Set blue color on notifications 2017-02-28 20:56:35 +01:00
mvp76
40a061ae73 Fix for old devices
They can't use vector drawables in notifications. Also, groups can not
be used, see http://stackoverflow.com/a/34953411.
2017-02-28 20:56:35 +01:00
Peter Serwylo
583ea96816 Clarify that the pendingIntent arg can be null. 2017-02-28 20:56:35 +01:00
Peter Serwylo
2ad61a4eb7 Replace setApkInternal with more specific functions.
The `setApkInternal` method had to infer the intent of the caller
based on the arguments which were passed on, and then do specific
things depending on the input. Instead, this change has three
distinct actions which can happen (add/remove/update). Each of
these methods does only one thing, and doesn't have to guess
the intent of the caller. The only exception may be "add", which
will (for convenience) delegate to "update" if it already knows
about the apk in question.
2017-02-28 20:56:35 +01:00
Peter Serwylo
d00de69974 Extract "remove apk" code to simplify setApkInternal().
The only time `status == null` was when coming from `removeApk()`. By
moving the logic out of `setApkInternal()` into `removeApk()` it makes
it easier to reason about `setApkInternal()` as it now does less. Also,
it was doubling up on the `syncrhonized (appMapping)` and `if (entry !=
null)` logic which is no longer required, because `removeApk()` was
already doing that.

While here, also make explicit the fact that `status` can no longer be
`null`.
2017-02-28 20:56:35 +01:00
Peter Serwylo
30d3f8efcc Make "batchUpdates" mode an implementation detail of the AddUpdateStatusManager class.
Because of the way that this can be misused without the compiler knowing
(e.g. by forgetting to call `endBatchUpdates()`) it may be safer to move
it to an internal implementation detail of the class.

It could probably be done away with completely if the `notify*` methods
were moved out of the respective `*ApkInternal()` methods, but that
requires more significant refactoring to get right without code
duplication.
2017-02-28 20:56:35 +01:00
Peter Serwylo
aa945367c9 Pass potentially nullable argument instead of guarding.
It seems that `setContentIntent()` will do fine if we pass it a null
argument. The default value is `null` anyway, and it doesn't mandate
a non-null argument.
2017-02-28 20:56:35 +01:00
Peter Serwylo
d2ef357403 Invert if statement to bail early. 2017-02-28 20:56:35 +01:00
Peter Serwylo
7329dc5d8d Return notification instead of builder.
Given that none of the callers need the functionality of the builder,
lets make it explicit that we don't expect the builder to be further
customized once it is returned. Instead, return a notification to hint
that no further customization is required/desired.
2017-02-28 20:56:35 +01:00
Peter Serwylo
ef7d8dfce9 Make updates/installed final to slightly simplify code. 2017-02-28 20:56:35 +01:00
Peter Serwylo
a2997747af Clarify the unused status of notificationManager 2017-02-28 20:56:35 +01:00
Peter Serwylo
0b1940c4bf Make it explicit that it may return null.
Given that some places where this method is invoked does a null check,
it seems reasonable to make this assumption explicit. That way if devs
use the method in the future, then they will be aware of the contract.
2017-02-28 20:56:35 +01:00
Peter Serwylo
875b0d091f Replace if/else with switch
This is common throughout the F-Droid code base.
2017-02-28 20:56:35 +01:00
Peter Serwylo
49f20f64b3 Added documentation. 2017-02-28 20:56:35 +01:00
Peter Serwylo
1a9f5d60bf Remove dead code 2017-02-28 20:56:35 +01:00
Peter Serwylo
c81b2c7fe4 Minor formatting.
Neither pmd/checkstyle/many-devs are particularly precious about
hard rules of when to wrap a line. In this case we could've brought the
`ErrorDialogActivity` onto the same line as `putExtra`, but instead
opted to chain the method calls as per the `getAppDetailsIntent` method.
2017-02-28 20:56:35 +01:00
mvp76
f7e12b4f25 Icon fixes and general tweaks 2017-02-28 20:56:35 +01:00
mvp76
28d683e16a Add intent for "installed" state 2017-02-28 20:56:35 +01:00
mvp76
0461860479 Removed "installed" notification when entering Details screen. 2017-02-28 20:56:35 +01:00
mvp76
7efa62891d Use strings, async image loading, "unknown" status added. 2017-02-28 20:56:35 +01:00
mvp76
55c7a21c90 Move app status handling to new AppUpdateStatusManager 2017-02-28 20:56:34 +01:00
mvp76
10cbf1ef7a Create notification helper class 2017-02-28 20:56:34 +01:00
Hans-Christoph Steiner
9e1458f41e Merge branch 'nougat' into 'master'
Support for PrivilegedExtension on Nougat

Closes privileged-extension#17

See merge request !442
2017-02-28 18:38:46 +00:00
Chirayu Desai
1a586511cf ApkFileProvider: Explicitly grant read permission to PrivExt 2017-02-28 17:47:36 +05:30
Chirayu Desai
c004f1ce10 PrivilegedInstaller: Use ContentUri on Nougat (24) and above 2017-02-28 17:47:29 +05:30
Peter Serwylo
3ca3a6d699 Merge branch 'preperation-for-new-ui' into 'master'
Some groundwork for the main screens new UI

See merge request !432
2017-02-28 02:40:14 +00:00
Peter Serwylo
6ac62d791a Merge branch 'prep-for-new-index' into 'master'
prep for new index-v1

Closes #819

See merge request !439
2017-02-28 02:35:15 +00:00
Peter Serwylo
a93904d907 Added preference to manage repositories
As this is no longer a top level menu item, it is now the first item
in the settings, under "Updates".
2017-02-28 08:29:38 +11:00
Peter Serwylo
bdde162f56 Notify when new categories are available, old ones are no longer available.
Whether a category is "available" or not is not a function of whether it
is in the category table or not. Rather, it is a function of whether there
are any active apps/apks which are in that category. Thus, don't notify
after inserting a category (the notification was wrong anyway as it was
trying to notify the AppProvider Uri instead of the ContentProvider one).
Instead, do it after a repo update is complete.
2017-02-28 08:29:38 +11:00
Peter Serwylo
f4c03c6baa Make category searching case insensitive. Only works for ASCII :( 2017-02-28 08:29:38 +11:00
Peter Serwylo
25d2659b93 Be more explicit about searching categories with free form text. 2017-02-28 08:29:38 +11:00