using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
{
public static class Popup
{
+ public static void ShowCentered(View view)
+ {
+ view.PositionUsesPivotPoint = true;
+ view.PivotPoint = new Position(0.5f, 0.5f);
+ view.ParentOrigin = new Position(0.5f, 0.5f);
+ Show(view);
+ }
+
public static void Show(View view)
{
var layer = new Layer();
+ var gray = new Tizen.NUI.Components.Control()
+ {
+ WidthResizePolicy = ResizePolicyType.FillToParent,
+ HeightResizePolicy = ResizePolicyType.FillToParent,
+ BackgroundColor = new Color(0f, 0f, 0f, 0.1f),
+ };
+ gray.TouchEvent += (s, e) =>
+ {
+ if (e.Touch.GetState(0) == PointStateType.Up)
+ {
+ Window.Instance.RemoveLayer(layer);
+ layer.Dispose();
+ }
+ return true;
+ };
+ layer.Add(gray);
+
+ view.TouchEvent += (s, e) => false; //prevent gray view reacting
layer.Add(view);
Window.Instance.AddLayer(layer);
+ }
- void onTouch(object sender, Window.TouchEventArgs e)
- {
- Window.Instance.TouchEvent -= onTouch;
- Window.Instance.RemoveLayer(layer);
- layer.Dispose();
- };
- Window.Instance.TouchEvent += onTouch;
+ private static bool Gray_TouchEvent(object source, View.TouchEventArgs e)
+ {
+ throw new NotImplementedException();
}
}
}
private static async void OnApTapped(Tizen.Network.WiFi.WiFiAP wifiAp)
{
+ OobeCommon.Utils.Popup.Show(new View()
+ {
+ PositionUsesPivotPoint = true,
+ PivotPoint = new Position(0.5f, 0.5f),
+ ParentOrigin = new Position(0.5f, 0.5f),
+ Size = new Size(300, 300),
+ BackgroundColor = Color.Red,
+ });
+ return;
if (wifiAp.NetworkInformation.ConnectionState == Tizen.Network.WiFi.WiFiConnectionState.Connected)
{
Tizen.Log.Debug("oobe", $"Already connected to {wifiAp.NetworkInformation.Essid}");