aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
AgeCommit message (Collapse)Author
2016-01-19Subsurface-mobile on Android: change the splash screen methodologyGravatar Dirk Hohndel
This is based on post by Ben Laud https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af It creates a theme that uses a splash drawable that Android will show immediately when the application is launched. And then starts the QML application with visibility set to false adn only makes it visible (and replace the splash screen) once initialization is finished. We still get a little flicker with the switch from splash to start page to dive list, but over all the experience is hugely improved. And the bug that the splash screen stays around when starting Subsurface-mobile in landscape also appears to be fixed. Fixes #994 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19Close edit drawer when current dive changesGravatar Sebastian Kügler
This prevents having the edit drawer opened at a different than the current dive. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-19QML UI DiveDetailsView: shift dive number to right of top rowGravatar Rick Walsh
In dive details view, shifting the dive number to the right of the top row means it won't be cut short if the dive duration is 1 hr or longer Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-18QML UI: yet another attempt to fix the profile scalingGravatar Dirk Hohndel
This one appears to work in my testing so far. And reading the code it seems to make sense. We look at the size that the widget thinks it is. And we scale the scene to fill that size (including a margin). And then let Qt and QML deal with the rest of it. Assuming this works it shows that we have been trying too hard all this time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-15QML UI: next attempt to address the profile scalingGravatar Dirk Hohndel
It seems to be much more logical to address the size and scale right before rendering. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13try to fix profile scalingGravatar Sebastian Kügler
Different approach here: - profile gets a bit higher, this was requested on the mailinglist, and seems to behave much better with the painted profile, we'd otherwise get it magically clipped on the right hand side. - Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I haven't been able to test it properly on other devices, so this needs some more testing. The result is visually quite close to what we can do, although I'm still getting a somewhat larger margin on the right. To get at the devicePixelRatio without too much custom code, I've added a property to the QMLProfile to retrieve it from the theme engine. Signed-off-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13fix misrendered profiles when fast-flickingGravatar Sebastian Kügler
- Apparently, QMLProfile doesn't like being painted without being visible, when flicking quickly through the dives I would get empty rendered profiles. Setting the cachebuffer to zero fixes it, and saves some memory. It still has some unfortunate timing, the profile gets rendered mid-flick, which leads to a delay in the flicking motion, quite annoying. We will have to somehow make sure that new profiles are rendered after flicking, not during - Smallish cleanups Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12Better behavior for dive details flickingGravatar Sebastian Kügler
- stop at bounds, this is in line with other flickables. I really don't like Flickables floppy default behavior to allow dragging and scrolling over the bounds. Signed-off-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12Fix bugs in edit drawerGravatar Sebastian Kügler
- As the list may get reset on save, the dive_id effectively changes since currentItem isn't updated. So after editing, we end up with a different currentItem than visible. This is very unintuitive, but has to do with the model resetting. It would result in the edit view not showing the current dive when opened the second time. Let's make sure that out currentItem is always the visible one before we're filling the data into the edit page. - Close the drawer when we're navigating away from the dive item, for example when hitting the back button. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12Kill warningGravatar Sebastian Kügler
Apparently parent.height is negative sometimes. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-12dive details navigationGravatar Sebastian Kügler
This patch reworks the navigation of the dive details. - The detailsview is now a list view with page-sized delegates. This allows horizontal swiping to the next and previous dive. - The central button now allows to open the edit mode for the dive. Original patch was done by Marco Martin, but needed to be reapplied by hand. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-11Random whitespace cleanupGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10QML UI: Store the dive duration in dive and (fake) divecomputerGravatar Dirk Hohndel
This is needed so that our heuristics for fixing up dives don't mess up the data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10QML UI: only store the new date/time if they are validGravatar Dirk Hohndel
Otherwise we are overwriting valid data with midnight, Jan 1, 1970. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10QML UI: show dive time againGravatar Dirk Hohndel
In commit 25aa80846b ("Move Dive class from qthelper.h/cpp to it's own file") the meaning of getting the "date" of a dive was changed to just be the date and not the date and time. That's not what the QML code expected. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10Save a dive has to mean "save to local storage" on mobileGravatar Dirk Hohndel
While it makes sense to have the concept of "what's in memory" and "what's on disk" in a desktop application, on a mobile device that seems like the wrong approach. If the user edits a dive and taps on "save", they reasonably expect this to be saved to storage (so our local cache of the remote git repository). And "Upload to cloud" then pushes the data to the cloud server. It may even be reasonable to do that automagically, but that I'm not so sure about. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10Remember in settings if we ever synced with the cloudGravatar Dirk Hohndel
Otherwise, if the device is offline we would not be able to store changes in the local cache, completely defeating the purpose. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10QML UI: refresh divelist after GPS data was successfully appliedGravatar Dirk Hohndel
And create a helper to do so to make the code simpler. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-10show dive.number instead of double locationGravatar Jan Mulder
Small error was introduced in commit 25aa80846b84c. The dive.location was shown in the DiveList instead of the intended dive.number Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08QML UI: partial, slow and incomplete implementation of delete GPS fixGravatar Dirk Hohndel
This only deletes the fix on the mobile device, not on the server. And it is really really slow. Re-reading the data from the settings just isn't a smart way to do this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08QML UI: add second action to GPS list entriesGravatar Dirk Hohndel
This one will allow people to see the location on a map. Also not implemented, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08QML UI: better icon for deleteGravatar Dirk Hohndel
The cancel picture was odd - the trash can is much more typical. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08Gps list: include the time_t timestamp in the modelGravatar Dirk Hohndel
Just having the string means we lost the unique value that we can use as key to indentify a specific GPS fix. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08QML UI: support sliding action to allow the user to delete GPS fixesGravatar Dirk Hohndel
This is just the UI, the actual deletion is not yet implemented. I really like this interaction with the list items. Slide them to the left and you see icons for actions. Right now we have just one and that may seem like overkill (hey, we could just have the delete icon instead of the application menu icon, right?) but once we allow the ability to show the GPS location on a map we'll have two operations and this will make more sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08Move Dive class from qthelper.h/cpp to it's own fileGravatar Tomaz Canabrava
and rename it to DiveObjectHelper, since it should be an QObject based class to make it easier on the QML, grantlee and widgets side to display the dive's internal data. each Q_PROPERTY defined in the DiveObjectHelper.h file can be acessed directly via it's name. So, if you are on a model that returns a dive, acess it's name by dive.name Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08Untangle Library LinkageGravatar Tomaz Canabrava
with the adittion of gpslistmodel/location, the libraries qt-models had a direct dependency on subsurface-core, and subsurface-core had a direct dependency on qt-models, this is bad. Moving a bit of code around I'v managed to clean this out, and also to clear a bit of uneeded code (GpsTracker and gpsTracker where basically the same thing.) Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07mobile: allow save when local store is actualGravatar Jan Mulder
When starting ssrf-mobile, and the local divelist is identical to the cloud version (so same sha1), a save of local modifications to the cloud should be possible. This fix enables this by pretending that a suppressed load from cloud on start is still a valid load from cloud. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07QML UI: clean up notes field after editGravatar Dirk Hohndel
We don't want any of the rich text markup to sneak into our fields. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07QML UI: fix manual add diveGravatar Dirk Hohndel
This had been broken by mistake in commit e5f95daee8 ("QML UI: reimplement context menu for dive details"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07QML UI: show the available GPS fixesGravatar Dirk Hohndel
So far the user can't interact with these. We should implement an ability to visualize the GPS fix and to delete it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07QML UI: trigger download of GPS fixesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07Remove plasma mobile components, pull from upstream at build timeGravatar Dirk Hohndel
This prevents us from constantly having to worry about keeping them in sync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06QML UI: edit notes in rich text modeGravatar Dirk Hohndel
This way we don't show <br> for line breaks. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06QML UI: use the same units that Subsurface used when saving the dataGravatar Dirk Hohndel
We already keep those units around so the backend HTML exporter can match them. So it makes perfect sense to also apply them in the mobile app. Fixes #987 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06QML UI: reimplement context menu for dive detailsGravatar Dirk Hohndel
With the mobile components fixed we can now simply switch between different menu content - no need to play games and redefine the actions on the fly. This also adds a cancel button for editing and cleans up when the user hits cancel. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06Make sure that members are initialiedGravatar Dirk Hohndel
A couple of members could potentially have been used uninitialized - it's possible that this was the cause for people overwriting data in cloud storage with empty dive lists. See #985 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-07sync with mobilecomponents 462b2b4Gravatar Sebastian Kügler
- Fixes blank pages when keyboard shows up, the margin computation was wrong, and apparently we get bogus info about the keyboard geometry. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-07sync with mobilecomponents 9d179eb74a227Gravatar Sebastian Kügler
- Workaround for black squares is merged upstream - brings back the FAB button, additional - swipe interaction improvements in the same Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-05QML UI: when manually adding a dive clear out all the fieldsGravatar Dirk Hohndel
Otherwise the data from the last dive dispayed (or added) will be shown. Fixes #983 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05QML UI: refresh the dive list after editGravatar Dirk Hohndel
This fixes two issues. In general, after edits the dive list wasn't updated so it showed data inconsistent with what the dive details showed (clearly bogus). Even more annoyingly, when we change the date or time of a dive it could obviously move around in the dive list. So we need to resort the dive table and recreate the dive list. For really long dive lists this is possibly overkill, but in my testing this seemed very quick and much easier than trying to manually get this right, even in the case where the list wasn't resorted. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05QML UI: allow edit of dive date and timeGravatar Dirk Hohndel
This is a bit more complicated because we are asking the user to edit the text field instead of giving them a date and time picker. This is not a great choice, but let's run with it for now. One downside is that the user is likely going to edit the date "Oct 29" -> "Oct 25" without adjusting the day of the week. And if we then try to parse that Qt correctly complains about an invalid date. So we hack around this by removing the day of the week from both the format and the date entered (which of course now will break things if the user did, in fact, adjust the day of the week). As I said, not a great solution. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05QML UI: in dive details edit, put date on its own lineGravatar Dirk Hohndel
This way we can support a simple way for the user to edit the date. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-05Add BasicListItem.qml from plasma-mobileGravatar Dirk Hohndel
Sebastian forgot to add this file - so I grabbed the latest version from today, hoping this is the right one. This is from a85365111 which is the sha he referenced in his patch. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-06adjustments needed for latest mobilecomponentsGravatar Sebastian Kügler
- flickable is gone, Page now just takes the children items, meaning we can remove this assignment - BasicListItem is factored out, and we now need it in our qrc Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-06sync with mobilecomponents a85365111 + patchesGravatar Sebastian Kügler
This is the latest state of the upstream art from Plasma, plus our patches to disable the gamma effect on the icon, and the drawer removed. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-06Allow faster scrolling in the dive listGravatar Sebastian Kügler
This increases the rather conservative value for the maximum velocity of the divelist to scroll at max 5 screens per second, meaning it's about 4 times faster. I've picked this value after a bit of testing, it can surely be tweaked, but feels nicer already. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2016-01-04QML UI: make top bar elements bigger for easier useGravatar Dirk Hohndel
Otherwise hitting those menu buttons is HARD. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04Cloud storage: fix potential crash when avoiding reloading dive listGravatar Dirk Hohndel
If we loaded the dive list from cache and then try to figure out if the remote repository had anything different, we were being super stupid if the SHA was identical... we had already cleared the dive list by the time we decided that we didn't need to load things. Granted, the model was still populated (oops), but the backend data structure was cleared and accesses to it (e.g., when drawing the profile) would cause things to crash. The helper function duplicates some code, but trying to not duplicate the code made things even harder to read. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04QML UI: hide action buttonGravatar Dirk Hohndel
So far this just comments out the code that enables the action button. Let's see feedback from the testers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-04QML UI: add context menu buttonGravatar Dirk Hohndel
Right now this is an alternative to the magic action button - but the goal is to replace it completely. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>