2192 Commits

Author SHA1 Message Date
Peter Serwylo
a82032d5d0 Fixing lint errors in swap WIP branch but not master. 2015-08-17 22:59:51 +10:00
Peter Serwylo
2008708cd9 Change bluetooth response to remove deprecated warning.
The StringBufferInputStream is deprecated, because it doesn't know the
encoding of the string it is buffering. This has been changed to use
a ByteArrayInputStream with UTF-8 encoding now.

Also made use of previously unused mimeType parameter to set the
Content-Type header of the response.
2015-08-17 17:15:42 +10:00
Peter Serwylo
99ebc84a91 Show message when touching the QRCode button, but swap isn't enabled.
Also cleaned up a doc comment in the swap activity, and minor
formatting of swap related strings in strings.xml.
2015-08-17 17:15:08 +10:00
Peter Serwylo
930c906460 Allow bluetooth:// URLs to be parsed by java.net.URL.
Sets a stream handler in FDroidApp which understands bluetooth://
URLs and returns a non-functioning URL handler for such URLs.
The reason it is  non-funcitoning is because the openConnection()
function is not being used by the BluetoothDownloader at this point.

In the absense of this, a MalformedURLException is thrown.

The bluetooth stuff is still broken, but it is not broken in
this way any more.
2015-08-17 08:08:49 +10:00
Peter Serwylo
6bfd76caf2 Search now works when choosing swapped apps to install.
Was incorrectly parsing the URI in order to build a query for the database.
2015-08-17 00:00:30 +10:00
Peter Serwylo
e53a56f7b2 Show "preparing local repo" stuff in activity, not dialog.
Use the same view as when downloading a swap index. This means
no more progress dialogs, and no more Toasts when finished, which
is good.
2015-08-16 23:32:37 +10:00
Peter Serwylo
1ea35f6977 Remove unused AppDetails subclass. Show download progress for swap.
The AppDetails subclass used to be used when you couldn't install apps
directly from the swap workflow. Now we don't send people to app
details, so the activity is unneeded.

The swap progress also now listens for progress broadcasts, rather than
showing an indeterminant progress bar.
2015-08-16 17:29:56 +10:00
Peter Serwylo
2868e3c4f1 Allow apks to be installed from swap. Show feedback while downloading.
Seems to work pretty-alright even when installing multiple apps.
Shows a progress (indeterminent at this stage) bar for each downloading
item, and hides the install button.
2015-08-16 11:31:02 +10:00
Peter Serwylo
d672983a90 Refactor toolbar colours, fix notification for < 4.1 devices.
InnerView.getToolbarColour() was expecting a @ColorRes, except all views
were returning integers which were the colour value, not a pointer to
the resource as they should have been. Now only one place requires a
call to getResources().getColor() whereas before it was in each view.

Notifications on pre 4.1 devices require a pending intent to work. This
is so that when you touch the intent, it takes you somewhere meaningfull.
Without it, the update process crashes.
2015-08-16 08:34:05 +10:00
Peter Serwylo
0b160d2e04 WIP: hooking up ApkDownloader to swap apps. 2015-08-09 22:12:56 +10:00
Peter Serwylo
ba6d2e7793 WIP: Fixing styles and removing unused styles. 2015-08-09 22:12:55 +10:00
Peter Serwylo
5ee8307703 Merge branch 'master' into new-swap--updated-downloader
Fixed multiple conflicts to do with the repo updater moving to
broadcasts from the previous progress listeners.
2015-08-09 22:12:09 +10:00
Peter Serwylo
2b8a882933 Merge branch 'integration/mr-102-and-107' into 'master'
Integration branch containing both MR 102 and 107

Given both MR !102 and !107 both stood on eachothers feet to some extent, this branch contains all commits from both in an integration branch. If both @Nutomic and @eighthave are happy that it faithfully kept their changes during the minor merge conflict resolutions, then we can merge this instead of those two branches. 

* !102 changed download progress from events + listeners to broadcasts + receivers.
* !107 made use of download progress events + listeners to show a downloading UI that was embedded in the activity, rather than shown as a modal dialog.

The conflicts which arose while I merged these branches together were in `AppDetails`. I made it so that, to the best of my ability, it uses broadcast receivers instead of progress listeners when updating the progress bar. Other than that, the only other conflict was both trying to store a reference to the main button from the UI. The only changes were in naming (mainButton vs btMain) and also in the place where the local variable was assigned (onCreate() vs setupViews() which is called during onCreate() anyway).

After merging, I did some minor cleanups. This is because in the process of checking that my conflict resolution compiled, I thought it best to remove a bunch of warnings from `AppDetails` and others. Turns out that by doing so, I found a bug due to the integration (to do with the `AppDetails` querying the downloader for status in `onResume()` rather than waiting for a broadcast event) so I'm glad I did so.

