2353 Commits

Author SHA1 Message Date
Daniel Martí
7f3db513e5 Don't mention automatic app updates, closes #280
This feature is not yet implemented. The new sentence is more generic and
doesn't get us into trouble.
2015-06-17 12:08:24 +02:00
rober
5bb3721b3a fix link icons 2015-06-16 20:15:01 +02:00
Android Build System
41b0d0fa7e symlink build dir into out 2015-06-16 20:05:55 +02:00
Daniel Martí
7e0f4bbc0e We bumped minSdk to 8, so TargetApi(8) can go 2015-06-16 17:22:57 +02:00
Peter Serwylo
b0b285bc1f Merge branch 'swap/bluetooth' into swap-demolition-material-mockups 2015-06-17 00:41:37 +10:00
Nico Alt
8bb4d9012f delete case in switch for deleted theme 2015-06-15 21:19:15 +02:00
Peter Serwylo
a345788dba Added material icons from CC licensed "Google material icons" set.
Fixes #240.

To make this easier, I added a script to aid in downloading icons.
Checkout F-Droid/tools/download-material-icon.sh for more details.

The icons are licensed under the CCv4 attribution license, which I
added a shout out to under "License" in the README.md.
2015-06-15 21:19:14 +02:00
Peter Serwylo
71605e98dc Made swap button text white. 2015-06-15 21:19:14 +02:00
Peter Serwylo
a50efda113 Updated support libraries to 22.1.0 2015-06-15 21:19:14 +02:00
Peter Serwylo
6452d2da96 More colours beyond colorPrimary.
Signed-off-by: Nico Alt <nicoalt@posteo.org>
2015-06-15 21:19:14 +02:00
Peter Serwylo
d94e8a4ad2 Made category Spinner style correctly.
Signed-off-by: Nico Alt <nicoalt@posteo.org>
2015-06-15 21:19:14 +02:00
Nico Alt
03c5a224de fix #91: Material Design
- use 'com.android.support:appcompat-v7:22.0.0' instead of version 20.0.0
- ActionBar color: "F-Droid Blue" (also option for "F-Droid Green")
- fix invisible swap button with Material Design
- remove "Light + dark action bar" theme (as of Action Bar is always blue/green)
2015-06-15 21:19:14 +02:00
Peter Serwylo
d6aa60b211 Updated changelog after two merge requests merged. 2015-06-15 22:20:16 +10:00
Daniel Martí
a2fac20e6b Bump to 0.93-test 0.93-test 2015-06-15 13:21:04 +02:00
Peter Serwylo
78b5f489ef Merge branch 'fix-263/explicitly-add-swap-repo' into 'master'
Fix #263 "cannot manually add repo that was swapped before"

Pretends that the swap repo never existed, by deleting it before adding
the new repo, and showing the same message that is shown when a new
repo is added. This does not change behaviour for existing non-swap
repos. They are not deleted before being added again, or else we would
lose the ability to verify the fingerprint of an existing repo is the
same as a newly added one with the same URL.

Note that this has the effect that the fingerprint/pubkey of the swap
repo is nuked when adding that repo manually.

Internationalised the string "BAD FINGERPRINT" while I was at it.

To test it out, here is some instructions to make life easier:

Firstly, go into manage repos and delete the guardian project main repo (going to pretend to use this for swapping to make life easier).

Then if you run `sqlite3 /data/data/org.fdroid.fdroid/databases/fdroid` and execute the query:

`select substr(fingerprint, 0, 10), substr(pubkey, 70, 10), address, isSwap from fdroid_repo order by fingerprint desc;`

You should see:

```
B7C2EEFD8|081ad310b3|https://guardianproject.info/fdroid/archive|0
43238D512|071310b300|https://f-droid.org/archive|0
43238D512|071310b300|https://f-droid.org/repo/|0
```

Now simulate a swap session like so:

```
adb shell am start -a android.intent.action.VIEW -d 'https://guardianproject.info/fdroid/repo?swap=1'
```

Which results in the following database:

```
B7C2EEFD8|081ad310b3|https://guardianproject.info/fdroid/archive|0
B7C2EEFD8|081ad310b3|https://guardianproject.info/fdroid/repo|1
43238D512|071310b300|https://f-droid.org/archive|0
43238D512|071310b300|https://f-droid.org/repo/|0
```

Note the last column (`isSwap`) is `1` for the newly added swap repo. Now we will add the repo (without a fingerprint) to the Manage Repo activity. If you are feeling lazy, execute:

```
adb shell am start -a android.intent.action.VIEW -d https://guardianproject.info/fdroid/repo
```

The repo will be removed, then re-added as a TOFU repo:

```
B7C2EEFD8|081ad310b3|https://guardianproject.info/fdroid/archive|0
43238D512|071310b300|https://f-droid.org/archive|0
43238D512|071310b300|https://f-droid.org/repo/|0
||https://guardianproject.info/fdroid/repo/|0
```

