maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Gym Logbook - Some programming help needed (https://talk.maemo.org/showthread.php?t=94528)

micko 2015-01-28 14:29

Gym Logbook - Some programming help needed
 
I have this project: https://openrepos.net/content/mickol/gym-logbook

Source in https://bitbucket.org/mikko_laine/gym-logbook

There are several problems to solve before I'll try to submit this to Jolla Store. Can anyone help?

1. Adding a new Workout routine with NewWorkout.qml. The page has a TextArea and a TextField and below those SilicaListView with variable number of TextAreas. I'd like to be able to scroll the whole Dialog, but now it only scrolls the ListView. Here's some screenshots to illustrate why that is a problem:
https://www.flickr.com/photos/96700120@N06/16200881370/
https://www.flickr.com/photos/96700120@N06/16387367572/
https://www.flickr.com/photos/96700120@N06/16202383987/

Direct link to file in question: https://bitbucket.org/mikko_laine/gy....qml?at=master

I've got some other problems as well, but I'll post them later. Now my two year old requests attention.

micko 2015-02-02 16:55

Re: Gym Logbook - Some programming help needed
 
More questions to follow...

I'm trying to replicate SilicaListView's section headers from componentgallery's FormatterPage.qml

I have a ListModel "routine" created after database with

routine.append({"wid": r.wid, "day": r.day, "eid": r.eid, "exercise": r.name, "info": r.info, "exercisetable": r.exercisetable});

So there is an item called "day". It's a string containing name of the training day. There are maybe 2-4 different days and the ListModel is sorted by item "day".

Then I have SilicaListView with
Code:

section {
    property: 'day'
    delegate: SectionHeader {
        text: day
        height: Theme.itemSizeSmall
    }
}

For some reason that doesn't work. Placeholders for section header are created and if I say text: "foo", there will be "foo" in all correct places. However trying to read the text from model I get error

[W] unknown:43 - file:///opt/sdk/gymlogbook/usr/share/gymlogbook/qml/pages/ShowWorkout.qml:43: ReferenceError: day is not defined

All code is in Bitbucket and the file in question is https://bitbucket.org/mikko_laine/gy....qml?at=master

m4r0v3r 2015-02-02 21:35

Re: Gym Logbook - Some programming help needed
 
as a gym goer can I provide some feedback on how it should be structured?

micko 2015-02-03 20:16

Re: Gym Logbook - Some programming help needed
 
Quote:

Originally Posted by m4r0v3r (Post 1459364)
as a gym goer can I provide some feedback on how it should be structured?

Sure! All feedback is appreciated.

That said, I wrote this program for myself the way I want to use it at gym. I want to keep it as simple as possible to use. It's not yet what I really want because my skills are limiting...

m4r0v3r 2015-02-03 20:19

Re: Gym Logbook - Some programming help needed
 
usually when I go to the gym, i work on days, so I have monday, wednesday friday, and each day has an exercise with a set of reps etc. so could instead of showing me all the exercises, it shows me what days i go to the gym, and inside those days it might already have prescribed sets and reps in there, even it just needs the weight and if i failed or not

micko 2015-02-03 21:00

Re: Gym Logbook - Some programming help needed
 
Quote:

Originally Posted by m4r0v3r (Post 1459449)
usually when I go to the gym, i work on days, so I have monday, wednesday friday, and each day has an exercise with a set of reps etc. so could instead of showing me all the exercises, it shows me what days i go to the gym, and inside those days it might already have prescribed sets and reps in there, even it just needs the weight and if i failed or not

With Gym Logbook you do a "Workout routine" and add those days. Then add exercises to the days. ShowWorkout.qml shows all the exercises from all days in the same listview. There should be section headers to separate day from another. I did it like this to avoid one more tap to see the routine. Maybe I'll try it as you said. The way it's now might be confusing if total number of exercises is big. My routine has only 3-5 exercises per day and with that it still looks good.

From that view you can tap any exercise to see the sets. I'm currently writing feature to automatically plan future sets according to some specified progression. I use Wendler's 531 myself, but I'll add linear and static as well.

You could also type your sets and reps in the "Additional information" field if the set is exactly the same every time.

m4r0v3r 2015-02-03 21:11

Re: Gym Logbook - Some programming help needed
 
my work out routine is texas method, which is a 2 day split, so when I go on the workout it shows me exercises for both days. i suppose ill just have to split the 2 days into two seperate workout routines.


All times are GMT. The time now is 11:16.

vBulletin® Version 3.8.8