Skip to content

Commit

Permalink
Merge pull request #5 from jaroslawhartman/glance
Browse files Browse the repository at this point in the history
Fix for #1 and #3
  • Loading branch information
jaroslawhartman authored Feb 23, 2024
2 parents 85e3b4a + be7458f commit 48f5718
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 18 deletions.
Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 4 additions & 9 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Use "Monkey C: Edit Application" from the Visual Studio Code command palette
to update the application attributes.
-->
<iq:application id="d3d305db-d638-44cf-9c67-64f13c2abe1b" type="widget" name="@Strings.AppName" entry="TrainerRoadWorkoutApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="2.4.0">
<iq:application id="d3d305db-d638-44cf-9c67-64f13c2abe1b" type="widget" name="@Strings.AppName" entry="TrainerRoadWorkoutApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="3.1.0">
<!--
Use the following from the Visual Studio Code comand palette to edit
the build targets:
Expand All @@ -14,19 +14,15 @@
"Monkey C: Edit Products" - Lets you add or remove any product
-->
<iq:products>
<iq:product id="approachs60"/>
<iq:product id="approachs62"/>
<iq:product id="approachs7042mm"/>
<iq:product id="approachs7047mm"/>
<iq:product id="d2air"/>
<iq:product id="d2airx10"/>
<iq:product id="d2charlie"/>
<iq:product id="d2delta"/>
<iq:product id="d2deltapx"/>
<iq:product id="d2deltas"/>
<iq:product id="d2mach1"/>
<iq:product id="descentg1"/>
<iq:product id="descentmk1"/>
<iq:product id="descentmk2"/>
<iq:product id="descentmk2s"/>
<iq:product id="descentmk343mm"/>
Expand All @@ -35,12 +31,12 @@
<iq:product id="edge1030bontrager"/>
<iq:product id="edge1030plus"/>
<iq:product id="edge1040"/>
<iq:product id="edge520plus"/>
<iq:product id="edge530"/>
<iq:product id="edge540"/>
<iq:product id="edge820"/>
<iq:product id="edge830"/>
<iq:product id="edge840"/>
<iq:product id="edge_1000"/>
<iq:product id="edgeexplore"/>
<iq:product id="edgeexplore2"/>
<iq:product id="enduro"/>
Expand All @@ -67,6 +63,8 @@
<iq:product id="fenix7xpro"/>
<iq:product id="fenix7xpronowifi"/>
<iq:product id="fenixchronos"/>
<iq:product id="fr165"/>
<iq:product id="fr165m"/>
<iq:product id="fr245"/>
<iq:product id="fr245m"/>
<iq:product id="fr255"/>
Expand All @@ -78,7 +76,6 @@
<iq:product id="fr55"/>
<iq:product id="fr645"/>
<iq:product id="fr645m"/>
<iq:product id="fr735xt"/>
<iq:product id="fr745"/>
<iq:product id="fr935"/>
<iq:product id="fr945"/>
Expand Down Expand Up @@ -115,13 +112,11 @@
<iq:product id="venusq2m"/>
<iq:product id="venusqm"/>
<iq:product id="vivoactive3"/>
<iq:product id="vivoactive3d"/>
<iq:product id="vivoactive3m"/>
<iq:product id="vivoactive3mlte"/>
<iq:product id="vivoactive4"/>
<iq:product id="vivoactive4s"/>
<iq:product id="vivoactive5"/>
<iq:product id="vivoactive_hr"/>
</iq:products>
<!--
Use "Monkey C: Edit Permissions" from the Visual Studio Code command
Expand Down
3 changes: 2 additions & 1 deletion resources/drawables/drawables.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<drawables>
<bitmap id="LauncherIcon" filename="launcher_icon.png" />
<bitmap id="LoadingIcon" filename="loading.png" />
<bitmap id="Icon" filename="icon.png" scaleRelativeTo="screen" scaleX="15%" scaleY="15%"/>
<bitmap id="LoadingIcon" filename="loading.png" scaleRelativeTo="screen" scaleX="15%" scaleY="15%" />
</drawables>
Binary file added resources/drawables/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/drawables/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/layouts/layout.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<layout id="MainLayout">
<!-- <bitmap id="icon" x="center" y="2%" filename="../drawables/launcher_icon.png" /> -->
<bitmap id="icon" x="center" y="2%" filename="../drawables/launcher_icon.png" />
<bitmap id="icon" x="42%" y="2%" filename="../drawables/icon.png" />
<label id="NameLabel" text="---" x="center" y="15%" justification="Graphics.TEXT_JUSTIFY_CENTER" font="Gfx.FONT_MEDIUM" color="Gfx.COLOR_WHITE" />

