114 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
776ad3f540 use only android-14 items in SelectLocalApps until appcompat-v7 is added
Set android-14 as minimum for SelectLocalApps and make sure that everything
will work on >= 14.

fixes #26 https://gitlab.com/fdroid/fdroidclient/issues/26
2014-05-15 09:37:37 -04:00
Daniel Martí
96c3af5485 Add missing RTL/LTR layout attributes 2014-05-08 13:16:21 +02:00
Hans-Christoph Steiner
efacc22c10 include app icons in the SelectLocalApps view
Since we have the packageName, we can just fetch the Drawables directly.
This uses some shortcuts to try to make things run faster.  For example,
the ImageView does not have an ID, instead it is references by the index
number within the LinearLayout.
2014-05-08 00:58:42 -04:00
Hans-Christoph Steiner
7401366ac9 quick improvement of LocalRepoActivity layout
This is meant to try to make the on/off state of the webserver that serves
the local repo more apparent.
2014-05-08 00:58:42 -04:00
Hans-Christoph Steiner
08346b9b18 add Activity to choose which installed apps are in the local repo
This gets the data about which apps are installed from the ContentProvider
that pserwylo recently added for data about "Installed Apps" and presents
a list view for the user to select from by touching each line.  Then if the
user chooses "Update Repo", it will regenerate the local repo based on the
current selection.  It will always include FDroid in the local repo.

fixes #3232 https://dev.guardianproject.info/issues/3232
refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:51:15 -04:00
Hans-Christoph Steiner
94dc2d019f add wizard for sending FDroid to another device via WiFi/QR
This is a little helper to direct people to get a new device to download
FDroid from another device that already has it.  It first prompts them to
join the same wifi network, and offers a QR Code to associate to the same
wifi.  The next step is a QR Code for getting the URL to the local repo.
The index.html on that local repo includes a download link for FDroid and
a repo link to the local repo.

refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:51:15 -04:00
Hans-Christoph Steiner
5050605f72 Activity/Service for running a local repo via http://
This is a skeleton for the upcoming local repo (aka swap aka Kerplapp).
Right now, it just provides an Activity for controlling a Service which
manages a local webserver (nanohttpd).  Next, it will be wired up to the
local repo created via a dedicated Activity for managing the list of apps
included in the local repo.

refs #3204 https://dev.guardianproject.info/issues/3204
2014-05-06 19:28:27 -04:00
Daniel Martí
c32fb3a6b7 Add gravities beside textAlignment to fix issues in <4.2
textAlignment works well for 4.2 and later, but it is ignored in 4.1 and
earlier. Seting gravity to its textAlignment equivalent fixes this.
2014-05-01 19:23:59 +02:00
Daniel Martí
57eaad7c1b Remove RelativeLayout leftovers 2014-04-17 01:20:32 +02:00
Daniel Martí
4db53deb42 Forgot to set the icon sizes back to normal
They got added +8 since we added paddings directly to the icon layout. Since
those paddings got removed, this has to be switched back too.
2014-04-11 19:24:46 +02:00
Daniel Martí
8ed76f47ee More improvements to the app list layout
* Don't use a RelativeLayout for the whole thing
* Use more external paddings, not per-element paddings
* Center everything vertically
2014-04-10 16:33:15 +02:00
Daniel Martí
a477f421cb Greatly improve app list layout
* Don't hard-code ellipsis in the code
* Separate the two rows into two linear layouts
* Don't abuse relative layouts
* Use ellipsize with weights to achieve best results
2014-04-07 19:35:04 +02:00
Daniel Martí
a1a8c06565 Start using contentDescription on ImageView elements 2014-03-22 11:12:42 +01:00
Rene Treffer
d55fc7cd69 Fix build failure with newer toolchains.
Android somehow wants every string to be externalized on newer
toolchains, let's prepare for that.

This fixes in-tree building of f-droid.
2014-03-16 13:44:25 +01:00
Daniel Martí
6fa72607b8 Fix relative layouts on <4.2, broken while trying to add RTL support 2014-03-10 18:19:15 +01:00
Daniel Martí
0f44c5edba Fix scaling of icons on AppDetails 2014-03-10 17:56:38 +01:00
Daniel Martí
31aa3fcf30 Make titles and subtitles align properly in RTL
This is just a cosmetic fix to make the RTL layout look like the normal LTR
one. It is, effectively, making non-RTL text be aligned to the right. I
suppose that's fine, for the sake of making it readable since we don't want it
aligned to the left, breaking the layout.
2014-02-21 00:32:17 +01:00
Daniel Martí
66563d30d9 First attempt at supporting RTL
Following the Android 4.2 changes, which explain how to add native support for
RTL, I've replaced Right for End and Left for Start. Enabling RTL to see the
results.
2014-02-21 00:11:58 +01:00
Daniel Martí
44bb904ab0 Remove obsolete dbSyncModeValues array 2014-02-20 13:57:59 +01:00
Daniel Martí
231fb3dd8a Merge commit 'refs/merge-requests/65' of gitorious.org:f-droid/fdroidclient
Conflicts:
	src/org/fdroid/fdroid/views/fragments/RepoListFragment.java
