182 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Felix Ableitner
8c25134031 Replaced download dialog with embedded progress bar (fixes #270). 2015-07-27 13:04:42 +02:00
Peter Serwylo
0e5c039536 Merge branch 'master' into new-swap
Fixed lots of (minor) conflicts. Some due to earlier rebasing of
material stuff that was subsequently merged into master with a
different commit hash (I guess, that's what it looked like anyway).
2015-07-27 18:42:16 +10:00
Peter Serwylo
c57f7105e1 Attempt to show "Setting up [wifi/bluetooth]..." in UI.
Not sure it is working as intended yet, but the idea should be close to what is required.
2015-07-27 17:21:21 +10:00
Peter Serwylo
9180c9f5c0 WIP: Bluetooth can actually transfer indexes and apks over HTTPish!
It is very hacky, and I did it through the non-swap interface, and it
only works once then the state stuffs up and it no longer accepts incomming
connections, but it worked! Now to smooth out all the things.
2015-07-26 07:44:12 +10:00
relan
8f2c827280 Fix padding in dialogs
Padding around content area should be 24dp. See the Material Design spec:

	http://www.google.com/design/spec/components/dialogs.html#dialogs-specs
2015-07-23 09:47:27 +03:00
relan
28ba6921d1 Tint links
Apply the accent color to links.
2015-07-23 09:46:33 +03:00
relan
0b7c5fb616 Tint preference dialogs
Apply the accent color to EditTextPreference and ListPreference. They
use android.app.AlertDialog.Builder, not
android.support.v7.app.AlertDialog.Builder, so the theme has to be
specified using "android:alertDialogTheme" attribute in addition to
AppCompat's "alertDialogTheme". For the same reason those dialogs won't
be tinted on pre-Lollipop Android versions.
2015-07-23 09:41:37 +03:00
relan
04e8b591ab Tint alert dialogs
Apply the accent color to alert dialog buttons. Note that without
"android:windowMinWidthMajor" and "android:windowMinWidthMinor" attributes
dialog width is calculated incorrectly resulting in visual artifacts.
2015-07-23 09:19:20 +03:00
relan
bcb3ac1fe0 Fix identical bitmaps across various configurations
No need to put mdpi images into drawable/ directory since F-Droid does not
support Android 1.5. This fixes appropriate warning from lint.
2015-07-19 19:34:25 +03:00
Peter Serwylo
240bcce445 Remove bonjour preference. Separate bluetooth and wifi more clearly.
Before, you could "Enable swapping" without specifying which type
of protocol to enable. Now, the two switches are clearly delimited
between bluetooth and wifi.
2015-07-18 01:48:56 +10:00
Peter Serwylo
4f4310c0ca Clean up after merging swap stuff. 2015-07-18 00:08:25 +10:00
relan
6ddd1571c7 Change repositories icon
Use ic_toc_white instead of ic_view_headline_white. The latter often used
to show navigation drawer and thus may be confusing.
2015-07-17 15:43:42 +03:00
relan
f0f0bd09d3 Reuse existing refresh icon
Use Material-style icon instead of the old Holo-style one.
2015-07-17 09:20:47 +03:00
relan
cc43561bf2 Reduce action bar icons size from 48dp to 24dp
From the Material Design spec:

> DP unit grid

> System icons are displayed at 24dp.

See http://www.google.com/design/spec/style/icons.html#icons-system-icons

Script used to update the icons:

    function download {
        F-Droid/tools/download-material-icon.sh F-Droid/res $1 $2
    }

    download content add
    download device bluetooth
    download action delete
    download notification do_not_disturb
    download image edit
    download action help
    download device nfc
    download av play_arrow
    download navigation refresh
    download action search
    download action settings
    download social share
    download action view_headline
2015-07-17 08:34:32 +03:00
Peter Serwylo
0a373de7a4 Merge branch 'nathan-bluetooth-swap' into nearby-peers-with-bluetooth 2015-07-15 17:42:03 +10:00
n8fr8
c53df989b8 small UI clean-up of header display 2015-07-13 16:05:00 -04:00
n8fr8
d662c15fb8 list background should be white 2015-07-13 14:40:22 -04:00
Hans-Christoph Steiner
675151b4ef rename string status_processing_xml to prevent crashes on old translations
Thanks to @mvdan for catching that.  Turns out Java's String formatting is
not as tolerant as C's printf().  Java crashes when the format is wrong,
while C just ignores extras.
2015-07-13 10:32:08 -07:00
Hans-Christoph Steiner
64d709c142 create ProgressBufferedInputStream to get progress info while parsing XML
Might as well tap into the stream to get the byte counts, that's best
progress info I can think of when parsing a file.

This is a step towards a single progress bar for the whole process, instead
of showing one progress for downloading, another for parsing XML, then a
third for processing the new app info.
2015-07-13 10:32:08 -07:00
Peter Serwylo
a8dedd8ac2 Removed SwapAppListActivity, implemented UI mockup for swap app list.
Still need to hook up the buttons in the app list, but this change
shows the correct status and/or buttons for installable/upgradable/
incompatible/installed apps in the swap list. This change also hooks
up UIL to download icons for apps and thus display them in the list.
2015-07-13 22:52:51 +10:00
Peter Serwylo
f236dc3d3e Removed ConnectSwapActivity, refactored into SwapWorkflowActivity.
Involved creating another view/state for which the swap workflow can
be in. It is not explicitly stated by setting the state of the SwapService,
as is the case with other views. Rather, it is inferred based on the
presence of a `NewRepoConfig` crafted from the incoming intent in
`onResume()`.

Also gave me an idea of how to move more logic out of individual views,
and into the SwapWorkflowActivity. That is, inflateInnerView should
return the inflated view, to be cast into the specific subclass. From
there, the activity can call methods directly on the view to set it
up, rather than having the view do that stuff itself. In the future,
may consider doing this with other views too.
2015-07-12 23:18:09 +10:00
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
relan
c6a2b1174e Apply new UI colors
Action bar color is Blue 700.
Status bar color is Blue 900.
Accent color is not from Material Design palette.

See https://www.google.com/design/spec/style/color.html for color values.
2015-07-04 21:32:38 +03:00
relan
db3e8a62c4 Update raster icons
Script used to generate raster icons:

    function rasterize_icon {
        inkscape media/fdroid-logo-2015/$1.svg -e F-Droid/res/drawable-$4/$2.png -w $3 -h $3
    }

    function rasterize {
        rasterize_icon $2 $3 $(( 18 * $1 )) ldpi
        rasterize_icon $2 $3 $(( 24 * $1 )) mdpi
        rasterize_icon $2 $3 $(( 36 * $1 )) hdpi
        rasterize_icon $2 $3 $(( 48 * $1 )) xhdpi
        rasterize_icon $2 $3 $(( 72 * $1 )) xxhdpi
        rasterize_icon $2 $3 $(( 96 * $1 )) xxxhdpi
    }

    rasterize 2 fdroid-logo ic_launcher
    rasterize 2 default-app ic_repo_app_default
    rasterize 1 default_notification ic_stat_notify
    rasterize 1 updates_notification ic_stat_notify_updates
2015-07-04 21:29:16 +03:00
Daniel Martí
618b1096f3 Remove partial arrays to fix theme selection crashes 2015-06-30 10:22:05 -07: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
a30ec646b2 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.
2015-06-22 08:55:46 +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
Daniel Martí
515ca01d38 Replace all occurences of FDroid with F-Droid
Except FDroid.apk, since that is actually its name. Thanks to @SylvieLorxu for
spotting.
2015-06-21 13:48:10 +02:00
Peter Serwylo
a48deb9160 WIP: More work on UI for initial swap screen. 2015-06-21 10:05:38 +10:00