Skip to content

Commit

Permalink
Rename variable and method used to refresh the match view
Browse files Browse the repository at this point in the history
  • Loading branch information
matco committed Sep 17, 2023
1 parent 4b76946 commit ddd2576
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions source/views/MatchView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,19 @@ class MatchView extends WatchUi.View {

public var boundaries as MatchBoundaries?;

private var timer as Timer.Timer;
private var clock24Hour as Boolean;
private var timeAMLabel as String;
private var timePMLabel as String;

private var refreshTimer as Timer.Timer;

function initialize() {
View.initialize();
clock24Hour = System.getDeviceSettings().is24Hour;
timeAMLabel = WatchUi.loadResource(Rez.Strings.time_am) as String;
timePMLabel = WatchUi.loadResource(Rez.Strings.time_pm) as String;
calculateBoundaries();
timer = new Timer.Timer();
refreshTimer = new Timer.Timer();
}

function calculateBoundaries() as Void {
Expand All @@ -234,16 +235,16 @@ class MatchView extends WatchUi.View {
}

function onShow() {
timer.start(method(:onTimer), 1000, true);
refreshTimer.start(method(:refresh), 1000, true);
(Application.getApp() as BadmintonApp).getBus().register(self);
}

function onHide() as Void {
timer.stop();
refreshTimer.stop();
(Application.getApp() as BadmintonApp).getBus().unregister(self);
}

function onTimer() as Void {
function refresh() as Void {
WatchUi.requestUpdate();
}

Expand Down

0 comments on commit ddd2576

Please sign in to comment.