private Command AndroidNativeFlipBackToFront(FilppableContentViewXF newElementInstance) { return(new Command(() => { SetCameraDistance(_cameraDistance); ObjectAnimator animateYAxis180To270 = ObjectAnimator.OfFloat(this, "RotationY", 180f, 270f); animateYAxis180To270.SetDuration(300); animateYAxis180To270.Start(); animateYAxis180To270.Update += (sender, args) => { // On every animation Frame we have to update the Camera Distance since Xamarin overrides it somewhere SetCameraDistance(_cameraDistance); }; animateYAxis180To270.AnimationEnd += (sender, args) => { newElementInstance. SwitchViewsFlipFromBackToFront(); ObjectAnimator animateYAxis270To360 = ObjectAnimator.OfFloat(this, "RotationY", 270f, 360f); animateYAxis270To360.SetDuration(300); animateYAxis270To360.Start(); animateYAxis270To360.Update += (sender1, args1) => { // On every animation Frame we have to update the Camera Distance since Xamarin overrides it somewhere SetCameraDistance(_cameraDistance); }; }; })); }
private Command AndroidNativeFlipFrontToBack(FilppableContentViewXF newElementInstance) { return(new Command(() => { AnimateFlipHorizontally(newElementInstance, true); })); }
private Command AndroidNativeFlipBackToFront(FilppableContentViewXF newElementInstance) { return(new Command(() => { this.RotationY = 0; AnimateFlipHorizontally(newElementInstance, false); })); }
private Command AndroidNativeFlipBackToFront(FilppableContentViewXF newElementInstance) { return(new Command(() => { AnimateFlipHorizontally(NativeView, false, 0.5, () => { newElementInstance.SwitchViewsFlipFromBackToFront(); AnimateFlipHorizontally(NativeView, true, 0.5, null); }); })); }
private void AnimateFlipHorizontally(FilppableContentViewXF newElementInstance, bool isFrontToBack) { SetCameraDistance(_cameraDistance); ObjectAnimator animateYAxis0To90 = ObjectAnimator.OfFloat(this, "RotationY", 0.0f, -90f); animateYAxis0To90.SetDuration(500); animateYAxis0To90.Start(); animateYAxis0To90.Update += (sender, args) => { // On every animation Frame we have to update the Camera Distance since Xamarin overrides it somewhere SetCameraDistance(_cameraDistance); }; animateYAxis0To90.AnimationEnd += (sender, args) => { if (isFrontToBack) { newElementInstance.SwitchViewsFlipFromFrontToBack(); } else { newElementInstance.SwitchViewsFlipFromBackToFront(); } this.RotationY = -270; ObjectAnimator animateYAxis90To180 = ObjectAnimator.OfFloat(this, "RotationY", -270f, -360f); animateYAxis90To180.SetDuration(500); animateYAxis90To180.Start(); animateYAxis90To180.Update += (sender1, args1) => { // On every animation Frame we have to update the Camera Distance since Xamarin overrides it somewhere SetCameraDistance(_cameraDistance); }; }; }