Previously, there was a bug with an off-by-one error, as android-11
or later was treating the headerView different to android-10 and
earlier. They now both have the same understanding about the header
view.
For some reasono specify different layout-v* directories to inflate
views based on the android version is not working as desired.
Previously there was a "layout", "layout-land" and "layout-v11" dir.
Only "layout" and "layout-v11" had the "select_local_apps_list_item.xml"
layout in them, the "layout-v11" version did _not_ have a checkbox,
whereas the other vanilla one did.
This worked on a android-16 emulator. It would correctly pick up the
view from "layout-v11". However, on a android-19 device, android-19
emulator, android-21 device and android-21 emulator, they all picked
up the view from the "layout" dir - with checkbox and all.
I couldn't figure out for the life of my why this was happening, so
I started to figure out which one it _would_ work with. I added
a layout-v* for every single version, and in each, put a text view
telling me which version it was. That way, viewing the list of apps to
swap, the list would inflate a view, and tell me which layout-v* dir it
inflated it from. It worked for layout-v17 and higher, but was unable
to inflate layouts from layout-v11 to layout-v16. So I deleted all
except layout-v17, and it now works for android-16, 19 and 21 as per my
tests.
Now that we controll all lib build.gradle files, we can finally do it.
If we want to build support-v7 from source again with gradle, we'll import the
build.gradle and "fix" it like the rest.
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.
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.
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.
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.
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.
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.
* 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.
* Removed dead code
* Added some Nullable/NonNull annotations to prevent future misuses of variables.
* More verbose errors when an error occurs creating directories/files.