I noticed some bugginess with sending the same intent and it being ignored, I'll have to look at this another day (not caused by this change, it already existed in master).

See merge request !90
2015-06-15 09:33:06 +00:00
Peter Serwylo
435fc27e31 Merge branch 'fix-267/nfc-swap' into 'master'
NFC swap now goes to confirm swap, not manage repos activity.

The NFC message now is handled by the FDroid activity, so it is treated
the same way as every other incoming repo URL. Because FDroid handles
incoming intents correctly, the NFC one just magically works when
the <intent-filter> is moved from ManageReposAcivity to FDroid without
further code changes.

The other change is that the two way swap only happens when both are
actually swapping. Otherwise, we will send a request for someone to
swap with us, when we are incapable of swapping with them.

Fixes #267.

See merge request !91
2015-06-15 09:28:24 +00:00
Daniel Martí
3fa5a51600 No need for TabInfo struct in TabsAdapter 2015-06-15 01:38:52 +02:00
Daniel Martí
4084cd5260 Remove redundant constructor call 2015-06-15 01:38:43 +02:00
Daniel Martí
3aa8bf4ea0 Apply some android studio fixes 2015-06-15 01:38:21 +02:00
Daniel Martí
93973131f7 Start changelog for next release 2015-06-14 19:46:41 +02:00
Daniel Martí
62f9c84252 Merge branch 'fdroid-system-install' 2015-06-14 18:15:19 +02:00
Nico Alt
e92be5322d update icons
- icons for dogecoin and litecoin
- updated icons for website, bitcoin, donate, flattr and issues

