148 Commits

Author SHA1 Message Date
Daniel Martí
94eb8c7084 Update support-v4-preferencefragment aar 2015-04-01 11:32:39 +02:00
Daniel Martí
2ce62aac65 Adapt our gradle setup to the new v4-preferencefragment location 2015-04-01 11:28:36 +02:00
Daniel Martí
2f2a3a7755 Clarify that we're using a slightly different spongycastle 2015-04-01 11:22:09 +02:00
Daniel Martí
893e68b3da Don't use older jmdns when not building from source 2015-04-01 10:57:39 +02:00
Daniel Martí
ee287220b8 Forgot to bump zxing maven dep after bumping the source dep 2015-04-01 10:49:46 +02:00
Peter Serwylo
a2be7d9013 Fix update count, breakage from rebase, and broken tests.
The update count was broken because I added the join onto the
apk table, and in the process, forced a GROUP BY on the AppProvider
queries. This group by made the COUNT(*) actually count the number
of apks for each app, not the total rows.
2015-04-01 16:20:20 +11:00
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.
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
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í
eb6df43384 Bump support-v4-preferencefragment 2015-03-31 21:20:21 +02:00
Daniel Martí
246d1c5f32 Remove MemorizingTrustManager, not used right now 2015-03-31 20:47:19 +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í
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
Daniel Martí
82f4a975bb Don't inline log tags, add missing TAG constants 2015-03-30 20:52:40 +02:00
Daniel Martí
fdfdb0935f Remove apparently useless uri logs 2015-03-30 20:37:01 +02:00
Daniel Martí
c1cdd5dce1 Remove unused imports 2015-03-30 20:25:37 +02:00
Daniel Martí
bc1b057324 Remove empty lines at beggining of java files 2015-03-30 20:14:52 +02:00
Daniel Martí
e887379dc2 Small style fix 2015-03-30 20:12:20 +02:00
Daniel Martí
e6efffb981 Add support for amazon app links 2015-03-30 19:02:16 +02:00
Daniel Martí
8239f12ff7 Add support for play.google.com search urls 2015-03-30 18:36:32 +02:00
Daniel Martí
53aa7ec849 Add support for play.google.com app links
As requested in #154
2015-03-30 18:07:03 +02:00
Daniel Martí
d22c714dbd Ignore leading and trailing whitespaces in search keywords
As reported in #58
2015-03-30 17:41:35 +02:00
Daniel Martí
85d7752d0a Use the same logging tag scheme everywhere
We were using different methods and violating the correctness error
"Log tags are only allowed to be at most 23 tag characters long." as reported
by lint.

Changes:

* Always start tags by "fdroid." (even though it's a bit redundant)
* Replace "org.fdroid.fdroid." by "fdroid."
* Don't include "compat.", "data." "views.fragments." et al (these didn't and
  shouldn't be namespaces really, only for file/code organisation)
* Do include parent classes for subclasses, e.g. "fdroid.RepoProvider.Helper"
  since these can conflict
2015-03-30 17:16:56 +02:00
Daniel Martí
76396f224f Bump gradle plugin to 1.1.3
We also no longer depend on the undocumented internal variable sdkFolder
2015-03-30 16:49:56 +02:00
Daniel Martí
cd667371e6 Merge branch 'fix-85/remove-downloaded-index-files' of https://gitlab.com/pserwylo/fdroidclient 2015-03-30 16:39:45 +02:00
Daniel Martí
ebacde9631 Bump build-tools to 22.0.1 2015-03-30 16:38:11 +02:00
Daniel Martí
bd4cd81f50 Merge branch 'fix/issue-34-empty-list' of https://gitlab.com/pserwylo/fdroidclient 2015-03-30 16:22:22 +02:00