blonsky95 / DigiCoachAndroid

0 stars 0 forks source link

1.0.1 make results measurable #46

Closed blonsky95 closed 4 years ago

blonsky95 commented 4 years ago

Ideally users want to track their results, graphically would be great.

The standard results button will show a list of dates which when selected show the results by date, whatever the user wrote on their results page. However, just like exercises are customizable (adding fields) results will be too, it will give the option to add result fields like: Note (text) - obligatory - even if empty Time for something (specify units) - number - optional weight lifted (specify units) - number - optional 1 number results per exercise

There will be a button for graphs somehwere, and if user presses it and there is more than 2 values for a number field it will display graph with dates on x axis

So modify results structure Change UI of results Make graphs Add graph to Results Activity

blonsky95 commented 4 years ago

Results structure modified

Now modify UI to let user add plottable + for ExerciseResult to handle them and display them when needed for that exercise using the isPlottable variable

blonsky95 commented 4 years ago

Ok so points from today's 1 hour coding session:

  1. Results creator works analogously to Exercise creator so find common ground either interface or something - clean this up future
  2. As with exercise, results have editable fields and users should be able to change names and shit so the ExerciseResults needs to have a tree map added for its fields
blonsky95 commented 4 years ago

Fixed a couple errors - now see why not appearing on dates - log results - all the shite

blonsky95 commented 4 years ago

arraylsit of result keeps getting overriden (probably)

when adding new results in different dates, only 1 appears in the list of results for that exercise

blonsky95 commented 4 years ago

allrighty mate - results now working - the object transfer between classes through Dataholder and repos is now more coherent

SO i need to: make resultset an arraylist of hashmaps of the same structure of the user made hashmap (adding fields and shit will create it)

blonsky95 commented 4 years ago

need to test the array list of hashmaps - make it work with add and update

when that works:

blonsky95 commented 4 years ago

Ok thats working

Now apart from plottable shit up there Make the buttons for results change if you have already added tapped it

blonsky95 commented 4 years ago

Ok the relationship between the arrayofresults and the fields map is more clear:

When a user adds a field (next mission btw) - it will ask user if its plottable - then add the field to fieldsmap. Also update the fieldsMap of the exercise ExerciseResults with the new field. Change colour background or something.

Make a check for numbers that can be converted to double.

blonsky95 commented 4 years ago

adding fields, plottables and making plottable fields different (input plus background) perf

next in results viewer locate all the plottables and just display them in list somewhere - next graph?

blonsky95 commented 4 years ago

next - change colour of button in calendar for results if you already put there a result

blonsky95 commented 4 years ago

When Day is loaded, it loads the exercises in that day, when it does so it can check if those exercises contain a result for that date, (add a function to Exercise, called containsResult(date), which checks in array if there is any results for that date), if they do, it passes something to adapter for colour to be different or it directly changes the button colour.

To counter the 2 same exercises in one day I can use a stack - as the day contains exercises they are added to a stack (one per exercise) and when the results are contained in the exercise it the stack contains something, then it changes colour, else it doesnt. E.g.

I have exeA 2 times on 11-11-2011: First the stack is empty, so wont detect anything so wont colour anything Then I add 1 result so+1 stack, so when I want to colour I'll check the stack for that exercise on that date, and as there is only one in the stack it will run out of points to colour - something like that or overkill

blonsky95 commented 4 years ago

Perfect whats left is:

MAKE DATE UNIQUE - ok so, when we have 2 exercises in one same day. All we have is an exercise and a date, we can check how many results there is for that date, but we can't track how many button's states we are changing. can i get a reference to the number of instances an exercise has in a day, within DayContentAdapter? Yes

What if in day, I check if it should be coloured? a function of day which passes exercise and Day does it for them, which has the date, and the instances in itself and the exercise?

GRAPH THAT SHIT

CHECK WITH BLOCKS - done - weird background colour of the collapsible layout was causing a colour mix

blonsky95 commented 4 years ago

Found a way of checking how many buttons should be coloured differently (state). But you can't send the user to the right result through the intent!!!!!!!!!!!!!!

Proceed and fix this in the future - basically make results unique and link the button to those results ish - probably create results class

for now - do the graph

blonsky95 commented 4 years ago

https://github.com/AnyChart/AnyChart-Android investigate this tomorrow

blonsky95 commented 4 years ago

left a todo in results viewer - but basically need a spinner which lists the plottable values - when one is selected it changes the line that is benig displayed - the whole graph + line + data series generation will be done in OnCreate - the spinner will only update the dataseries that is attached to the graph in that moment.

blonsky95 commented 4 years ago
blonsky95 commented 4 years ago
blonsky95 commented 4 years ago

RESULTS DONE (+-) Duplicate exercises can't be in one same day. ATM there is an info box informing, but perhaps would be good if when adding to day something detects if existing exercise. Temporary functionality until a better way (architechture) of storing results and using the adapters or perhaps UI comes in.