35 Commits

Author SHA1 Message Date
Peter Serwylo
4e4d3ec3f9 WIP: More cleaning up of swap process, unbinding service, and investigating getting rid of ConnectSwapActivity. 2015-07-10 01:14:32 +10:00
Peter Serwylo
0b1e2732c2 Refactored SwapService + SwapManager into single SwapService 2015-07-09 11:43:34 +10:00
Peter Serwylo
a3af6b8b9f WIP: Serialize bonjour peers correctly. Refactor mini-service APIs.
The reference to mini-services above are not full blown Android
services. Rather, they are utility classes which can be started,
stopped, and send broadcasts about their status.

Made the list of apps to install better, with buttons for install
or upgrade, and statuses for incompatible and installed.
2015-06-30 19:04:06 +10:00
Peter Serwylo
22b072962e WIP: Don't show self in Bonjour peer list. Implement UI for peer list.
Peers are shown as proper list items now, subject to feedback from Carrie.
TODO: Need to figure out how to combine bluetooth and bonjour with same
fingerprint.
2015-06-27 10:12:26 +10:00
Peter Serwylo
30669f8058 WIP: Hooking up specific peers from the "nearby peers".
Touching the peers will prompt app selection for swap, then skip the
wifi and NFC screens, then show updating info, then a list of apps to
swap.
2015-06-26 00:13:52 +10:00
Peter Serwylo
5e9931fa03 WIP: Make bluetooth/bonjour peers parcelable.
The Bluetooth peer need only parcel up the BluetoothDevice, which
itself is parcelable. The wifi peer requires the JmDNS ServiceInfo
class to be parcelled. For this, I took the most full on looking
constructor, and parcelled up each individual property of the service
info object which is required by that constructor.

Also made the scan qr button hooked up to the swap process, and fixed
minor bugs with the "visible via wifi" TextView setup.
2015-06-24 07:16:49 +10:00
Peter Serwylo
ff93f96959 WIP: MOre ui stuff for "Start Swap" screen. 2015-06-23 22:46:52 +10:00
Peter Serwylo
0100415e3e WIP: Refactoring Bonjour from manage repos to swap.
Implementing the bare bones of a generic "peer finder" framework. This
may or may not eventuate to something which can live in its own library
and be used by other projects. Might go hand in hand with Carries idea
of having a common UI to be shared among projects.

Got Bluetooth and Bonjour kinda working, but the UI is crud,
and it doesn't remove items and ends up with duplicates. Otherwise,
on our way to a proper "nearby peers" screen.
2015-06-22 08:59:37 +10:00
Peter Serwylo
593aaf3894 WIP: I18n of start swap screen, colouring of text, add header.
Styled "send fdroid" and "qr code" buttons correctly.
2015-06-22 08:54:23 +10:00
Peter Serwylo
a48deb9160 WIP: More work on UI for initial swap screen. 2015-06-21 10:05:38 +10:00
Peter Serwylo
4a8ff47fce WIP: Implementing mockups from Carrie, added "Toolbar"
The Toolbar is the new thing from Google which acts as an ActionBar.
It is not a special view like the action bar is, it is
implemented and added to your layout the same as any view.

The InnerView classes of the swap workflow have the choice of what
colour to make the toolbar, so that they can distinguish themselves
as per the mockups (some deep blue, others bright blue).

Added icons for close, but they don't do anything yet.

Minor tweaks to layout so that it looks more like the latest mockups.
2015-06-12 22:45:55 +10:00
Peter Serwylo
0d4c61df96 WIP: Implementing UI mockup, different "selected" indicator for swap.
Using stock icons from Google Material Icons. Need to use the actual
icons provided by carrie, but will do so in the future.
2015-06-11 08:21:10 +10:00
Peter Serwylo
c6bc8b5e37 Merge branch 'material-design' into swap-demolition-material 2015-06-04 08:26:46 +10:00
Peter Serwylo
f9bcf33d50 WIP: Fixed minor UI issues.
"Confirm swap" background was white but should have been blue.