2014-02-19 23:12:19 +01:00
Hans-Christoph Steiner
c7a40e9fa6 purge old, unused repo list XML layout
Its all done using getListView() in the ListFragment now :-)
2014-02-20 08:59:42 +11:00
Daniel McCarney
3223e20e33 Add support for Network Service Discovery of FDroid repos.
If the device supports API level 16 (Android 4.1) then add a menu item
on the repository management screen to "Find Local Repos". Activating
this menu item will initiate NSD service discovery with the NsdHelper
class looking for 'fdroidrepo' and 'fdroidrepos' service types on the
local network. When one is found, the service is resolved and the name
& IP are populated into a list of discovered repositories. Clicking an
NSD discovered repo will prompt the user to add the repo.
2014-02-19 15:32:44 -05:00
Daniel Martí
a3b316c4a8 Fix a couple regressions 2014-02-12 20:46:32 +01:00
Daniel Martí
4c58514152 Apply similar layout improvement to app list elements 2014-02-12 20:23:19 +01:00
Daniel Martí
f35528cd78 Fix remaining issues related to vertical length and centering 2014-02-12 20:15:43 +01:00
Daniel Martí
9bd236d66c Some much needed fixes to appdetails headers
* If the info is taller than the icon, grow larger to fit it in
* Center icon vertically
* Move padding out of the header
* Revert some font sizes to how they were some time ago, a bit smaller
2014-02-12 19:30:26 +01:00
Daniel Martí
9b2e5c2426 Don't let AppDetails header textviews overflow 2014-02-12 19:10:47 +01:00
Peter Serwylo
da8e41249b Removed DB, implemented AppProvider.
Yay!

As expected, a lot of the stuff in DB class is due to UpdateService
requiring it to process the downloaded indexes and insert data into
the database. Thus, this change is about removing that stuff from
the DB class and migrating to ContentProviders.

This required a bit of a change to the way that UpdateService decides
what to do with the data from indexes, but I hope it will make
understanding and changing UpdateService easier in the long term.
For example, it used to read the app details from database, then
if a repo wasn't updated (due to unchanged index) then it would take
the app details for that repo from the list of apps, and re-update
the database (or something like that).

Now, it has been refactored into the following methods:
 * updateOrInsertApps(appsToUpdate);
 * updateOrInsertApks(apksToUpdate);
 * removeApksFromRepos(disabledRepos);
 * removeApksNoLongerInRepo(appsToUpdate, updatedRepos);
 * removeAppsWithoutApks();
 * and probably some others...
Which hopefully are self-explanitory.

The recent change to implement single repo updates was re-implemented
with in light of the methods above. The interface to UpdateService for
scheduling a single repo update is the same as it was before, but
the implementation is completely different. Still works though.

Using batch content provider operations for repo updates,
but they suffer from the problem of not all being under the same
transaction, so if an insert/update stuffs up half way through, we
are left with only half of the update being complete. In the future,
if there is some way to implement notifications from the content provider's
applyBatch method, then we can do it all in the one transaction, and
still have notifications. Currently we break it into several calls
to applyBatch (and hence several transactions) to inform the user
of the progress.

Also adding the beginnings of some tests for AppProvider. In the future, I'll
work on adding better coverage, including instrumentation to test UI features.

==========================
Below is a list of many of the minor changes that also happened along the way
==========================

Make "Can update" tab stay up to date using content observer, rather
than manually deciding when to refresh the tab label as before.

The installed app list is now cached in Utils, because it is invoked
quite a few times, especially when rendering the app lists. The cache is
invalidated when PackageReceiver is notified of new apps.

The content providers don't notify changes if we are in batch mode.
I've left the notification at the end of the batch updates as the
responsibility of the UpdateService. However, it would be nice if this
was somehow handled by the content, as they are really the ones who
should worry about it.

