protected override void ApplyTransformation(float interpolatedTime, Transformation t) { // Angle around the y-axis of the rotation at the given time // calculated both in radians and degrees. double radians = Math.PI*interpolatedTime; float degrees = (float) (180.0*radians/Math.PI); // Once we reach the midpoint in the animation, we need to hide the // source view and show the destination view. We also need to change // the angle by 180 degrees so that the destination does not come in // flipped around if (interpolatedTime >= 0.5f) { degrees -= 180f; fromView.Visibility = ViewStates.Gone; toView.Visibility = ViewStates.Visible; } if (forward) degrees = -degrees; //determines direction of rotation when flip begins Matrix matrix = t.Matrix; camera.Save(); camera.RotateY(degrees); camera.GetMatrix(matrix); camera.Restore(); matrix.PreTranslate(-centerX, -centerY); matrix.PostTranslate(centerX, centerY); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { float fromDegrees = _fromDegrees; float degrees = fromDegrees + ((_toDegrees - fromDegrees) * interpolatedTime); Camera camera = _camera; Matrix matrix = t.Matrix; camera.Save(); if (Direction == Direction.X) { camera.RotateX(degrees); } else { camera.RotateY(degrees); } camera.GetMatrix(matrix); camera.Restore(); matrix.PreTranslate(-_centerX, -_centerY); matrix.PostTranslate(_centerX, _centerY); matrix.PreScale(_scaleType.GetScale(_scale, interpolatedTime), _scaleType.GetScale(_scale, interpolatedTime), _centerX, _centerY); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { view.LayoutParameters.Height = (int)(startHeight + (deltaHeight * interpolatedTime)); view.SetY(startPosition + (deltaPosition * interpolatedTime)); view.RequestLayout(); if (Math.Abs(interpolatedTime - 1.0f) < .1 && interpolatedTime > 0.5f) { //Console.WriteLine("Anim ended"); if (isStarting && !isReset) { view.LayoutParameters.Height = ViewGroup.LayoutParams.MatchParent; view.RequestLayout(); } else if (!isReset) { view.LayoutParameters.Height = 0; view.RequestLayout(); } else if (isReset) { view.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 0, 1); view.RequestLayout(); } else { } } }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { var height = (this._toHeight - this._fromHeight) * interpolatedTime + this._fromHeight; var width = (this._toWidth - this._fromWidth) * interpolatedTime + this._fromWidth; var layoutParams = this._view.LayoutParameters; layoutParams.Height = (int)height; layoutParams.Width = (int)width; this._view.RequestLayout(); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { Ring ring = mProgressDrawable.Ring; if (mProgressDrawable.Finishing) { mProgressDrawable.ApplyFinishTranslation(interpolatedTime, ring); } else { float minProgressArc = (float)Java.Lang.Math.ToRadians(ring.StrokeWidth / (2 * Math.PI * ring.RingCenterRadius)); float startingEndTrim = ring.StartingEndTrim; float startingTrim = ring.StartingStartTrim; float startingRotation = ring.GetStartingRotation(); float minArc = MaterialProgressDrawale.MAX_PROGRESS_ARC - minProgressArc; float endTrim = startingEndTrim + (minArc * START_CURVE_INTERPOLATOR.GetInterpolation(interpolatedTime)); float startTrim = startingTrim + (MaterialProgressDrawale.MAX_PROGRESS_ARC * END_CURVE_INTERPOLATOR.GetInterpolation(interpolatedTime)); float sweepTrim = endTrim - StartTime; if (Math.Abs(sweepTrim) >= 1) { endTrim = startingTrim + 0.5f; } ring.EndTrim = endTrim; ring.StartTrim = startingTrim; float rotation = startingRotation + (0.25f * interpolatedTime); ring.Rotation = rotation; float groupRotation = ((720.0f / MaterialProgressDrawale.NUM_POINTS) * interpolatedTime) + (720.0f * (mProgressDrawable.RotationCount / MaterialProgressDrawale.NUM_POINTS)); mProgressDrawable.SetRotation(groupRotation); } base.ApplyTransformation(interpolatedTime, t); }
protected override void ApplyTransformation (float interpolatedTime, Transformation t) { float fromDegrees = from_degrees; float degrees = fromDegrees + ((to_degrees - fromDegrees) * interpolatedTime); float centerX = center_x; float centerY = center_y; Matrix matrix = t.Matrix; camera.Save (); if (reverse) camera.Translate (0.0f, 0.0f, depth_z * interpolatedTime); else camera.Translate (0.0f, 0.0f, depth_z * (1.0f - interpolatedTime)); camera.RotateY (degrees); camera.GetMatrix (matrix); camera.Restore (); matrix.PreTranslate (-centerX, -centerY); matrix.PostTranslate (centerX, centerY); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { mView.LayoutParameters.Height = (int)(mOriginalHeight + (mGrowBy * interpolatedTime)); mView.RequestLayout(); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { var x = random.NextFloat() - 0.5f; var y = random.NextFloat() - 0.5f; t.Matrix.SetTranslate(x * horizontal, y * vertical); }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { float degrees = mFromDegrees + ((mToDegrees - mFromDegrees) * interpolatedTime); if (mPivotX == 0.0f && mPivotY == 0.0f) { t.Matrix.SetRotate(degrees); } else { t.Matrix.SetRotate(degrees, mPivotX, mPivotY); } float dx = mFromXDelta; float dy = mFromYDelta; if (mFromXDelta != mToXDelta) { dx = mFromXDelta + ((mToXDelta - mFromXDelta) * interpolatedTime); } if (mFromYDelta != mToYDelta) { dy = mFromYDelta + ((mToYDelta - mFromYDelta) * interpolatedTime); } t.Matrix.PostTranslate(dx, dy); }
protected override void ApplyTransformation (float interpolatedTime, Transformation t) { base.ApplyTransformation (interpolatedTime, t); //view.LayoutParameters = LinearLayout.LayoutParams.FillParent }
protected override void ApplyTransformation(float interpolatedTime, Transformation t) { base.ApplyTransformation (interpolatedTime, t); if (interpolatedTime < 1) { if (_type == ExpandCollapseAnimationType.Expand) { _layoutParams.BottomMargin = -_endHeight + (int)(_endHeight * interpolatedTime); } else { _layoutParams.BottomMargin = -(int)(_endHeight * interpolatedTime); } _animationView.RequestLayout(); } else { if (_type == ExpandCollapseAnimationType.Expand) { _layoutParams.BottomMargin = 0; } else { _layoutParams.BottomMargin = -_endHeight; _animationView.Visibility = ViewStates.Gone; } _animationView.RequestLayout(); } }