Share My Creation Gym Plates Calculator

Attachments

  • gym1.png
    gym1.png
    78.3 KB · Views: 3,139
  • gym2.png
    gym2.png
    42.5 KB · Views: 319
  • gym3.png
    gym3.png
    143.7 KB · Views: 327
  • gym4.png
    gym4.png
    56.7 KB · Views: 340
  • gym5.png
    gym5.png
    84.1 KB · Views: 321
Last edited:

LucaMs

Expert
Licensed User
Longtime User
Can I afford to give you any suggestions?

1) You should put a button to exit from the screens, because I've read that the hardware key will no longer be supported.
2) choosing Kg in the settings, the column Bar Weight Kg is not updated. Also, I think the table and the input should only show/use Lb or Kg
3) History: after my change from Lb to Kb, i can see Lb, not Kg.
4) the screen "My progress" has some small imperfections:
upload_2014-8-23_7-13-59.png


5) If I remember correctly, my barbell weighs 8kg, they are to be considered :D
6) I would change the name: your app do not calculates the weight of the "plates" (barbell) only!

P.S. don't show "Splash" as screen title
I have no plates to 2.5Kg, but 1, 2, 5, 10, 20.
 
Last edited:

klaus

Expert
Licensed User
Longtime User
I had a look at your application and noticed the following:
It seems that your layouts are defined for a 'standard' screen.
On my sony xperia there is room on the right and bottom of the screen.
You could move the buttons to the bottom of the screen and set the table height according to the screen height.
You may also set the width according to the screen width.
Look at the end for a modified layout.
upload_2014-8-23_12-21-48.png


1) In My progress
11) The white part in not centered
12) It seems that you have set the dimensions in pixels and not in dip values.
13) There is a black line on the left in the chart, looks strange, perhaps it is due to the fact that there no data.
14) Is the chart heigher than the screen ?

upload_2014-8-23_12-8-12.png


2) In Calculator, if no exercise is selected and you click on + you get an error (invalid double), you should set a default exercise or check if the EditText is empty.

upload_2014-8-23_12-14-53.png


3) In exercises, when you enter a weight in lb it would be interesting to add automatically the kg value.

If your application should also work in landscape orientation you might add variants for landscape.
I haven't tested it on a tablet.

As i have the ExerciseLayout file from another thread I took the liberty to modify it.
upload_2014-8-23_13-32-38.png
 

Attachments

  • exerciseslayout.bal
    5.4 KB · Views: 262
  • upload_2014-8-23_13-31-20.png
    upload_2014-8-23_13-31-20.png
    26.7 KB · Views: 221
Last edited:

achtrade

Active Member
Licensed User
Longtime User
Thanks for all your feedbacks. Of course all suggestions and critics are welcome.

I tested it in a samsung galaxy s3, it looks like the pics attached.

Only "My progress" was made to work with both orientation. All others screens I'm still figuring out how to do it, because I used the designer to create them and i'm not sure if I have to use code or make changes in the designer.

I'll work in your suggestions.

Again, thanks for those suggestions and please don't hesitate to tell me what you think
 

klaus

Expert
Licensed User
Longtime User
I used the designer to create them and i'm not sure if I have to use code or make changes in the designer.
You should add a new variant for landscape in the layout files.
Attached an example of your ExerciseLayout.
 

Attachments

  • exerciseslayout.bal
    6.3 KB · Views: 250

achtrade

Active Member
Licensed User
Longtime User
Can I afford to give you any suggestions?
1) You should put a button to exit from the screens, because I've read that the hardware key will no longer be supported.
Good. but, should be a button to close the app or go back to the previous screen ?

2) choosing Kg in the settings, the column Bar Weight Kg is not updated. Also, I think the table and the input should only show/use Lb or Kg
what column are you talking about ? in Exercises screen ? if so, the user has to put both weight (Lb and Kg) for each barbell, because 45 lbs is equivalent to 20.41 kg and there is not barbell with 20.41.kg.

3) History: after my change from Lb to Kb, i can see Lb, not Kg.
This is correct, because the previous history was stored as Lb. I'm assuming that the user first set the UoM before starting to use the app

4) the screen "My progress" has some small imperfections:
I tested in my samsung galaxy s3 and it looks pretty well, but I think that I have to check my code again to make it compatible with other devices.

5) If I remember correctly, my barbell weighs 8kg, they are to be considered :D