Thanks to xphnx (https://gitlab.com/xphnx)
2015-06-14 14:57:15 +02: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
Daniel Martí
4895e2d790 Fix large icons by caching two icon urls per app in the DB db-version/49 2015-06-10 15:48:57 +02:00
Nico Alt
f0c00c144c Add support for changelog links db-version/48 2015-06-10 15:48:50 +02:00
Nico Alt
a653b0156a improve AppDetails
- App icon is now 72dp x 72dp
- Description is expandable
- License, categories, Website, Source Code, Issues and Donate (#232) are moved from header to summary
- Buttons to install, update and run are moved from action bar to header
- Permissions are expandable and always shown
- Add myself to copyright holders of "F-Droid/res/layout/app_details_header.xml", "F-Droid/res/layout/app_details_summary.xml" and
"F-Droid/src/org/fdroid/fdroid/AppDetails.java"
2015-06-10 15:48:11 +02:00
Daniel Martí
ee6daf356b Bump all bundled repo versions to 13 2015-06-10 15:48:02 +02:00
Daniel Martí
5f27b65a92 Remove duplicate ICON_URL values.put() line 2015-06-08 23:53:51 +02:00
Daniel Martí
ab7067f247 Also bundle repo versions in the client
Without them, some features like proper density icons only worked after the
first update, but not on the first index update itself since the version
defaulted to 0.
2015-06-08 23:53:07 +02:00
Daniel Martí
3b962b7546 Bump to 0.92 with changelog 0.92 2015-06-08 17:06:27 +02:00
Dominik Schürmann
2e6984bfbe Use new icon for install into system notifications 2015-06-08 16:34:04 +02: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
d9f91da9a6 WIP: Added logging, removed dead code, fixed minor bugs.
Logging to help understand when the service is started, stopped,
restarted, and when individual components (e.g. web server, bonjour)
are started/stopped.

Fixed bug where service was moved to foreground during "restartIfEnabled"
because that is unneccesary if it is already in the foreground.
2015-06-03 23:41:51 +10:00
Peter Serwylo
2553b8520c WIP: Move swap starting/stopping to async task.
There is now a private [en|dis]ableSwappingSynchronous() method, to go
along with the public [en|dis]ableSwapping() method. The public method
knows about not spinning up tasks if already enabled, and also about
pushing the invocation to a background task. The private method just
blindly does what it is asked, without checking if it should be done,
and without running on a background task.

The same goes for the restartIfEnabled() method, it is responsible for
creating a single background task which runs in order: disable, and
then enable. This is actually the reason for having the synchronous
methods, rather than having, e.g., the public [en|dis]ableSwapping()
method know about threads. If that was the case, then restarting would
consist of starting, waiting for some form of notification that the
background task has completed, and then scheduling the enable task.
Now, it is a matter of calling both *SwappingSynchronous methods in
succession.
2015-06-03 17:55:36 +10:00
Peter Serwylo
7c9492e6b4 WIP: Refactoring swap service.
Removed LocalRepoService, replaced with SwapService.

Still TODO:
  Manage threads. Currently everything is called from the
  UI thread, which is a regression from the previous behaviour.
  I'd like to manage this so that the code interacting with the
  SwapManager doesn't need to bother itself with whether it is calling
  from the UI thread or not.

The local repo service had many different methods and properties for
dealing with starting and stopping various things (webserver, bonjour,
in the future it will also need to know about bluetooth and Wifi AP).

The SwapService handles this stuff by delegating to specific classes
that are only responsible for one of these. Hopefully this will make
the process of enabling and disabling swap repos easier to reason
about.

The local repo service was also stopped and started quite regularly.
This meant it was up to the code making use of the service to know if
it was running or not, and to enable it if required.
The new SwapService is only started once (when the singleton
SwapManager is created for the first time). It should not use any more
resources, because it is a background service most the time, and it
is responsible for moving itself to the foreground when required (the
burden is not on the code consuming this service to know when to do
this).

By having the service running more often, it doesn't need to'
continually figure out if it  needs to register or unregister listeners
for various properties (e.g. https enabled) or wifi broadcasts. The
listeners can stay active, and do nothing once notified if swapping is
not enabled.

Moved the timeout timer (which cancels the swap service after 15 mins)
into the SwapService, rather than being managed by the
SwapWorkflowActivity. Seems more appropriate for the service to know to
time itself out rather than the Activity, seeing as the Activity can
die and get GC'ed while the service is still running.

Finally, although there is nothing stopping code in F-Droid from
talking to the service directly, it is now handled by the SwapManager
singleton. This means that details such as using a Messenger or Handler
object in order to communicate via arg1 and arg2 is no longer required,
and instead methods with proper type signatures can be used. This is
similar (but not exactly the same) to how Android system services work.
That is, ask for a "Manager" object using getSystemService(), and then
use that to perform functionality and query state via that object,
which delegates to the service. Then we get the best of both worlds:

 * Reasonable and type safe method signatures
 * Services that are not tied to activity lifecycles, which persist
   beyond the closing of the swap activity.
2015-06-02 00:18:37 +10:00
Daniel Martí
9795b31b69 Add missing language code for Sardinian in the settings
Closes #272
2015-05-30 12:19:39 +02:00
Daniel Martí
578a98250b Add script to detect missing language codes in the settings
This will prevent future issues like #272
2015-05-30 12:19:25 +02:00
Daniel Martí
38ab8ac353 Don't add count=-1 to bytesRead when finished 2015-05-30 00:51:35 +02:00
Daniel Martí
29403c1d84 Use KiB for progress in apk downloads
Quick improvement for #270, but a proper solution would be more complex to
also do MiB when appropriate. It would probably involve a modified
ProgressDialog.
2015-05-29 23:39:28 +02:00
Daniel Martí
d70fd02178 Hide more debug logs from release builds 2015-05-29 17:00:08 +02:00
Daniel Martí
02ed2293e6 Make "failed" log messages be warnings, not debugs 2015-05-29 16:59:40 +02:00
Daniel Martí
35f9900101 Update UIL to 1.9.4 2015-05-29 12:34:02 +02:00
Peter Serwylo
0e16eae5bc Minor fixes to swap after refactor.
List views need to have their header view set _before_ an adapter is
assigned to them.

Was incorrectly passing an application context instead of an Activity
context to the progress dialog for swap.

Extend ActionBarActivity rather than FragmentActivity.

Don't persist swap workflow state to disk, only store it in the
singleton.
2015-05-28 23:34:03 +10:00
Peter Serwylo
ea61e8f2d3 Organised SwapState class, moved methods around to make more sense.
Put all of the step handling code in one place, added some comments to
make sense of the different parts of the claass and their
responsibilities.
2015-05-25 16:20:56 +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
f325e9d057 WIP: Moved start/stop local repo code from static FDroidApp to SwapState
Didn't change any behaviour, but wanted to start unifying swap state
management in one location.
2015-05-25 08:39:31 +10:00
Peter Serwylo
68c6648da5 WIP: Store selected apps in SwapState. Handle back presses for swap.
Currently the view to show after pressing the back button is defined
by individual InnerView classes. For example, the JoinWifiView always
says its previous step is the SelectAppsView. This works for the most
part, but doesn't work for:

 * The first StartSwapView class (instead handled by a special case in
   the Activity).

 * WifiQrView which could either be going back to the NfcView or the
   JoinWifiView, depending on a few cases, which the WifiQrView probably
   shouldn't care about.
2015-05-25 08:17:09 +10:00
Peter Serwylo
38059ec324 WIP: Initial state handling for swap process.
The state is saved to a preference file, but that is abstracted from
the SwapWorkflowActivity. It interacts with a SwapState object, which
is relatively safe in that you should not be able to save it into an
invalid state.

Note: At this point it is not tied to any service. I'm not sure it will
ever have to be either, as the service needs to persist state somewhere
anyway, so that will probably also end up saving to a preferences file
too.
2015-05-23 13:17:33 +10:00