public override void OnCreate(View root) { var resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; ButtonStyle buttonStyle = new ButtonStyle() { BackgroundImage = resourcePath + "WearablePopup0/tw_ic_popup_btn_bg.png", Size = new Size(73, 121), Color = new Color(11.0f / 255.0f, 6.0f / 255.0f, 92.0f / 255.0f, 1), Icon = new ImageViewStyle() { Size = new Size(50, 50), Color = Color.Cyan, }, }; buttonStyle.Icon.ResourceUrl = resourcePath + "WearablePopup0/tw_ic_popup_btn_check.png"; Button leftButton = new Button(buttonStyle); leftButton.ClickEvent += LeftButton_ClickEvent; buttonStyle.Icon.ResourceUrl = resourcePath + "WearablePopup0/tw_ic_popup_btn_delete.png"; Button rightButton = new Button(buttonStyle); rightButton.ClickEvent += RightButton_ClickEvent; popup = new Tizen.NUI.Wearable.Popup(); popup.AppendButton("LeftButton", leftButton); popup.AppendButton("RightButton", rightButton); TextLabel t = popup.GetTitle(); t.Text = "Title Area"; content = new TextLabel(); content.Text = "Click? \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!"; content.MultiLine = true; content.Size = new Size(200, 800); content.PointSize = 6; content.HorizontalAlignment = HorizontalAlignment.Center; content.VerticalAlignment = VerticalAlignment.Top; content.TextColor = Color.White; content.PositionUsesPivotPoint = true; content.ParentOrigin = ParentOrigin.Center; content.PivotPoint = PivotPoint.Center; popup.AppendContent("ContentText", content); popup.OutsideClicked += Mp_OutsideClicked; popup.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren; popup.ContentContainer.HeightResizePolicy = ResizePolicyType.FitToChildren; popup.Post(NUIApplication.GetDefaultWindow()); popup.AfterDissmising += popup_AfterDissmising; }
public void PopupPost() { resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; //two buttons popup, type1 ButtonStyle buttonStyle = new ButtonStyle() { Icon = new ImageViewStyle() { ResourceUrl = new Selector <string>() { All = resourcePath + "images/tw_ic_popup_btn_bg.png", }, Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), Color = new Selector <Color>() { All = BUTTON_COLOR, }, }, Overlay = new ImageViewStyle() { ResourceUrl = new Selector <string>() { All = resourcePath + "images/tw_ic_popup_btn_check.png", }, Size = new Size(BUTTON_ICON_WIDTH, BUTTON_ICON_HEIGHT), Color = new Selector <Color>() { All = Color.White, }, }, }; Button leftButton = new Button(buttonStyle) { Name = "LeftButton", Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), }; myPopup1 = new Popup(); myPopup1.AppendButton("LeftButton", leftButton); buttonStyle.Overlay.ResourceUrl = new Selector <string>() { All = resourcePath + "images/tw_ic_popup_btn_delete.png", }; Button rightButton = new Button(buttonStyle) { Name = "RightButton", Size = new Size(BUTTON_WIDTH, BUTTON_HEIGHT), }; myPopup1.AppendButton("RightButton", rightButton); TextLabel t = myPopup1.GetTitle(); t.Text = "User consent"; myContent1 = new TextLabel(); 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!"; myContent1.MultiLine = true; myContent1.Size = new Size(200, 800); myContent1.PointSize = 6; myContent1.HorizontalAlignment = HorizontalAlignment.Center; myContent1.VerticalAlignment = VerticalAlignment.Top; myContent1.TextColor = Color.White; myContent1.PositionUsesPivotPoint = true; myContent1.ParentOrigin = ParentOrigin.Center; myContent1.PivotPoint = PivotPoint.Center; myPopup1.AppendContent("ContentText", myContent1); leftButton.ClickEvent += LeftButton_ClickEvent; rightButton.ClickEvent += RightButton_ClickEvent; myPopup1.OutsideClicked += Mp_OutsideClicked; myPopup1.ContentContainer.WidthResizePolicy = ResizePolicyType.FitToChildren; myPopup1.ContentContainer.HeightResizePolicy = ResizePolicyType.FitToChildren; myPopup1.Post(Window.Instance); //myPopup1.AfterDissmising += MyPopup1_AfterDissmising; }