Previously, anything added via the Add New Repository dialog would just
overwrite any existing repo config that was there. This has become a
bigger issue with the QR Code scanning since it could become an attack
vector. This is the first step towards making this Add Repo dialog give
more info to the user about the state of things, and what the user might
replace by clicking OK.
They are more consistent now. Transitioning to RTL languages will also be
easier since more of them can be mirrored now. Also fixes some spacing issues
with icons and others.
Also, move visibility stuff from onResume to onCreate (they are only affected
by preferences, i.e. onCreate will always be run since the preferences button
is only in our main activity).
Previously, everybody had to remember the preference name and the
default value. If it was ever changed, this would have to be updated
everywhere. Now, the Preferences class is responsible for talking to the
SharedPreferences functionality of ANdroid.
I've started with just the compactlayout preference, because
that is what I required for this fix.
Removed the license and the version info from the compact view, and
showed the description instead. The installed status, and whether the
app can be updated or not (but not which version can be updated to) is
now shown via little icons on the right hand side of the list view.
Also refactored adapters to allow different views for
Available/Installed/Updates tabs. This is because I didn't want the
"installed" status icon in the installed tab, and neither the
"installed" nor the "updates" icon in the "updates" tab.
The adapters were moved to the "views" package, because I needed to add
three new classes and they started to clutter the list of *.java files.
* Add paddings.
* Don't use hard-coded pixel sizes.
* Don't use white color directly (this would soon break the white holo theme)
* Don't use an "empty" textview to force a vertical space.
Looks much cleaner now, and the code is easier on the eyes.