1823 Commits

Author SHA1 Message Date
Peter Serwylo
2a481f6889 Correctly navigate "up" to the swap list.
When viewing app details from a swap list, we need to return to the
swap list when pressing "up". Previously it would go to the main list
of apps, and only return to the swap list when pressing "back".

Now, a subclass of AppDetails is used when in swap mode, which knows
how to navigate up to the correct task.
2015-04-01 15:34:40 +11:00
Peter Serwylo
a16bc22c4a Fixed broken + commented out tests.
They were all due to the addition of "application label" to the
installed app cache. This commit adds a mock ApplicationInfo
to the mock package manager and also specifies the label while
inserting into the test content provider.
2015-04-01 15:33:58 +11:00
Peter Serwylo
9dfa18aead Make F-Droid tests runnable from Gradle.
This also makes AndroidStudio integration work better, which makes
running and debugging tests much nicer than the CLI.

Also cleaned up imports in one test, and made the symlink tests not
fail on older devices below API 19.
2015-04-01 15:33:51 +11:00
Peter Serwylo
da566b44ce Don't show swap apps in the main list of apps.
Achieve this by joining the fdroid_app table onto fdroid_apk and then
fdroid_repo, then checking if fdroid_repo.isSwap is 1.
2015-04-01 15:32:38 +11:00
Peter Serwylo
85300331e0 Minor cleanup after CR.
Formatting, spelling, NonNull/Nullable annotations, removing unused
imports, and adding SuppressWarning for unused logging "TAG" properties.
2015-04-01 15:32:36 +11:00
Peter Serwylo
f5ce318be7 Fix for fragment not displaying on 2.3 device.
Also, app details now goes to the "Swap app list" rather than the main list of
apps after hitting the "Up" button from the ActionBar.
2015-04-01 15:30:57 +11:00
Peter Serwylo
842ddb5e24 Trying to make LocalRepo stuff have less subtle side effects.
I had trouble wrapping my head around which point in time the fdroid/repo
directories are created, when they are populated with .html files, and
when the index.xml is put there. I did some minor cleaning up to make
it a bit easier to manage this in the future.
2015-04-01 15:30:21 +11:00
Peter Serwylo
20f17da913 Clean after merge. Refactor swap index.xml generation (to work with API 7).
Althought the construction of the XML document was fine witn Android 7,
the actual serialization of it was limited to 8 or higher. Try as I might,
I couldn't find a way to figure out how to serialize a DOM tree on API 7.

Turns out that the "PullParser" API is able to build and serialize XML
trees on API 7. It's a little clunkier than the DOM alternative, so I
refactored out the generation into a subclass to make it clearer what
it is doing and when.
2015-04-01 15:30:21 +11:00
Peter Serwylo
5036deb61e Swap apps more robust on API < 11. Only show swap repos sometimes.
* Selecting apps to swap fixed

Before the checking of a list item would not actually register it to
be included in the swap. This has been rectified.

 * Added a new property to repos for "isSwap"

Repositories with this property are not shown in the Manage Repos
activity, as there is not much benefit to having this happen.

 * More robust error handling when symlinking files

Before it would check for stdout or stderr and then throw an exception.
This happened even on successful symlinks on my 2.3.3 device. As such,
I've put the error checking after the shell command has completely finished
(just in case there were any race conditions), and more importantly, checked
for the presence of the file being linked - rather than just stdout or
stderr.

 * More code cleanup

Generics <> operator, Nullable annotations, removal of dead code.
db-version/47
2015-04-01 15:30:19 +11:00
Peter Serwylo
c6705e2cb9 Fixed all warnings from LocalRepoManager.java
* Removed dead code
 * Added some Nullable/NonNull annotations to prevent future misuses of variables.
 * More verbose errors when an error occurs creating directories/files.
2015-04-01 15:27:26 +11:00
Peter Serwylo
23ed692436 "Select apps for swap" screen work on API <= 10.
* Provide CheckBox for selected items

Newer API's highlight the background using the "activated" state. Older
APIs need this to be implemented differently, so there are now checkboxes
on the left of the list view items to provide this functionality.

 * Clean up IDE warnings

Diamond operator for generics, remove unused imports and unused method.

 * Adapter class created for installed apps

Cleaned up the code to do with binding views to the adapter in this view.
Previously it made quite a few assumptions about the structure of the layout,
e.g. "layout.getParent().getParent() is a LinearLayout", which would cause
crashes if the layout changed slightly.
2015-04-01 15:27:24 +11:00
Peter Serwylo
4711b50836 Swap works on 2.3 devices.
* Cleaned up text alignment styles for API < 17.

API v17 has a textAlignment style, wherease previous verisons rely on
the "gravity" property. This change includes gravity="center" where there
was previously only textAlignment="center".

 * Fragments get added properly on 2.3 device.

For some reason, when adding the fragment to android.R.id.content, it
wouldn't work on my 2.3 device. This change includes a (almost) empty
activity layout with a single FrameLayout. The fragments are added to
this rather than "content", and it works better. It is not perfect - it
still adds the fargments behind the action bar, and so the action bar
appears blue. But at least they are there :)

 * Added translatable strings where constants were used before.

