-
Notifications
You must be signed in to change notification settings - Fork 1
/
SpotifyButtonDelegate.mc
52 lines (43 loc) · 1.28 KB
/
SpotifyButtonDelegate.mc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//!
//! Copyright 2016 by Garmin Ltd. or its subsidiaries.
//! Subject to Garmin SDK License Agreement and Wearables
//! Application Developer Agreement.
//!
using Toybox.WatchUi;
using Toybox.Attention;
class SpotifyButtonDelegate extends WatchUi.BehaviorDelegate {
function initialize() {
BehaviorDelegate.initialize();
}
function onSelectable(event) {
// System.println("onSelectable");
// Needed when developing in sim because sim has bug preventing
// buttons from resetting to default state on touch screens.
// event.getInstance().setState(:stateDefault);
}
function onRefresh() {
// System.println("onRefresh");
currentView._transaction.go();
return false;
}
function onPlay() {
// System.println("onPlay");
currentView._playTransaction.go();
return false;
}
function onPause() {
// System.println("onPause");
currentView._pauseTransaction.go();
return false;
}
function onPrevious() {
// System.println("onPrevious");
currentView._previousTransaction.go();
return false;
}
function onNext() {
// System.println("onNext");
currentView._nextTransaction.go();
return false;
}
}