protected override void Draw(ref Parameters.UiViewDrawParameters parameters) { float opacity = parameters.Opacity; if (opacity == 0) { return; } DrawBackground(ref parameters); if (_clipChildren) { parameters.DrawBatch.PushClip(ScreenBounds); } for (int idx = 0; idx < 2; ++idx) { UiView view = idx == 0 ? _previous : _current; float transition = _transition; if (idx == 0) { transition = 1 - transition; } if (view != null) { UiViewDrawParameters drawParams = parameters; drawParams.Opacity = opacity; TransitionEffect transitionEffect = FindTransition(idx == 0); if (transitionEffect != null) { float opacity2; Matrix transform; drawParams.Transition = transition; transitionEffect.Get(transition, ScreenBounds, view.ScreenBounds, out transform, out opacity2); drawParams.Opacity *= opacity2; drawParams.DrawBatch.PushTransform(transform); view.ViewDraw(ref drawParams); drawParams.DrawBatch.PopTransform(); } else { view.ViewDraw(ref drawParams); } } } if (_clipChildren) { parameters.DrawBatch.PopClip(); } if (_transition > 0) { AppMain.RedrawNextFrame(); } }