It is not recommended to set the width explicitly of items in a layout. This
caused some issues in DiveDetailsView, which were fixed by commit 1030cb2.
See http://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#details
Set 'Layout.preferredWidth' instead of 'width' for GpsList and Preferences
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I want a prettier visual for those, anyway, but artificially making them
shorter than that text they display seems silly - and causes the text to be
trunkated for no good reason on some devices.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
- 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>
- 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>
- 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>
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>
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>
Small error was introduced in commit 25aa80846b. 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>
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>
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>
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>
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>
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>
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>
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>
- 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>
- 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>
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>
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>
- 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>
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>
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>
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>
This isn't quite perfect yet. If it takes too long to get the GPS fix (i.e., if
you save it before you get the fix), this will simply fail and not store a
position. But in normal conditions (you check the box, you edit the data, you
save), especially when outside on a dive boat, this should work fine.
For the other cases we need to implement some kind of callback to still collect
the data.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Same context menu idea. The reason for adding this is that the context menu
always acts on the last page in the stack (so I guess the "right-most-one"). So
if you edit a dive and then open the log, you can't save the dive until the
dive edit is the last page which means you have to close the log, first. Not
ideal, but better than nothing and it works well enough. I still think we might
want to go back to a traditional "Save" button...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The automagic update gets disabled once we overwrite the text with "Save" at
some point, so instead we appear to have to do this manually.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting closer to being able to really edit / add dives in the mobile UI.
This works for manually added dives - needs a bit more thought for dives
downloaded from dive computers as we don't necessarily want to change the
maxdepth in conflict with the samples.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This way the properties of the shown list element are updated based on what was
edited. This feels weird and backwards - but it appears to be the way to do
this - you literally update the elemnts in this specific instance of that QML
page.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The code is rather inconsistent when it comes to the use of semicolons in the
JS code. Let's try to not have them...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Don't use EmailCharactersOnly input method hint for the password. This fixes
the problem of password being displayed on entry, at least on my device.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>