Let me know what you think, and then after the next stable, we can go ahead and merge this if people are happy.

p.s. I have no idea why GitLab is showing @eighthave's commit at the top of the list of commits, after my integration related commits.

See merge request !114
2015-08-09 06:09:54 +00:00
Daniel Martí
a777c89ef6 README: improve build instructions and add some building tips 2015-08-05 16:53:42 -07:00
Daniel Martí
94ace2e1af Get rid of support submodule
It is now unused. Was used for v7-appcompat in ant, which is no longer
supported.
2015-08-05 16:48:45 -07:00
Daniel Martí
20c3a50f3b Bump to 0.95 v0.95 2015-08-04 14:37:34 -07:00
Daniel Martí
91696f5ccb Fix versioning scheme for actual stable releases 2015-08-04 14:35:46 -07:00
Daniel Martí
f1901d75ac Remove leftover lightWithDarkActionBar enum item 2015-08-03 17:52:31 -07:00
Daniel Martí
bdb71d828f Have the light theme as the default throughout
It was changed in preferences.xml, but not in the manifest and in the default
case in the Java code.
2015-08-03 17:45:32 -07:00
Peter Serwylo
cbd8c977e2 Use annotations to remove lint warnings.
Also removed undocumented java doc.
2015-08-03 22:59:47 +10:00
Peter Serwylo
215dcc0dd9 Don't use Notification class, but rather NotificationCompat. 2015-08-03 22:59:46 +10:00
Peter Serwylo
f3a9581d89 Fix warnings in app details (remove progress thingo).
AppCompat no longer supports progress indicators in the action bar. So
this is not your everyday "Deprecated, but sure, keep using it" job.
Rather, it is "deprecated, and no, we wont even let you use it."

Also removed unused argument and extended AppCompatActivity.
2015-08-03 22:59:46 +10:00
Peter Serwylo
a0bf49d1ea Reinstate code to allow resumed activity to query download status (rather than wait for broadcasts). 2015-08-03 22:59:46 +10:00
Peter Serwylo
b2bde89834 Merge remote-tracking branch 'Nutomic/no-download-dialog' into integration2/mr-102-and-107 2015-08-03 22:59:38 +10:00
Hans-Christoph Steiner
b8261fcecf EXTRA_REPO_ERRORS in Intents should be a CharSequence[], not an ArrayList
This was including the instance of the ArrayList in the Intent, rather than
the expected CharSequence[].
2015-08-03 11:58:34 +02:00
Hans-Christoph Steiner
60f02c0181 in Downloader, instance vars that are set in constructor should be final 2015-08-01 21:02:39 +02:00
Hans-Christoph Steiner
5582e906c8 disable Install/Run/Uninstall button when the install process is running
To make things less confusing, this disables the main button on AppDetails
when something is running.  During install, it also changes the text of the
button to "Installing..."
2015-08-01 21:02:39 +02:00
Hans-Christoph Steiner
7d48ad736c replace Downloader's ProgressListener with local broadcasts
This removes lots of boiler plate, makes it much easier to get the info
where it is needed, and puts the code in line with rest of FDroid. The
ProgressListener pattern was forcing a lot of passing the listener
instances around through classes that never used the listener even.
2015-08-01 21:02:38 +02:00
Hans-Christoph Steiner
e984ed82ef run index update in the background after adding a new repo
That makes that repo automatically ready for use based on user actions like
adding a new repo, switching an existing repo on, etc.

This also lowers the priority of the "update" menu item since it shouldn't
be needed any more.  But leave it for now, just in case.
2015-08-01 21:02:38 +02:00
Hans-Christoph Steiner
cd0b5b80f9 purge unused methods from ApkDownloader and AsyncDownloadWrapper 2015-08-01 20:58:14 +02:00
Hans-Christoph Steiner
5d4bdf6139 all Downloaders have a URL, so make the base class store it for use
This lets the local broadcasts include the URL as an extra, and other
tricks.
2015-08-01 20:58:14 +02:00
Hans-Christoph Steiner
9a9bf92126 make all Downloaders get a Context so the base class can use those tricks
Having a Context in Downloader means that the communications can be changed
to a LocalBroadcastManager, following the pattern that is in a lot of this
app already.
2015-08-01 20:58:14 +02:00
Hans-Christoph Steiner
80063eb786 simplify Downloader constructors
Since all Downloaders are created via the DownloaderFactory, put the temp
file creation there, then we can remove lots of constructors.
2015-08-01 20:58:14 +02:00
Hans-Christoph Steiner
4fd914ac7a convert repo update dialog to a notification
Since the repo updates are happening in an IntentService, they are already
running in a separate thread.  Ironically, the dialog was showing in spite
of that.  This removes the dialog entirely and instead puts up a
Notification with the same messages.  Ultimately, the "refresh" button
should go away, the repos should be updated whenever someone goes to
install an app, and all APK downloads should also show up in the same
Notification.

