private async Task HideInternalAsync()
        {
            if (_listItem == null)
            {
                _animating = false;
                return;
            }

            var innerBatch = _compositor.CreateScopedBatch(CompositionBatchTypes.Animation);

            await ToggleListItemAnimationAsync(false);

            innerBatch.Completed += (ss, exx) =>
            {
                if (_listItem != null)
                {
                    _listItem.GetVisual().Opacity = 1f;
                    _listItem = null;
                }

                OnHidden?.Invoke(this, new EventArgs());
                ToggleDetailGridAnimation(false);
                FlipperControl.DisplayIndex = (int)DownloadStatus.Pending;

                _animating = false;
            };
            innerBatch.End();
        }
Ejemplo n.º 2
0
        public static void Hide()
        {
            if (menuView_ != null)
            {
                ObjectPoolManager.Recycle(menuView_);
                menuView_ = null;
            }

            OnHidden.Invoke();
        }
Ejemplo n.º 3
0
        private static void HandlePopupRecycled()
        {
            if (popup_ == null)
            {
                return;
            }

            popup_.OnRecycled -= HandlePopupRecycled;
            popup_             = null;
            OnHidden.Invoke();
        }
Ejemplo n.º 4
0
        IEnumerator ShowUntilTrigger()
        {
            while (_show)
            {
                yield return(null);
            }
            _animator.SetTrigger(Hide);

            yield return(new WaitForSeconds(_animator.GetCurrentAnimatorStateInfo(0).length));

            OnHidden?.Invoke();
        }
Ejemplo n.º 5
0
 private void hide()
 {
     _base.SetActive(false);
     OnHidden?.Invoke();
     _displaying = false;
 }
Ejemplo n.º 6
0
        private void Init()
        {
            // Make the menu fit within the parent's object.
            Anchor = AnchorType.Fill;
            Offset = Offset.Zero;

            var blocker = CreateChild <Blocker>("blocker", 0);

            {
                blocker.OnTriggered += CloseMenu;
            }
            holder = CreateChild("holder", 1);
            {
                holder.Size = new Vector2(ContainerWidth, 0f);

                aniHolder = holder.CreateChild("ani-holder", 0);
                {
                    aniHolder.Anchor = AnchorType.Fill;
                    aniHolder.Offset = Offset.Zero;

                    canvasGroup       = aniHolder.RawObject.AddComponent <CanvasGroup>();
                    canvasGroup.alpha = 0f;

                    shadow = aniHolder.CreateChild <UguiSprite>("shadow", 0);
                    {
                        shadow.Anchor     = AnchorType.Fill;
                        shadow.Offset     = new Offset(-7f);
                        shadow.SpriteName = "glow-circle-16";
                        shadow.ImageType  = Image.Type.Sliced;
                        shadow.Color      = Color.black;
                    }
                    listContainer = aniHolder.CreateChild <UguiListView>("list", 1);
                    {
                        listContainer.Anchor = AnchorType.Fill;
                        listContainer.Offset = Offset.Zero;
                        listContainer.Background.SpriteName = "circle-16";
                        listContainer.Background.ImageType  = Image.Type.Sliced;
                        listContainer.Background.Color      = new Color(0f, 0f, 0f, 0.75f);

                        listContainer.Initialize(OnCreateMenuItem, OnUpdateMenuItem);
                        listContainer.CellSize = ItemSize;
                        listContainer.Corner   = GridLayoutGroup.Corner.UpperLeft;
                        listContainer.Axis     = GridLayoutGroup.Axis.Vertical;
                    }
                }
            }

            showAni = new Anime();
            showAni.AddEvent(0f, () => Active           = true);
            showAni.AnimateFloat(a => canvasGroup.alpha = a)
            .AddTime(0f, () => canvasGroup.alpha)
            .AddTime(0.25f, 1f)
            .Build();
            showAni.AnimateFloat(y => aniHolder.Y = y)
            .AddTime(0f, MoveAniAmount, EaseType.QuadEaseOut)
            .AddTime(0.25f, 0f)
            .Build();

            hideAni = new Anime();
            hideAni.AnimateFloat(a => canvasGroup.alpha = a)
            .AddTime(0f, () => canvasGroup.alpha)
            .AddTime(0.25f, 0f)
            .Build();
            hideAni.AnimateFloat(y => aniHolder.Y = y)
            .AddTime(0f, 0f, EaseType.QuadEaseOut)
            .AddTime(0.25f, MoveAniAmount)
            .Build();
            hideAni.AddEvent(hideAni.Duration, () =>
            {
                OnHidden?.Invoke(this);
                Active = false;
            });
        }
Ejemplo n.º 7
0
 public void OnShownOut()
 {
     OnHidden?.Invoke();
     gameObject.SetActive(false);
 }