In Exercises, you can put any barbell weight in Lb or Kg

6) I would change the name: your app do not calculates the weight of the "plates" (barbell) only!
It's true, but the main goal is calculate the weight of the plates. What name can you suggest me ?

P.S. don't show "Splash" as screen title
Changed
I have no plates to 2.5Kg, but 1, 2, 5, 10, 20.
Same. I get the info of the plates in Kg from this website http://en.wikipedia.org/wiki/Barbell . But, In my version 2.0 I'm planning to allow the users to create theirs own plates weight :)


Thank you for all your suggestions.
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
1) go back

2) I think you should use everywhere the unit of measure chosen by the user.

3) same as 2), also for the old exercises performed

5) I was referring to the bar that been supporting disks :)
bilancieri-pesistica-barra-diritta-70274-3674291.jpg


6) as far as I remember, you calculate the type and number of disks, not their weight.
I will suggest a title that includes Body, Exercises and Weights
 

achtrade

Active Member
Licensed User
Longtime User
I had a look at your application and noticed the following:
It seems that your layouts are defined for a 'standard' screen.

On my sony xperia there is room on the right and bottom of the screen.
You could move the buttons to the bottom of the screen and set the table height according to the screen height.
You may also set the width according to the screen width.
Look at the end for a modified layout.
It's true. I'll implement those changes, well I'll try, this is my first time :)

1) In My progress
11) The white part in not centered
12) It seems that you have set the dimensions in pixels and not in dip values.
13) There is a black line on the left in the chart, looks strange, perhaps it is due to the fact that there no data.
14) Is the chart heigher than the screen ?

This is my code for this part. Maybe this isn't the best way to do it
B4X:
Sub Activity_Create(FirstTime As Boolean)
  
    Activity.AddView(pnlToolbox, 3%x, 1%y, 90%x, 24%y)      
    pnlToolbox.AddView(lblTitle, 0,0, Activity.Width - 20, 50)
    pnlToolbox.AddView(lblEx, 0,50, 150, 30)
    pnlToolbox.AddView(spnEx, 160,40, 300, 80)
    pnlToolbox.AddView(rbt1, 0,70, 200, 30)
    pnlToolbox.AddView(rbt2, 110,70, 200, 30)
    pnlToolbox.AddView(rbt3, 210,70, 200, 30)
  

If Activity.Width > Activity.Height Then
        'landscape
        rbt1.Left = 290dip
        rbt1.top = 33dip
        rbt2.Left = 390dip
        rbt2.top = 33dip
        rbt3.Left = 490dip
        rbt3.top = 33dip
      
    Else
        'portrait
        rbt1.Left = 0dip
        rbt1.top = 60dip
        rbt2.Left = 110dip
        rbt2.top = 60dip
        rbt3.Left = 210dip
        rbt3.top = 60dip
      
    End If
end sub

2) In Calculator, if no exercise is selected and you click on + you get an error (invalid double), you should set a default exercise or check if the EditText is empty.

I'll fix it

3) In exercises, when you enter a weight in lb it would be interesting to add automatically the kg value.

I did it just like that, but the weight in lb is not equivalent to the weight in kg. A 45 lb barbell should be 20.41 Kb, but there is no barbell with that weight, for instance. For that reason I left it like now.

If your application should also work in landscape orientation you might add variants for landscape.
I haven't tested it on a tablet.

I know that I should do it like that, but I don't know if I have to only add variants for landscape or I have to add code too. Any help in this matter i would appreciate.

As i have the ExerciseLayout file from another thread I took the liberty to modify it.

Great. Thanks.

Thank you again for all those suggestions.
 

klaus

Expert
Licensed User
Longtime User
In these cases
B4X:
pnlToolbox.AddView(lblEx, 0,50, 150, 30)
pnlToolbox.AddView(spnEx, 160,40, 300, 80)
You must use dip values !
B4X:
pnlToolbox.AddView(lblEx, 0,50dip, 150dip, 30dip)
pnlToolbox.AddView(spnEx, 160dip,40dip, 300dip, 80dip)

I know that I should do it like that, but I don't know if I have to only add variants for landscape or I have to add code too. Any help in this matter i would appreciate.
You already have an answer.
 

achtrade

