blonsky95 / DigiCoachAndroid

0 stars 0 forks source link

1.0.10 Results #65

Closed blonsky95 closed 4 years ago

blonsky95 commented 4 years ago

fcf8eea9-8628-499c-9baa-0cdfb211b1a5 Think about how to make results plottable, how to facilitate user using them.

Current idea is that for every exercise result you have at least one plottable field, this field has a spinner and you choose the type so for example:

  1. Time, distance, speed, weight at rep, 1 RM, 1 RM based on sets and reps, average time, fastest time...

Depending on the type you choose it will dynamically change the field, so for time you can get: time - hh:mm:ss time - mm:ss time - ss:dd

1RM - kg

blonsky95 commented 4 years ago

types

blonsky95 commented 4 years ago

In ExerciseResults - in type instead of plottable, will be unit!!!!!!!!!!

blonsky95 commented 4 years ago

investigate this tomorrow

blonsky95 commented 4 years ago

First thing to do, create spinner, and dynamic fields

blonsky95 commented 4 years ago

No commit but stage now is: When adding result there is no longer a plotabble field, nor an add field button

Instead there is a + field button which when pressed dissapears and generates a field with a spinner and a combination of edit texts, user can select the units, which will also be the name of the measured parameter. User can then input any decimal/number in there. ATM you cant add two fields however, this is probably needed. reason is that when you generate the fields and do the listeners for spinner change, the ids/views are recycled. This means each field will probably need its own inflating layout, and its own ids.

When collecting data, it will fetch the childs of the parent layout and go one by one, it gets date, note:description, and then the measured fields, in here I will debug to figure out how to get the fields, and use the spinner value to get the key.

But, try leaving the +field button, and see if having custom inflates, so their own layouts, allows 2 different units results to be modified independently.

So, first check the multiple inflating - DONE - not too simple, will have to think this one out

second, collect the data with the key, - DONE - things with more than one unit come in UU-XX-ZZ format

third, make it work with edit view new modes - button ui ok - doing the presentabla layout ok - then change the edit mode back to edit texts (about to get this) - multiple spinner issues - DONE https://stackoverflow.com/questions/10777977/android-multiple-spinners - each spinner can have an id so this could be a way to add more results

fourth, make it work in graph, and in plottable arrays and shit- DONE

fifth, get rid of the whole add field and generate dialog stuff that was used in ResultsCreator for this - DONE

This should be it for this issue!

blonsky95 commented 4 years ago

When the previous comment is done - finish the dialog shit and then clean up ResultsCreator - maybe change view model - consider how to do multiple spinners - hint use multiple ids for each spinner?

blonsky95 commented 4 years ago

NEXT - change the view model - probably use the exercise one - DONE NEXT - see if 2 spinners is doable

blonsky95 commented 4 years ago

About the 2 spinners - check how they work - see if I can use the spinner id, or programatically create an adapter (dodgy) or think about

blonsky95 commented 4 years ago

ITS FREAKIN WORKING

So the problem was that when I want to do an item selected listener for the spinner, and implemented the adapterview.onitemselected interface, I could only use one interface for one spinner, so when adding more spinners, the code inside the interface onItemSelected was applying to all the spinners, and basically limited individuality of the spinners.

There was also the problem that each spinner has a unique loadout per item, and keeping references to separate layouts which were dynamically generated was impossible with a single instance interface.

Solution was creating an inner class (inner so it has access to all the variables I have declared in the parent class) called MySpinnerConfigurer or something like that. This class has in its constructor - spinner and a layout (which contains the spinner and the layout that is substituted by the edit texts). The class also implements the interface and when initialised sets it to the spinner. In the interface there is all the functionality for the unique layout to be modified.