This removes UpdateReceiver entirely and replaces it with local broadcasts,
since that is a common pattern in FDroid and Android.  It also reduces the
amount of code here.

refs #103 https://gitlab.com/fdroid/fdroidclient/issues/103
2015-08-01 20:58:14 +02:00
Hans-Christoph Steiner
1d263b2aee fix sending repo via NFC
This was my stupid mistake: using a String for a class, instead of a .class
so that when ManageRepo was renamed to ManageRepoActivity, this broke.
2015-08-01 20:55:37 +02:00
Hans-Christoph Steiner
46978e1086 make RepoDetails scrollable and add a QR code to the bottom
Having a QR Code of the repo makes it easy for people to share the repo to
someone else.
2015-08-01 20:55:37 +02:00
Hans-Christoph Steiner
7ea294bb66 switch RepoDetailsActivity to plain structure, purge RepoDetailsFragment
No need for a reusable Fragment here, its only used in one place.  This
changes the structure to be a regular Activity, with all View and Menu
setup in XML files loaded in onCreate().

This also converts the URL to a TextView.  Having it editable in this
Activity makes for a confusing user experience.  Instead, the "Add Repo"
input should validate the URL and not allow creating repos that don't work.

This also purges the use of UpdateService.UpdateReceiver, it will be going
away in the upcoming commits.
2015-08-01 20:55:37 +02:00
Daniel Martí
50ac03e97d Bump gradle plugin to 1.3.0 2015-07-31 17:13:42 -07:00
Daniel Martí
7f3acb215e Bundling support-v4 as a binary dep is no longer necessary 2015-07-30 20:24:25 -07:00
Daniel Martí
040c900be5 Bump to 0.95-alpha2, prepare for stable v0.95-alpha2 2015-07-30 10:28:40 -07:00
Daniel Martí
e9ce43832a Finish up changelog
* Don't imply that material design is completely finished
* Shorten changelog links item
2015-07-30 10:24:11 -07:00
Daniel Martí
4935ba5c8d Merge branch 'ensure-large-icon-urls-exist' of https://gitlab.com/pserwylo/fdroidclient 2015-07-30 10:19:49 -07:00
Peter Serwylo
92f7d5e197 Add changelog entry about changelogs. Mind blown.
Made sure to include a comment about needing to update the index
in order to get changelogs to show.
2015-07-30 21:39:59 +10:00
Peter Serwylo
4565f58a75 Clear out the etag from the repo table to "force" update.
We are not forcing an update, in the sense that we make the update
service run. Rather, we are ensuring that the next update wont return
after doing nothing, with the message "repos already up to date".
In this case, the repo metadata (and hence its etag) is the same,
but we made changes in the client to handle the metadata correctly.
Thus, we don't care that it hasn't changed, we want to update anyhow.
2015-07-30 21:06:30 +10:00
Peter Serwylo
e1a8c42f9e Ensure icon URLs are always populated when database is upgraded.
Did this by using the same query which is used to update the icon URLs
after updating the index. To make this same method accessible, without
causing sad database locking, had to expose the method from AppProvider
in a way which would let DBHelper access it. See comments in code for
further explainations.

While there, removed the final lint warning in my Android Studio for
the AppProvider. This was a warning because we could have ended up
iterating over a null object. Although it turns out there was a correct
guard in place which would ensure this didn't happen, it wasn't in such
a way that lint would understand. Thus, I changed the guard condition
around `for( String blah : CommaSeparatedList.make() ) {}` to let lint
relax and not be so pedantic.
db-version/50
2015-07-30 21:06:30 +10:00
Peter Serwylo
760eae5a7b WIP: Fixing swap UI for earlier versions of Android.
Replaced `Switch` with `SwitchCompat`. In the future, should completely remove
F-Droid's `SwitchCompat` class. Fixed paddingLeft/paddingStart, except for some
places where lint complained. Apparantly that is for some Samsung tablets on
Android-16. Will have to create a layout-v17 version in the end for these.
2015-07-29 18:49:11 +10:00
Daniel Martí
a5c65f7b30 Unused resource cleanup #2 2015-07-28 22:15:58 -07:00
Daniel Martí
6ebd24e2bb Re-run remove-unused-trans after unused resource cleanup 2015-07-28 22:08:26 -07:00
Daniel Martí
083ceca893 Remove unused resources
These went unnoticed because apparently lint.xml was omitting all unused
resources, not just default_repo.xml.
2015-07-28 22:04:45 -07:00
Daniel Martí
b152c682fa Move lint config to build.gradle
* Removed UnusedResources from default_repo.xml, since there are none of those
  warnings anymore
* Same for TrulyRandom in the whole project
2015-07-28 21:39:33 -07:00