Ejemplo n.º 1
0
        public Dialog()
        {
            _dialog = DependencyService.Get <IDialog>(DependencyFetchTarget.NewInstance);
            if (_dialog == null)
            {
                throw new Exception("Object reference not set to an instance of a Dialog.");
            }

            _dialog.Hidden += (s, e) =>
            {
                Hidden?.Invoke(this, EventArgs.Empty);
            };

            _dialog.OutsideClicked += (s, e) =>
            {
                OutsideClicked?.Invoke(this, EventArgs.Empty);
            };

            _dialog.Shown += (s, e) =>
            {
                Shown?.Invoke(this, EventArgs.Empty);
            };

            _dialog.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(ContentProperty, new Binding(nameof(Content), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(PositiveProperty, new Binding(nameof(Positive), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(NeutralProperty, new Binding(nameof(Neutral), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(NegativeProperty, new Binding(nameof(Negative), mode: BindingMode.OneWayToSource, source: _dialog));
            SetBinding(TitleProperty, new Binding(nameof(Title), mode: BindingMode.OneWayToSource, source: _dialog));
        }
        //private Naviframe _naviframe;

        /// <summary>
        /// Initializes a new instance of the Window class.
        /// </summary>
        public ReactWindow(string name) : base(name)
        {
            Log.Info(ReactConstants.Tag, "## Contruct ReactWindow [BGN] ## ");

            // size
            //var size = ScreenSize;
            //Resize(size.Width, size.Height);
            //BackgroundColor = Color.Gray;

            // events

            /*
             * Deleted += (sender, e) =>
             * {
             *  Closed?.Invoke(this, EventArgs.Empty);
             * };
             * CloseRequested += (sender, e) =>
             * {
             *  Unrealize();
             * };
             *
             * KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
             * KeyUp += (s, e) =>
             * {
             *  if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
             *  {
             *      BackButtonPressed?.Invoke(this, EventArgs.Empty);
             *  }
             * };
             */
            // active window
            //Active();

            //AutoDeletion = false;   // f**k off here
            //Show();
            this.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
            this.KeyGrab("XF86Red", false);
            this.KeyUp += (s, e) =>
            {
                if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
                {
                    Log.Info(ReactConstants.Tag, "============================Back key is pressed");
                    BackButtonPressed?.Invoke(this, EventArgs.Empty);
                }
                else if (e.KeyName == "XF86Red")
                {
                    Log.Info(ReactConstants.Tag, "============================Red key is pressed");
                    RedButtonPressed?.Invoke(this, EventArgs.Empty);
                }
            };
            // conformant container
            _conformant = new Conformant(this);
            _conformant.SetAlignment(-1.0, -1.0);   // fill
            _conformant.SetWeight(1.0, 1.0);        // expand
            _conformant.Show();

            Log.Info(ReactConstants.Tag, "## Contruct ReactWindow [END] ## ");
            //
            // Initialize();
        }
Ejemplo n.º 3
0
 void IObservable <BackButtonPressedArgs> .Notify(BackButtonPressedArgs eventArgs)
 {
     if (BackButtonPressed != null)
     {
         BackButtonPressed.Invoke(this, eventArgs);
     }
 }
Ejemplo n.º 4
0
        protected override bool OnBackButtonPressed()
        {
            if (EnableBackButton && LockInteraction())
            {
                OnBackButtonPressedAnimations().ContinueWith((t) => { BackButtonPressed?.Invoke(); ReleaseInteraction(); });
            }

            return(BackButtonPressed != null || base.OnBackButtonPressed());
        }
Ejemplo n.º 5
0
        public override void OnBackPressed()
        {
            if (BackButtonEnabled)
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);

                base.OnBackPressed();
            }
        }
        protected override void BackButtonWasPressed(ViewController topViewController)
        {
            BeatmapDetailsLoader.instance.StopLoading();

            // filter will be re-selected during the LoadBeatmaps on finish handler, which will re-install this delegate
            if (_currentFilter != null)
            {
                _currentFilter.SettingChanged -= FilterSettingChanged;
            }

            BackButtonPressed?.Invoke();
        }
Ejemplo n.º 7
0
        public IEnumerator LoadSetupCloseBackButtons()
        {
            if (YUR.Yur.YURAssetBundle == null)
            {
                string URI = "file:///" + Application.dataPath + "/AssetBundles/" + YUR.Yur.assetBundleName;
                UnityEngine.Networking.UnityWebRequest request = UnityEngine.Networking.UnityWebRequestAssetBundle.GetAssetBundle(URI, 0);
                yield return(request.SendWebRequest());

                if (request.error != null)
                {
                    yield break;
                }
                else
                {
                    YUR_Log.Log("Local asset bundle found!");
                    yield return(YUR.Yur.YURAssetBundle = DownloadHandlerAssetBundle.GetContent(request));
                }
            }

            var temppp = YUR.Yur.YURAssetBundle.LoadAsset <GameObject>("YUR Back Button");

            yield return(BackButton = Instantiate(temppp, gameObject.transform));

            // BackButton = (GameObject)Instantiate(Resources.Load("YUR Back Button"), gameObject.transform);
            BackButton.GetComponent <Button>().onClick.AddListener(delegate
            {
                if (BackButtonPressed != null)
                {
                    BackButtonPressed.Invoke();
                }
                YURScreenCoordinator.ScreenCoordinator.BackButtonPressed();
            });


            temppp = YUR.Yur.YURAssetBundle.LoadAsset <GameObject>("YUR Close Button");
            yield return(CloseButton = Instantiate(temppp, gameObject.transform));

            // CloseButton = (GameObject)Instantiate(Resources.Load("YUR Close Button"), gameObject.transform);

            CloseButton.GetComponent <Button>().onClick.AddListener(delegate
            {
                if (CloseButtonPressed != null)
                {
                    CloseButtonPressed.Invoke();
                }
                YURScreenCoordinator.ScreenCoordinator.CloseButtonPressed();
            });
            if (Finished != null)
            {
                Finished.Invoke();
            }
        }
Ejemplo n.º 8
0
 protected override bool OnBackButtonPressed()
 {
     try
     {
         BackButtonPressed?.Invoke();
     }
     catch (System.Exception ex)
     {
         string title = this.GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name;
         BalizaFacil.App.Instance.UnhandledException(title, ex);
     }
     return(true);
 }
Ejemplo n.º 9
0
        protected override void BackButtonWasPressed(ViewController topViewController)
        {
            if (!_readyForDeactivation)
            {
                return;
            }

            _lastSearchQuery = _searchQuery;

            SearchBehaviour.Instance.StopSearch();
            _searchResultsListViewController.UpdateSongs(new IPreviewBeatmapLevel[0]);
            PopAllViewControllersFromNavigationController(true);

            BackButtonPressed?.Invoke();
        }
 private async void OnBackButtonClicked(object sender, EventArgs e)
 {
     if (BackButtonPressed != null)
     {
         bool popout = BackButtonPressed.Invoke(sender, e);
         if (popout)
         {
             await PopNavigationAsync();
         }
     }
     else
     {
         await PopNavigationAsync();
     }
 }
Ejemplo n.º 11
0
        // -----------------------------------------------------------------------------

        // Overrides
        public override void OnBackPressed()
        {
            bool isBackPressConsumed = !BackButtonEnabled;

            if (/*isBackPressConsumed == false &&*/ GetCurrentFragment() is FragmentBase currentFragment)
            {
                isBackPressConsumed = currentFragment.OnBackPressed();
            }

            if (isBackPressConsumed == false)
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);

                base.OnBackPressed();
            }
        }
        void Initialize()
        {
            this.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, false);
            this.KeyGrab("XF86Red", false);
            this.KeyUp += (s, e) =>
            {
                if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName)
                {
                    Log.Info(ReactConstants.Tag, "============================Back key is pressed");
                    BackButtonPressed?.Invoke(this, EventArgs.Empty);
                }
                else if (e.KeyName == "XF86Red")
                {
                    Log.Info(ReactConstants.Tag, "============================Red key is pressed");
                    RedButtonPressed?.Invoke(this, EventArgs.Empty);
                }
            };
            // conformant container
            _conformant = new Conformant(this);
            _conformant.SetAlignment(-1.0, -1.0);   // fill
            _conformant.SetWeight(1.0, 1.0);        // expand
            _conformant.Show();

            #region "Navigator navigator container "

            /*
             * _naviframe = new Naviframe(this)
             * {
             *  PreserveContentOnPop = true,
             *  DefaultBackButtonEnabled = true
             * };
             *
             * _naviframe.Popped += (s, e) =>
             * {
             *  Log.Info(ReactConstants.Tag, "Naviframe was popped: "+(int)(IntPtr)e.Content);
             * };
             *
             * _naviframe.Show();
             *
             * // include navi
             * _conformant.SetContent(_naviframe);
             */
            #endregion
            AvailableOrientations = DisplayOrientations.Portrait | DisplayOrientations.Landscape | DisplayOrientations.PortraitFlipped | DisplayOrientations.LandscapeFlipped;
        }
