3 using Tizen.NUI.BaseComponents;
4 using Tizen.NUI.Components;
6 namespace Tizen.NUI.Samples
9 using W = Tizen.NUI.Wearable;
11 public class WearablePopupTest : IExample
13 private W.Popup myPopup1;
14 private Window myWindow;
15 const string tag = "NUITEST";
16 private string resourcePath;
17 private const int BUTTON_WIDTH = 73;
18 private const int BUTTON_HEIGHT = 121;
19 private Color BUTTON_COLOR = new Color(11.0f / 255.0f, 6.0f / 255.0f, 92.0f / 255.0f, 1);
20 private const int BUTTON_ICON_WIDTH = 50;
21 private const int BUTTON_ICON_HEIGHT = 50;
23 private TextLabel myContent1;
25 public void Activate()
27 resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
28 myWindow = NUIApplication.GetDefaultWindow();
30 //two buttons popup, type1
31 ButtonStyle buttonStyle = new ButtonStyle()
33 Icon = new ImageViewStyle()
35 ResourceUrl = new Selector<string>()
37 All = resourcePath + "images/PopupTest/tw_ic_popup_btn_bg.png",
39 Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT),
40 Color = new Selector<Color>()
45 Overlay = new ImageViewStyle()
47 ResourceUrl = new Selector<string>()
49 All = resourcePath + "images/PopupTest/tw_ic_popup_btn_check.png",
51 Size = new Size(BUTTON_ICON_WIDTH, BUTTON_ICON_HEIGHT),
52 Color = new Selector<Color>()
58 Button leftButton = new Button(buttonStyle)
61 Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT),
64 myPopup1 = new W.Popup();
65 myPopup1.AppendButton("LeftButton", leftButton);
67 buttonStyle.Overlay.ResourceUrl = new Selector<string>()
69 All = resourcePath + "images/PopupTest/tw_ic_popup_btn_delete.png",
71 Button rightButton = new Button(buttonStyle)
74 Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT),
76 myPopup1.AppendButton("RightButton", rightButton);
78 TextLabel t = myPopup1.GetTitle();
79 t.Text = "User consent";
81 myContent1 = new TextLabel();
82 myContent1.Text = "Agree? \n GPS location \n and use of your \n location data \n are controlled \n by the applications you \n \n \n this is additional text!";
83 myContent1.MultiLine = true;
84 myContent1.Size = new Size(200, 800);
85 myContent1.PointSize = 6;
86 myContent1.HorizontalAlignment = HorizontalAlignment.Center;
87 myContent1.VerticalAlignment = VerticalAlignment.Top;
88 myContent1.TextColor = Color.White;
89 myContent1.PositionUsesPivotPoint = true;
90 myContent1.ParentOrigin = ParentOrigin.Center;
91 myContent1.PivotPoint = PivotPoint.Center;
92 myPopup1.AppendContent("ContentText", myContent1);
93 leftButton.ClickEvent += LeftButton_ClickEvent;
94 rightButton.ClickEvent += RightButton_ClickEvent;
95 myPopup1.OutsideClicked += Mp_OutsideClicked;
97 myPopup1.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren;
98 myPopup1.ContentContainer.HeightResizePolicy = ResizePolicyType.FitToChildren;
100 myPopup1.Post(myWindow);
101 myPopup1.AfterDissmising += MyPopup1_AfterDissmising;
104 private void MyPopup1_AfterDissmising(object sender, EventArgs e)
106 t1 = new TextLabel("please go back to main menu!")
108 PositionUsesPivotPoint = true,
109 ParentOrigin = ParentOrigin.Center,
110 PivotPoint = PivotPoint.Center,
114 NUIApplication.GetDefaultWindow().Add(t1);
117 private void RightButton_ClickEvent(object sender, Button.ClickEventArgs e)
122 private void LeftButton_ClickEvent(object sender, Button.ClickEventArgs e)
124 myContent1.TextColor = Color.Yellow;
127 private void Mp_OutsideClicked(object sender, EventArgs e)
129 var popup = sender as W.Popup;
136 public void Deactivate()