Made curVersion, curVercode and curApk work with providers.
This was done by removing curApk (otherwise we'd need to query the db each
time we fetched one app to get a reference to that apk (resulting in hundreds
of queries). Instead, UpdateService now calculates curVercode and curVersion
and saves them to the database. We then use these where possible. If we really
need curApk (because we want info other than its version and code) we still have
the option of ApkProvider.Helper.find(app.id, app.curVercode). I considered
putting this inside the app value object, e.g. in getCurApk() but thought
better of it as it will likely result in people invoking it all the time,
without realising it causes a DB query.

incompatibleReasons required a minor UI tweak, removing the "min sdk"
ui element from the Apk list. It is replaced by the "Requires: %s" view
(which only appears when the app is incompatible). In the process, and in
response to some feedback from mvdan, I left the min sdk in there, but
only made it show when in "expert mode", just like the architecture.

In order to make the "installed apps" query work under test conditions,
needed to change the way the InstalledApkCache be replaceable with a
mock object.

Pause UIL loading on fast scroll of list, as the list was very choppy for
some reason.

Re-added "Last repo scan" info to the Manage Repo list view.

Fixed up some misc TODO's, removed some unused/empty functions.
2014-02-08 11:29:59 +11:00
Hans-Christoph Steiner
126d96e4ba prevent soft keyboard from popping up on RepoDetails
Its quite annoying to have the URI EditText in focus and the soft keyboard
pop up when viewing the RepoDetails since the vast majority of the time,
the user will be viewing the info there, not editing the URL.

This commit just moves the focus to the frame, and prevents the soft
keyboard from showing up by default.  The user can still click on the URI
EditText to edit it and the soft keyboard will pop up.
2014-01-28 20:31:46 -05:00
Hans-Christoph Steiner
47659b5cec relabel misnamed items from "signature" to "repo fingerprint"
In the new Repo Details screen, there is some elements that are labels as
the "signature".  This is not quite right, it is actually referring to the
fingerprint of the repo signing key.  Since a repo will also usually have a
HTTPS certificate fingerprint, there will also be a fingerprint for that
certificate.
2014-01-21 18:30:02 -05:00
Daniel Martí
499c9e50c5 Move "https://" addrepo default into a string 2014-01-08 13:36:45 +01:00
Peter Serwylo
3731ed8f23 Merge remote-tracking branch 'upstream/master' into improvement/16/manage-repos
Conflicts:
	res/values/strings.xml
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/ManageRepo.java
	src/org/fdroid/fdroid/RepoXMLHandler.java
	src/org/fdroid/fdroid/Utils.java
2014-01-04 20:45:52 +11:00
Peter Serwylo
ffa2c962dc Merge branch 'master' into improvement/16/manage-repos
Conflicts:
	res/layout/appdetails.xml
	res/values/strings.xml
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/FDroid.java
	src/org/fdroid/fdroid/ManageRepo.java
2014-01-04 20:19:27 +11:00
Daniel Martí
8a90687867 Slightly larger margin separating minsdk 2014-01-03 04:47:42 +01:00
Daniel Martí
aee57c448b Sightly more margins in app list views 2014-01-03 02:52:12 +01:00
Daniel Martí
50f68d34b9 Support minSdk info in version list views 2014-01-03 02:44:24 +01:00
Daniel Martí
ab6f41ec68 More layout tweaks, fix landscape 2014-01-03 02:17:32 +01:00
Daniel Martí
cd00760cc4 Remove compact icons, replace installed with a symbol 2014-01-01 21:45:20 +01:00
Daniel Martí
771947536e Add categories to AppDetails, layout tweaks 2014-01-01 21:08:41 +01:00
Daniel Martí
e302baa340 Do paddings for the icon and not the whole applist item 2014-01-01 17:09:01 +01:00
Daniel Martí
b4cee703f2 applistitem centering tweaks 2014-01-01 02:15:27 +01:00
Daniel Martí
67ec0f748c Separate status and license from name and summary in app lists 2013-12-31 11:27:19 +01:00
Daniel Martí
e437898e33 Further fixes to layouts 2013-12-31 11:03:34 +01:00
Daniel Martí
fa02eb5733 Small tweaks to paddings and layouts 2013-12-31 11:03:34 +01:00
Daniel Martí
c306fe9157 Properly center elements in the app list views 2013-12-26 00:08:43 +01:00
Daniel Martí
e3789631ba Restructure applistitem:
* Move it to the top right corner
* Don't let the app name overlap it
* Ellipsize version names to leave space for name
* Summary can now take two lines if it needs them
* Installed versions are now bold
2013-12-25 22:46:46 +01:00
Daniel Martí
960e04d425 Merge commit 'refs/merge-requests/55' of gitorious.org:f-droid/fdroidclient 2013-12-25 19:46:09 +01:00
Peter Serwylo
8306007f84 UI tweaks for manage repos.
Padding for add repo dialog.
Move cursor to end of text input for new repo dialog.
2013-12-12 10:50:01 +11:00
Peter Serwylo
4fdc23569b Added update button to repo details screen. 2013-12-06 13:01:05 +11:00
Peter Serwylo
82af6fc60e Merge branch 'master' into improvement/16/manage-single-repo
Phew, monster merge. Going to commit after *seemingly* resolving
conflicts, but it will no doubt take a few compile and runs to sort out
any funny stuff.

Conflicts:
	AndroidManifest.xml
	res/layout/addrepo.xml
	res/layout/appdetails.xml
	res/layout/repolisticons.xml
	res/values/strings.xml
	src/org/fdroid/fdroid/DB.java
	src/org/fdroid/fdroid/FDroid.java
	src/org/fdroid/fdroid/ManageRepo.java
	src/org/fdroid/fdroid/UpdateService.java
2013-12-06 08:43:11 +11:00