In the future, this should be implemented with a relevant help screen,
but for now it is more than we have time for. It will require, not only
good content which is translatable, but also a generic approach so that
it can be used elsewhere in F-Droid too.
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.
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.
Two views weren't hidden by default, so they were taking up space before they
were needed. The java code already takes care of showing them when necessary.
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.
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.
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).
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.
Before, you could "Enable swapping" without specifying which type
of protocol to enable. Now, the two switches are clearly delimited
between bluetooth and wifi.
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.
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.
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.
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.
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.
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.
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.
- 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"
"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).
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.