<label id="DetailLbl1" text="Duration" x="48%" y="32%" justification="Graphics.TEXT_JUSTIFY_RIGHT" font="Gfx.FONT_TINY" color="Gfx.COLOR_LT_GRAY" />
Expand Down
4 changes: 2 additions & 2 deletions source/TrainerRoadDetailsMenu.mc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Toybox.WatchUi;

//! Create the Images custom menu
function pushTrainerRoadDetailsMenu(name as String, description as String) as Void {
var customMenu = new $.TrainerRoadDetailsMenu(name, 450, Graphics.COLOR_BLACK);
var customMenu = new $.TrainerRoadDetailsMenu(name, 250, Graphics.COLOR_BLACK);
customMenu.addItem(new $.TrainerRoadDetailsMenuItem(:description, description));
WatchUi.pushView(customMenu, new $.TrainerRoadDetailsMenuDelegate(), WatchUi.SLIDE_RIGHT);
}
Expand All @@ -22,7 +22,7 @@ class TrainerRoadDetailsMenu extends WatchUi.CustomMenu {
//! @param backgroundColor The color for the menu background
public function initialize(name as String, itemHeight as Number, backgroundColor as ColorType) {
// _name = name;
_icon = WatchUi.loadResource($.Rez.Drawables.LauncherIcon) as BitmapResource;
_icon = WatchUi.loadResource($.Rez.Drawables.Icon) as BitmapResource;
_iconOffset = -1 - _icon.getWidth() / 2;
CustomMenu.initialize(itemHeight, backgroundColor, {:titleItemHeight => 150});
}
Expand Down
2 changes: 2 additions & 0 deletions source/TrainerRoadWorkoutDelegate.mc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class TrainerRoadWorkoutDelegate extends WatchUi.BehaviorDelegate {
$.pushTrainerRoadWorkoutView();
} else {
if(! _view.description.equals("")) {
// var view = new $.TrainerRoadDetailsView("xxx");
// WatchUi.pushView(view, new $.TrainerRoadDetailsMenuDelegate(), WatchUi.SLIDE_RIGHT);
$.pushTrainerRoadDetailsMenu("Workout", _view.description);
return false;
}
Expand Down
10 changes: 5 additions & 5 deletions source/TrainerRoadWorkoutView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ class TrainerRoadWorkoutView extends WatchUi.View {
dc.drawLine(dc.getWidth()/2, dc.getHeight()*0.33, dc.getWidth()/2, dc.getHeight()*0.81);

if(! initial) {
dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_BLACK);
dc.fillCircle(dc.getWidth()/2+9, dc.getWidth()-6, 2);
dc.fillCircle(dc.getWidth()/2-1, dc.getWidth()-6, 2);
dc.fillCircle(dc.getWidth()/2-10, dc.getWidth()-6, 2);
dc.setColor(Graphics.COLOR_DK_GRAY, Graphics.COLOR_BLACK);
dc.fillCircle(dc.getWidth()/2+9, dc.getWidth()-6, 2);
dc.fillCircle(dc.getWidth()/2-1, dc.getWidth()-6, 2);
dc.fillCircle(dc.getWidth()/2-10, dc.getWidth()-6, 2);
}
}

Expand Down Expand Up @@ -248,7 +248,7 @@ class TrainerRoadWorkoutView extends WatchUi.View {
//! @param args Data from the web request, or error message
public function onReceive(args as Dictionary or String or Null) as Void {
var icon = View.findDrawableById("icon") as Bitmap;
icon.setBitmap(Rez.Drawables.LauncherIcon);
icon.setBitmap(Rez.Drawables.Icon);

if (args instanceof String) {
System.println("onReceived -- String: " + args);
Expand Down

0 comments on commit 48f5718

Please sign in to comment.