Not related to v2.3 support, but stil important for a stable release,
that is fully translated.
2015-04-01 15:26:10 +11:00
Peter Serwylo
7fb2de4bae Select F-Droid correctly during swap process. Fixes #141.
Bug in the code which decides which apps to select for swapping.
Due to the way in which Adapters and ListViews work together to provide
"header" and "footer" functionalities for lists, there is a mismatch between
the index in our original adapter, and the actual index on the list. It is
up to us to maintain this correctly, which was not done, hence the off by
one error.
2015-04-01 15:26:10 +11:00
Peter Serwylo
953d3ed8d7 Added search functionality to "add apps to swap" screen.
This was present in the old local repo implementation, and the skeleton
code for implementing it was copied to the swap fragment. The only change
neccesary was to add a search button to the menu and make it have a
SearchView as its action view.
2015-04-01 15:26:10 +11:00
Daniel Martí
3db689b782 Use setBacground(Drawable) on newer apis
setBacground(Drawable) might not just call setBackgroundDrawable(Drawable) in the future
2015-04-01 00:47:23 +02:00
Daniel Martí
990deab398 Suppress all serial warnings
http://stackoverflow.com/questions/7823477/warning-serial-serializable-class-someclass-has-no-definition-of-serialversio

Fixes some of #210
2015-04-01 00:40:18 +02:00
Daniel Martí
f948112e42 Require that any column match ALL the words
Fixes #58 for good
2015-04-01 00:28:27 +02:00
Daniel Martí
11205dcf72 Don't duplicate sql string code as suggested by pserwylo 2015-04-01 00:28:09 +02:00
Daniel Martí
3db3a516eb No need to clean search keywords when matching labels 2015-04-01 00:23:10 +02:00
Daniel Martí
a7d8bbf26f Fix ant build 2015-03-31 23:45:17 +02:00
Peter Serwylo
7569a58f97 Merge branch 'issue-2/notification-improvements' 2015-04-01 08:17:29 +11:00
Peter Serwylo
f1655496d8 Fix issue #2: better notifications on ICS+ devices.
Shows an expandable notification on devices that support it (4.1+
I believe). The support library does most of the job of handling
incompatibilities between platforms.
2015-04-01 08:17:05 +11:00
Daniel Martí
48c3e1f747 Revert "Remove now unneeded hacks from root build.gradle"
This reverts commit c4f416396a3aa35fa81ccfb0415d9e01135ae8a8.
2015-03-31 21:25:02 +02:00
Daniel Martí
73bef92f42 Bump all buildTools versions 2015-03-31 21:24:36 +02:00
Daniel Martí
eb6df43384 Bump support-v4-preferencefragment 2015-03-31 21:20:21 +02:00
Daniel Martí
c4f416396a Remove now unneeded hacks from root build.gradle 2015-03-31 20:47:19 +02:00
Daniel Martí
871f1f2d90 spongycastle/pg is not used 2015-03-31 20:47:19 +02:00
Daniel Martí
246d1c5f32 Remove MemorizingTrustManager, not used right now 2015-03-31 20:47:19 +02:00
Daniel Martí
c81eb9ec69 Replace nanohttpd submodule with checked in code 2015-03-31 20:24:34 +02:00
Daniel Martí
3784e58fc4 Add gradle support to UniversalImageLoader 2015-03-31 20:19:04 +02:00
Daniel Martí
ad1819c10e Replace UniversalImageLoader submodule by checked in code 2015-03-31 20:16:11 +02:00
Daniel Martí
6f91fb41f8 Clean up spongycastle build.gradle files 2015-03-31 20:08:15 +02:00
Daniel Martí
93c5bd4a95 Replace spongycastle submodule with checked in code 2015-03-31 20:05:17 +02:00
Daniel Martí
4258ea1c40 Replace jmdns submodule with checked in code 2015-03-31 19:47:12 +02:00
Daniel Martí
6deac28a8b libsuperuser: remove maven and bintray stuff 2015-03-31 19:38:25 +02:00
Daniel Martí
c64c1a19b7 Replace libsuperuser submodule by checked in code 2015-03-31 19:36:51 +02:00
Daniel Martí
89673dfd2d Replace AndroidPinning submodule by checked in code 2015-03-31 19:32:24 +02:00
Daniel Martí
be2cb0cc43 Ignore generated proguard-project.txt files in libs 2015-03-31 19:20:39 +02:00
Daniel Martí
de3c224b02 Move zipsigner deps into its own build.gradle 2015-03-31 19:14:26 +02:00
Daniel Martí
f8f77babe8 Replace zipsigner submodule by checked in code 2015-03-31 19:10:39 +02:00
Daniel Martí
474cc194ca Update zxing-core to 3.2.0 2015-03-31 19:04:21 +02:00
Daniel Martí
dd1853cab3 Replace zxing submodule by checked in code 2015-03-31 19:04:10 +02:00
Daniel Martí
67407e1095 Fix FieldGetter lint warning 2015-03-31 17:28:08 +02:00
Daniel Martí
c0c80919f7 tools:replace no longer needed to make gradle work 2015-03-31 17:22:36 +02:00
Daniel Martí
713e33bf57 Remove unnecessary "new Type[]" when declaring arrays 2015-03-31 02:24:39 +02:00
Daniel Martí
0fde562b32 Add search changelog item 2015-03-31 02:16:21 +02:00
Daniel Martí
db803bfb0c Split up search terms by whitespaces. Fixes #58 2015-03-31 02:13:15 +02:00
Daniel Martí
60cd63c274 Forgot to fix up the receiver package names 2015-03-30 21:18:43 +02:00
Daniel Martí
ac820baf72 Don't use ArrayList over List unless necessary 2015-03-30 21:07:58 +02:00
Daniel Martí
e1df9c600c Move receivers into subdir 2015-03-30 20:57:31 +02:00