Active Member
Licensed User
Longtime User
In these cases
B4X:
pnlToolbox.AddView(lblEx, 0,50, 150, 30)
pnlToolbox.AddView(spnEx, 160,40, 300, 80)
You must use dip values !
B4X:
pnlToolbox.AddView(lblEx, 0,50dip, 150dip, 30dip)
pnlToolbox.AddView(spnEx, 160dip,40dip, 300dip, 80dip)

You already have an answer.
Yes I got the answer, I made the question before I saw your answer :).

Thanks.
 

achtrade

Active Member
Licensed User
Longtime User
1) go back

Done!

2) I think you should use everywhere the unit of measure chosen by the user.


3) same as 2), also for the old exercises performed

Done!

5) I was referring to the bar that been supporting disks :)
bilancieri-pesistica-barra-diritta-70274-3674291.jpg
I don't get it. If you go to exercises screen, you can enter an exercise with any barbell weight in lb or kg or both (1kg, 2kg, 8kg, 20Kg .... etc).

Nice barbell image, can I use it in my next version ?


6) as far as I remember, you calculate the type and number of disks, not their weight.
I will suggest a title that includes Body, Exercises and Weights

Let me see what I can do with this
 

achtrade

Active Member
Licensed User
Longtime User
I'm getting hard time trying to align all the button automatically in the main screen. I think that I haven't got the anchor matter.

Please help with this.

Here the properties:

*** PORTRAIT ****

Exercise button
----------------
h.anchor: LEFT
v.anchor: top
left: 20
top: 15
width: 100
height: 110

setting button
----------------
h.anchor: right
v.anchor: top
right edge dist: 20
top: 15
width: 100
height: 110

History button
----------------
h.anchor: left
v.anchor: bottom
left: 20
bottom edge dist.: 14
width: 100
height: 110

chart button
----------------
h.anchor: right
v.anchor: bottom
right edge distance: 20
bottom edge dist.: 16
width: 100
height: 110


Plates button
----------------
h.anchor: left
v.anchor: top
left: 20
width: 260
height: 100
height: 90

*** LANDSCAPING ****

Exercise button
----------------
h.anchor: LEFT
v.anchor: bottom
left: 15
bottom edge dist.: 102
width: 100
height: 110

setting button
----------------
h.anchor: right
v.anchor: bottom
right edge distance: 235
bottom edge dist.: 102
width: 100
height: 110

History button
----------------
h.anchor: right
v.anchor: bottom
right edge distance: 125
bottom edge dist.: 102
width: 100
height: 110

chart button
----------------
h.anchor: right
v.anchor: bottom
right edge distance: 15
bottom edge dist.: 102
width: 100
height: 110


Plates button
----------------
h.anchor: left
v.anchor: bottom
left: 15
top: 8
width: 430
height: 90
 

Attachments

  • mainscreen.jpg
    mainscreen.jpg
    30.8 KB · Views: 279

klaus

Expert
Licensed User
Longtime User
When I answered you that you don't need code I meant in the program code.
Depending on what you want it may need some code in the DesignerScripts.
If you look at the ExerciseLayout I sent you, you will see that there is some code in the DesignerScript for each layout variant.
Attached you find the MainLayout modified.

You should have a look at the chapters below in the Beginner's Guide :
8 The Designer
8.6 Layout variants
8.10 Anchors
8.11 AutoScale
 

Attachments

  • mainlayout.bal
    2.7 KB · Views: 283

achtrade

Active Member
Licensed User
Longtime User
When I answered you that you don't need code I meant in the program code.
Depending on what you want it may need some code in the DesignerScripts.
If you look at the ExerciseLayout I sent you, you will see that there is some code in the DesignerScript for each layout variant.
Attached you find the MainLayout modified.

You should have a look at the chapters below in the Beginner's Guide :
8 The Designer
8.6 Layout variants
8.10 Anchors
8.11 AutoScale


Excellent. I'll check it out.

Thanks.
 

achtrade

Active Member
Licensed User
Longtime User
Thank you Klaus, now it looks pretty well in several devices at least in the UI Claud :)
 

klaus

Expert
Licensed User
Longtime User
You could 'play' with the AutoScaleRate to increase the size for bigger screens.
By default AutoScaleRate = 0.3
You could try with AutoScaleRate(0.5).
You must place AutoScaleRate(0.5) before AutoScaleAll in the DesignerScripts.
B4X:
AutoScaleRate(0.5)
AutoScaleAll
 
Top