SwapWorkflowActivity now extends ActionBarActivity instead of
FragmentActivity so older devices have an action bar (though it is
not styled with blue action buttons on android-10 devices).
2015-06-03 23:55:11 +10:00
Peter Serwylo
c26c6b9e89 Removed old SwapActivity + Fragments.
All the code from the activity and the fragments has been successfully
ported to the SwapWorkflowActivity + Views. Thus, the code is no longer
useful, as it was only kept over the previous WIP commits so that it
can be referred to to help re-implement fragments with views.
2015-05-25 16:07:49 +10:00
Peter Serwylo
1b2678d6ed WIP: Applying styles correctly to views refactored from fragments. 2015-05-23 01:25:06 +10:00
Peter Serwylo
38eafdeedd WIP: Refactored wifi QR fragment into view.
As per the select apps list, there is quite a bit of business logic
in this class, which is now spread between the activity and the view.
The activity needs to handle some stuff, because the zxing library
routes intents to either an activity or a fragment.
2015-05-23 01:11:16 +10:00
Peter Serwylo
97994c5e43 WIP: Refactored NFC fragment to view. 2015-05-23 00:55:39 +10:00
Peter Serwylo
1fd6e447af WIP: Refactored join wifi fragment into view.
There is quite a lot of business logic that was moved directly from
the fragment to the view. Before this feature is complete, that logic
should either be moved into the activity, or into some sort of
associated Presenter class for the JoinWifiView.
2015-05-23 00:46:40 +10:00
Peter Serwylo
4f7f7b2cb5 WIP: Refactored select apps to swap into view.
Not worrying about styling yet, just functionality. Added an InnerView
interface that these views can implement. Currently it asks them to
populate the menu. It may be slightly inefficient if we end up with a
popup menu, because it is called onPrepareOptionsMenu, but expects the
inner view to inflate the menu. However, for swap this shouldn't be an
issue, as all the menus pretty much fit in the action bar of most screen
sizes.
2015-05-23 00:10:50 +10:00
Peter Serwylo
b6415dadb4 WIP: Refactored start swap fragment into a view.
Added a SwapWorkflowActivity to re-implement the SwapActivity.
Once all the fragments have been refactored into views, then the
SwapActivity will be removed.
2015-05-23 00:10:07 +10:00
Peter Serwylo
52c4554877 Removed localrepo classes that were used before "swap".
All of the relevant code from them has been ported across to swap,
and they are no longer needed as a reference for how to implement
app swapping.
2015-05-14 22:24:40 +10:00
Peter Serwylo
93339cbbfb Fix issue 246: Rewrite process for verifying existing repos.
Previously it would only compare the details of a new repo to existing
ones if the new repo came via an intent. Now it does it whenever you
change the text in the new repo dialog (shouldn't be too much of a
performance hit, it isn't doing very much).

The things it (still) doesn't do is:
 * verify that the url looks like a url
 * sanitize the newly input uri and compare it to sanitized saved repos

The second point means that you can end up with:
 http://10.0.1.50/ and
 http://10.0.1.50

both in the list. I'm going to log an issue for this, because it should
be fixed, but doesn't need to hold this up.
2015-05-10 21:56:40 +10:00
Peter Serwylo
b57a122ac1 Made category Spinner style correctly.
Signed-off-by: Nico Alt <nicoalt@posteo.org>
2015-05-07 22:06:01 +02:00
Hans-Christoph Steiner
571e4a18e4 move all text bits to strings.xml so they are translatable
Inline text is not translatable, it is important to heed the lint warnings
about:

Hardcoded string "Swap success!", should use @string resource
2015-04-14 18:08:03 -04:00
Daniel Martí
e3175530ed Apply a bunch of Android Studio fixes 2015-04-07 11:43:07 +02:00
Daniel Martí
81c44ef4ae Merge branch 'fix168' into 'master'
Fix #168: Not enough space for version number and license

downgrade weight from 2 to 1 and from 1 to 0

See merge request !62
2015-04-05 16:57:11 +00:00
Nico Alt
b017f35010 fix #127: Add text wrapping in application view 2015-04-04 22:30:18 +02:00
Nico Alt
d6cac24fed fix #168: Not enough space for version number and license
downgrade weight from 2 to 1 and from 1 to 0
2015-04-04 22:11:10 +02: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
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
Peter Serwylo
74b285a77f Fix Issue #5: Guess at common repo paths (/, /fdroid/repo, /repo)
When adding repositories using the Manage Repos activity, firstly look
for an /index.jar appended on the URL provided by the user. If that
doesn't work (HTTP status code other than 200) then it will try
/fdroid/repo/index.jar, then /repo/index.jar. If it can't establish a
connection to the server, or if none of the above attempts results
in a 200, then the path provided by the user is kept (even though we
have a hunch it might be wrong).

This is to cover for the case where people arn't connected to the net.
Another way to deal with no internet connectivity is provided by a
"Skip" button on the dialog while searching for the index.jar.

The searching for index.jar is done by doing a HTTP HEAD request, so
the entire jar needn't be downloaded.

Finally, to make this happen in a clean sort of way, I refactored the
ManageReposActivity a little bit to encapsulate all of the add repo
dialog handling into a subclass. This way, the outer class doesn't
need to know things like: Is the dialog showing, what state is it in,
is the background task to search for index.jar files running, how and
when to cancel that task, etc.
2015-03-14 00:44:17 +11:00
Daniel Martí
5af7cac4b7 Remove all trailing whitespaces in source files 2014-12-30 23:48:36 +01:00
Daniel Martí
06dd4c8dcb Move F-Droid project into subdir, keeping a root gradle project
Also improved .gitignore a tad
2014-12-09 15:36:07 +01:00