Example #1
0
		protected internal override bool getChildStaticTransformation(android.view.View child
			, android.view.animation.Transformation t)
		{
			t.clear();
			t.setAlpha(child == mSelectedChild ? 1.0f : mUnselectedAlpha);
			return true;
		}
Example #2
0
		protected internal override void applyTransformation(float interpolatedTime, android.view.animation.Transformation
			 t)
		{
			float alpha = mFromAlpha;
			t.setAlpha(alpha + ((mToAlpha - alpha) * interpolatedTime));
		}
Example #3
0
		internal override void transformViewForTransition(int fromIndex, int toIndex, android.view.View
			 view, bool animate_1)
		{
			if (!animate_1)
			{
				((android.widget.StackView.StackFrame)view).cancelSliderAnimator();
				view.setRotationX(0f);
				android.widget.StackView.LayoutParams lp = (android.widget.StackView.LayoutParams
					)view.getLayoutParams();
				lp.setVerticalOffset(0);
				lp.setHorizontalOffset(0);
			}
			if (fromIndex == -1 && toIndex == getNumActiveViews() - 1)
			{
				transformViewAtIndex(toIndex, view, false);
				view.setVisibility(VISIBLE);
				view.setAlpha(1.0f);
			}
			else
			{
				if (fromIndex == 0 && toIndex == 1)
				{
					((android.widget.StackView.StackFrame)view).cancelSliderAnimator();
					view.setVisibility(VISIBLE);
					int duration = Sharpen.Util.Round(mStackSlider.getDurationForNeutralPosition(mYVelocity
						));
					android.widget.StackView.StackSlider animationSlider = new android.widget.StackView
						.StackSlider(this, mStackSlider);
					animationSlider.setView(view);
					if (animate_1)
					{
						android.animation.PropertyValuesHolder slideInY = android.animation.PropertyValuesHolder
							.ofFloat("YProgress", 0.0f);
						android.animation.PropertyValuesHolder slideInX = android.animation.PropertyValuesHolder
							.ofFloat("XProgress", 0.0f);
						android.animation.ObjectAnimator slideIn = android.animation.ObjectAnimator.ofPropertyValuesHolder
							(animationSlider, slideInX, slideInY);
						slideIn.setDuration(duration);
						slideIn.setInterpolator(new android.view.animation.LinearInterpolator());
						((android.widget.StackView.StackFrame)view).setSliderAnimator(slideIn);
						slideIn.start();
					}
					else
					{
						animationSlider.setYProgress(0f);
						animationSlider.setXProgress(0f);
					}
				}
				else
				{
					if (fromIndex == 1 && toIndex == 0)
					{
						((android.widget.StackView.StackFrame)view).cancelSliderAnimator();
						int duration = Sharpen.Util.Round(mStackSlider.getDurationForOffscreenPosition(mYVelocity
							));
						android.widget.StackView.StackSlider animationSlider = new android.widget.StackView
							.StackSlider(this, mStackSlider);
						animationSlider.setView(view);
						if (animate_1)
						{
							android.animation.PropertyValuesHolder slideOutY = android.animation.PropertyValuesHolder
								.ofFloat("YProgress", 1.0f);
							android.animation.PropertyValuesHolder slideOutX = android.animation.PropertyValuesHolder
								.ofFloat("XProgress", 0.0f);
							android.animation.ObjectAnimator slideOut = android.animation.ObjectAnimator.ofPropertyValuesHolder
								(animationSlider, slideOutX, slideOutY);
							slideOut.setDuration(duration);
							slideOut.setInterpolator(new android.view.animation.LinearInterpolator());
							((android.widget.StackView.StackFrame)view).setSliderAnimator(slideOut);
							slideOut.start();
						}
						else
						{
							animationSlider.setYProgress(1.0f);
							animationSlider.setXProgress(0f);
						}
					}
					else
					{
						if (toIndex == 0)
						{
							view.setAlpha(0.0f);
							view.setVisibility(INVISIBLE);
						}
						else
						{
							if ((fromIndex == 0 || fromIndex == 1) && toIndex > 1)
							{
								view.setVisibility(VISIBLE);
								view.setAlpha(1.0f);
								view.setRotationX(0f);
								android.widget.StackView.LayoutParams lp = (android.widget.StackView.LayoutParams
									)view.getLayoutParams();
								lp.setVerticalOffset(0);
								lp.setHorizontalOffset(0);
							}
							else
							{
								if (fromIndex == -1)
								{
									view.setAlpha(1.0f);
									view.setVisibility(VISIBLE);
								}
								else
								{
									if (toIndex == -1)
									{
										if (animate_1)
										{
											postDelayed(new _Runnable_294(view), STACK_RELAYOUT_DURATION);
										}
										else
										{
											view.setAlpha(0f);
										}
									}
								}
							}
						}
					}
				}
			}
			// Implement the faked perspective
			if (toIndex != -1)
			{
				transformViewAtIndex(toIndex, view, animate_1);
			}
		}