Exemplo n.º 1
0
 public void ToggleView()
 {
     if (iAnimating)
     {
         return;
     }
     iAnimating = true;
     if (iIsShowingMasterView)
     {
         Assert.Check(iDetailView != null);
         InAnimation  = CreateTranslateAnimation(1, 0);
         OutAnimation = CreateTranslateAnimation(0, -1);
         OutAnimation.SetAnimationListener(this);
         iIsShowingMasterView = false;
     }
     else
     {
         Assert.Check(iMasterView != null);
         iIsShowingMasterView = true;
         InAnimation          = CreateTranslateAnimation(-1, 0);
         OutAnimation         = CreateTranslateAnimation(0, 1);
         OutAnimation.SetAnimationListener(this);
     }
     ShowNext();
 }
Exemplo n.º 2
0
 public void Show()
 {
     state = ElementState.Showing;
     OutAnimation?.Reset();
     SaveProperties();
     InAnimation?.Play(false);
     InAnimation?.Apply(ref props);
 }
Exemplo n.º 3
0
 public void Reset()
 {
     state = ElementState.Idle;
     InAnimation?.Reset();
     OutAnimation?.Reset();
     InAnimation?.Apply(ref props);
     OutAnimation?.Apply(ref props);
     SaveProperties();
 }
Exemplo n.º 4
0
 public void Hide()
 {
     state = ElementState.Hiding;
     InAnimation?.Reset();
     SaveProperties();
     OutAnimation?.Play(true);
     OutAnimation?.Apply(ref props);
     if (OutAnimation != null)
     {
         OutAnimation.OnFinished += ZeroProperties;
     }
 }
Exemplo n.º 5
0
        public virtual JObject ToJson()
        {
            JObject ob = new JObject();

            ob["bounds"]    = new JArray(Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height);
            ob["margin"]    = new JArray(Margin);
            ob["drawOrder"] = DrawOrder;
            ob["opacity"]   = Opacity;
            ob["visible"]   = Visible;
            if (InAnimation != null)
            {
                ob["in"] = InAnimation.ToJson();
            }
            if (OutAnimation != null)
            {
                ob["out"] = OutAnimation.ToJson();
            }
            return(ob);
        }
Exemplo n.º 6
0
 public void Out()
 {
     OutAnimation.Begin();
 }