338 Commits

Author SHA1 Message Date
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
Daniel Martí
c11fdd11d8 Bump to 0.83 2015-03-26 19:07:25 +01:00
Daniel Martí
f1084452d4 Add remove-empty-trans script and run it 2015-03-26 19:05:36 +01:00
Daniel Martí
0ced75d451 Bump to 0.82 2015-03-23 16:44:45 +01:00
Daniel Martí
bb775bde08 Run translation fixing scripts 2015-03-23 16:43:38 +01:00
Daniel Martí
61f9d3ac86 Run fix-apostrophes 2015-03-23 12:21:08 +01:00
F-Droid Translatebot
cb9ef84027 Translation updates 2015-03-23 08:55:31 +00:00
Daniel Martí
bc69c8d6ed Run fix-apostrophes 2015-03-19 19:43:18 +01:00
F-Droid Translatebot
0736aef5fc Translation updates 2015-03-19 18:37:46 +00:00
Peter Serwylo
eaea0e2c23 Fix #85: Remove downloaded index files that hang around.
If the download process is interrupted, a "dl-" file hangs around in
F-Droid's cache directory. If the download succeeds, extracts an xml
file from the downloaded .jar file, and then the rest of the process
is interrupted, then a "index-*.xml" file hangs around in F-Droids
files directory.

This fix removes these two types of left over files when F-Droid
is started. In addition, it also makes it so that the downloaded
repo indexes are now more clearly named "index-*-downloaded" (with no
extension, because the code which does it doesn't know whether it is
a .jar or .xml file, and it doesn't matter anyway). Also, it extracts
the .xml files to the cache directory too (instead of the files dir)
and names them "index-*-extracted.xml".

There is some code which removes the old "dl-" files that will become
redundant after the first time it is executed on a users device after
upgrading F-Droid. It is a very small amount of code run on startup,
so I am not concerned about the performance implications of leaving it
there, but I put a comment explaining that it can be removed in the
future.

Includes minor formatting changes, and a few annotations.
2015-03-19 07:38:54 +11:00
Peter Serwylo
3abb426fc3 Added a message when any of the app lists are empty.
Previously, a few people have been confused by an empty list when they first
open F-Droid (e.g. if they are not connected to the internet, and repos didn't
update). This provides some feedback so that there is never a blank screen.

Fixes Issue #34.
2015-03-16 21:42:10 +11:00