Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/Delegates/AdvancedViewDelegate.mc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AdvancedViewDelegate extends WatchUi.BehaviorDelegate {
//private var _view as AdvancedView;

function initialize(view as AdvancedView) {
InputDelegate.initialize();
BehaviorDelegate.initialize();
//_view = view;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Toybox.Application;
class SelectBarChartDelegate extends WatchUi.Menu2InputDelegate {

private var _menu as WatchUi.Menu2;
var app = Application.getApp() as GarminApp;
var app = getApp();
var chartDuration = app.getChartDuration();

function initialize(menu as WatchUi.Menu2) {
Expand All @@ -24,20 +24,16 @@ class SelectBarChartDelegate extends WatchUi.Menu2InputDelegate {

//Try to change cadence range based off menu selection
if (id == :chart_15m){
app.setChartDuration("FifteenminChart");
System.println("Chart Duration: Fifteenmin");
app.setChartDuration(GarminApp.FifteenminChart);
}
else if (id == :chart_30m){
app.setChartDuration("ThirtyminChart");
System.println("Chart Duration: Thirtymin");
app.setChartDuration(GarminApp.ThirtyminChart);
}
else if (id == :chart_1h){
app.setChartDuration("OneHourChart");
System.println("Chart Duration: OneHour");
app.setChartDuration(GarminApp.OneHourChart);
}
else if (id == :chart_2h){
app.setChartDuration("TwoHourChart");
System.println("Chart Duration: TwoHour");
app.setChartDuration(GarminApp.TwoHourChart);
}
else {System.println("ERROR");}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ProfilePickerDelegate extends WatchUi.PickerDelegate {
app.setUserSpeed(pickedValue);
}

app.idealCadenceCalculator();

WatchUi.popView(WatchUi.SLIDE_RIGHT);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class SelectExperienceDelegate extends WatchUi.Menu2InputDelegate {
Menu2InputDelegate.initialize();
_menu = menu;

if (experienceLvl == 1.06){
if (experienceLvl == GarminApp.Beginner){
experienceLvlString = "Beginner";
} else if (experienceLvl == 1.04){
} else if (experienceLvl == GarminApp.Intermediate){
experienceLvlString = "Intermediate";
} else if (experienceLvl == 1.02){
} else if (experienceLvl == GarminApp.Advanced){
experienceLvlString = "Advanced";
}
var newTitle = Lang.format("Experience: $1$", [experienceLvlString]);
Expand All @@ -34,17 +34,19 @@ class SelectExperienceDelegate extends WatchUi.Menu2InputDelegate {
//Try to change user experience lvl based off menu selection
if (id == :exp_beginner){
System.println("User ExperienceLvl: Beginner");
app.setExperienceLvl(1.06);
app.setExperienceLvl(GarminApp.Beginner);
}
else if (id == :exp_intermediate){
System.println("User ExperienceLvl: Intermediate");
app.setExperienceLvl(1.04);
app.setExperienceLvl(GarminApp.Intermediate);
}
else if (id == :exp_advanced){
System.println("User ExperienceLvl: Advanced");
app.setExperienceLvl(1.02);
app.setExperienceLvl(GarminApp.Advanced);
} else {System.println("ERROR");}

app.idealCadenceCalculator();

WatchUi.popView(WatchUi.SLIDE_RIGHT);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ class SelectGenderDelegate extends WatchUi.Menu2InputDelegate {

//Try to change user gender based off menu selection
if (id == :user_male){
app.setUserGender("Male");
app.setUserGender(GarminApp.Male);
System.println("User Gender: Male");
}
else if (id == :user_female){
app.setUserGender("Female");
app.setUserGender(GarminApp.Female);
System.println("User Gender: Female");
}
else if (id == :user_other){
app.setUserGender("Other");
app.setUserGender(GarminApp.Other);
System.println("User Gender: Other");
} else {System.println("ERROR");}

app.idealCadenceCalculator();

WatchUi.popView(WatchUi.SLIDE_RIGHT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ class SelectProfileDelegate extends WatchUi.Menu2InputDelegate {
function speedPicker() as Void {
//uses number not float
var currentSpeed = app.getUserSpeed().toNumber();
if (currentSpeed == null) { currentSpeed = 10; } // Default 10 km/h
if (currentSpeed == null) { currentSpeed = 3; } // Default 3 km/h

var factory = new ProfilePickerFactory(5, 30, 1, {:label=>" km/h"});
var factory = new ProfilePickerFactory(3, 30, 1, {:label=>" km/h"});

var picker = new WatchUi.Picker({
:title => new WatchUi.Text({:text=>"Set Speed", :locX=>WatchUi.LAYOUT_HALIGN_CENTER, :locY=>WatchUi.LAYOUT_VALIGN_BOTTOM, :color=>Graphics.COLOR_WHITE}),
:pattern => [factory],
:defaults => [factory.getIndex(currentSpeed)]
});

WatchUi.pushView(picker, new ProfilePickerDelegate(:prof_speed), WatchUi.SLIDE_LEFT);

}
Expand Down
Loading