1 using Tizen.NUI.BaseComponents;
2 using Tizen.NUI.Extension;
3 using Tizen.NUI.Components;
5 namespace Tizen.NUI.Samples
7 public class RiveMusicApp : IExample
10 private Layer defaultLayer;
12 Tizen.NUI.Extension.RiveAnimationView rav;
13 Button playButton, stopButton;
14 public void Activate()
16 window = NUIApplication.GetDefaultWindow();
17 defaultLayer = window.GetDefaultLayer();
19 rav = new Tizen.NUI.Extension.RiveAnimationView(Tizen.Applications.Application.Current.DirectoryInfo.Resource + "rive/music.riv")
21 Size = new Size(500, 500),
22 ParentOrigin = ParentOrigin.Center,
23 PivotPoint = PivotPoint.Center,
24 PositionUsesPivotPoint = true,
29 playButton = new Button()
31 Size = new Size(200, 100),
32 Position = new Position(0, 0),
35 playButton.Clicked += (object source, ClickedEventArgs args) =>
37 rav.EnableAnimation("Loop", true);
38 rav.EnableAnimation("Start", true);
39 rav.EnableAnimation("Stop", false);
42 stopButton = new Button()
44 Size = new Size(200, 100),
45 Position = new Position(200, 0),
48 stopButton.Clicked += (object source, ClickedEventArgs args) =>
50 rav.EnableAnimation("Loop", false);
51 rav.EnableAnimation("Start", false);
52 rav.EnableAnimation("Stop", true);
55 defaultLayer.Add(rav);
56 defaultLayer.Add(playButton);
57 defaultLayer.Add(stopButton);
59 public void Deactivate()
61 defaultLayer.Remove(rav);
62 defaultLayer.Remove(playButton);
63 defaultLayer.Remove(stopButton);