Ejemplo n.º 13
0
        public InformationPopup()
        {
            _popUp = DependencyService.Get <InformationPopup>(DependencyFetchTarget.NewInstance);
            if (_popUp == null)
            {
                throw new InvalidOperationException("Object reference not set to an instance of a Popup.");
            }

            _popUp.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(IsProgressRunningProperty, new Binding(nameof(IsProgressRunning), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(BottomButtonProperty, new Binding(nameof(BottomButton), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(TitleProperty, new Binding(nameof(Title), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(TextProperty, new Binding(nameof(Text), mode: BindingMode.OneWayToSource, source: _popUp));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Creates and initializes a new instance of the TwoButtonPopup class.
        /// </summary>
        /// <since_tizen> 4 </since_tizen>
        public TwoButtonPopup()
        {
            _popUp = DependencyService.Get <ITwoButtonPopup>(DependencyFetchTarget.NewInstance);
            if (_popUp == null)
            {
                throw new Exception("Object reference not set to an instance of a Popup.");
            }

            _popUp.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(ContentProperty, new Binding(nameof(Content), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(FirstButtonProperty, new Binding(nameof(FirstButton), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(SecondButtonProperty, new Binding(nameof(SecondButton), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(TitleProperty, new Binding(nameof(Title), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(TextProperty, new Binding(nameof(Text), mode: BindingMode.OneWayToSource, source: _popUp));
        }
Ejemplo n.º 15
0
        // Constructor
        public GraphicPopUp()
        {
            _popUp = DependencyService.Get <IGraphicPopup>(DependencyFetchTarget.NewInstance);
            if (_popUp == null)
            {
                throw new Exception("Object reference not set to an instance of a Popup.");
            }

            _popUp.BackButtonPressed += (s, e) =>
            {
                BackButtonPressed?.Invoke(this, EventArgs.Empty);
            };

            _popUp.TimedOut += (s, e) =>
            {
                TimedOut?.Invoke(this, EventArgs.Empty);
            };

            SetBinding(TextProperty, new Binding(nameof(Text), mode: BindingMode.OneWayToSource, source: _popUp));
            SetBinding(DurationProperty, new Binding(nameof(Duration), mode: BindingMode.OneWayToSource, source: _popUp));
        }
 public static void FireBackButtonPressed()
 {
     BackButtonPressed?.Invoke(null, new EventArgs());
 }
Ejemplo n.º 17
0
 void BackButtonPressedHandler(object sender, EventArgs e)
 {
     BackButtonPressed?.Invoke(this, EventArgs.Empty);
 }
 protected override bool OnBackButtonPressed()
 {
     BackButtonPressed?.Invoke(this, new EventArgs());
     return(base.OnBackButtonPressed());
 }
Ejemplo n.º 19
0
 private void OnBackButtonPressed()
 {
     BackButtonPressed?.Invoke();
 }
 private void BackButtonPressedHandler(object sender, EventArgs e)
 {
     Console.WriteLine("[GraphicPopUpRenderer.BackButtonPressedHandler] ");
     BackButtonPressed?.Invoke(this, EventArgs.Empty);
     _popUp.Dismiss();
 }