当前位置: 首页>>代码示例>>C#>>正文


C# android.getAnimation方法代码示例

本文整理汇总了C#中android.getAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# android.getAnimation方法的具体用法?C# android.getAnimation怎么用?C# android.getAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android的用法示例。


在下文中一共展示了android.getAnimation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: invalidateChild

		public virtual void invalidateChild(android.view.View child, android.graphics.Rect
			 dirty)
		{
			android.view.ViewParent parent = this;
			android.view.View.AttachInfo attachInfo = mAttachInfo;
			if (attachInfo != null)
			{
				// If the child is drawing an animation, we want to copy this flag onto
				// ourselves and the parent to make sure the invalidate request goes
				// through
				bool drawAnimation = (child.mPrivateFlags & DRAW_ANIMATION) == DRAW_ANIMATION;
				if (dirty == null)
				{
					if (child.mLayerType != LAYER_TYPE_NONE)
					{
						mPrivateFlags |= INVALIDATED;
						mPrivateFlags &= ~DRAWING_CACHE_VALID;
						child.mLocalDirtyRect.setEmpty();
					}
					do
					{
						android.view.View view = null;
						if (parent is android.view.View)
						{
							view = (android.view.View)parent;
							if (view.mLayerType != LAYER_TYPE_NONE)
							{
								view.mLocalDirtyRect.setEmpty();
								if (view.getParent() is android.view.View)
								{
									android.view.View grandParent = (android.view.View)view.getParent();
									grandParent.mPrivateFlags |= INVALIDATED;
									grandParent.mPrivateFlags &= ~DRAWING_CACHE_VALID;
								}
							}
							if ((view.mPrivateFlags & DIRTY_MASK) != 0)
							{
								// already marked dirty - we're done
								break;
							}
						}
						if (drawAnimation)
						{
							if (view != null)
							{
								view.mPrivateFlags |= DRAW_ANIMATION;
							}
							else
							{
								if (parent is android.view.ViewRootImpl)
								{
									((android.view.ViewRootImpl)parent).mIsAnimating = true;
								}
							}
						}
						if (parent is android.view.ViewRootImpl)
						{
							((android.view.ViewRootImpl)parent).invalidate();
							parent = null;
						}
						else
						{
							if (view != null)
							{
								if ((view.mPrivateFlags & DRAWN) == DRAWN || (view.mPrivateFlags & DRAWING_CACHE_VALID
									) == DRAWING_CACHE_VALID)
								{
									view.mPrivateFlags &= ~DRAWING_CACHE_VALID;
									view.mPrivateFlags |= DIRTY;
									parent = view.mParent;
								}
								else
								{
									parent = null;
								}
							}
						}
					}
					while (parent != null);
				}
				else
				{
					// Check whether the child that requests the invalidate is fully opaque
					bool isOpaque_1 = child.isOpaque() && !drawAnimation && child.getAnimation() == null;
					// Mark the child as dirty, using the appropriate flag
					// Make sure we do not set both flags at the same time
					int opaqueFlag = isOpaque_1 ? DIRTY_OPAQUE : DIRTY;
					if (child.mLayerType != LAYER_TYPE_NONE)
					{
						mPrivateFlags |= INVALIDATED;
						mPrivateFlags &= ~DRAWING_CACHE_VALID;
						child.mLocalDirtyRect.union(dirty);
					}
					int[] location = attachInfo.mInvalidateChildLocation;
					location[CHILD_LEFT_INDEX] = child.mLeft;
					location[CHILD_TOP_INDEX] = child.mTop;
					android.graphics.Matrix childMatrix = child.getMatrix();
					if (!childMatrix.isIdentity())
					{
						android.graphics.RectF boundingRect = attachInfo.mTmpTransformRect;
//.........这里部分代码省略.........
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:101,代码来源:ViewGroup.cs

示例2: removeDetachedView

		/// <summary>Finishes the removal of a detached view.</summary>
		/// <remarks>
		/// Finishes the removal of a detached view. This method will dispatch the detached from
		/// window event and notify the hierarchy change listener.
		/// </remarks>
		/// <param name="child">the child to be definitely removed from the view hierarchy</param>
		/// <param name="animate">
		/// if true and the view has an animation, the view is placed in the
		/// disappearing views list, otherwise, it is detached from the window
		/// </param>
		/// <seealso cref="attachViewToParent(View, int, LayoutParams)">attachViewToParent(View, int, LayoutParams)
		/// 	</seealso>
		/// <seealso cref="detachAllViewsFromParent()">detachAllViewsFromParent()</seealso>
		/// <seealso cref="detachViewFromParent(View)">detachViewFromParent(View)</seealso>
		/// <seealso cref="detachViewFromParent(int)">detachViewFromParent(int)</seealso>
		protected internal virtual void removeDetachedView(android.view.View child, bool 
			animate_1)
		{
			if (mTransition != null)
			{
				mTransition.removeChild(this, child);
			}
			if (child == mFocused)
			{
				child.clearFocus();
			}
			if ((animate_1 && child.getAnimation() != null) || (mTransitioningViews != null &&
				 mTransitioningViews.contains(child)))
			{
				addDisappearingView(child);
			}
			else
			{
				if (child.mAttachInfo != null)
				{
					child.dispatchDetachedFromWindow();
				}
			}
			onViewRemoved(child);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:40,代码来源:ViewGroup.cs

示例3: drawChild

		/// <summary>Draw one child of this View Group.</summary>
		/// <remarks>
		/// Draw one child of this View Group. This method is responsible for getting
		/// the canvas in the right state. This includes clipping, translating so
		/// that the child's scrolled origin is at 0, 0, and applying any animation
		/// transformations.
		/// </remarks>
		/// <param name="canvas">The canvas on which to draw the child</param>
		/// <param name="child">Who to draw</param>
		/// <param name="drawingTime">The time at which draw is occuring</param>
		/// <returns>True if an invalidate() was issued</returns>
		protected internal virtual bool drawChild(android.graphics.Canvas canvas, android.view.View
			 child, long drawingTime)
		{
			bool more = false;
			int cl = child.mLeft;
			int ct = child.mTop;
			int cr = child.mRight;
			int cb = child.mBottom;
			bool childHasIdentityMatrix = child.hasIdentityMatrix();
			int flags = mGroupFlags;
			if ((flags & FLAG_CLEAR_TRANSFORMATION) == FLAG_CLEAR_TRANSFORMATION)
			{
				mChildTransformation.clear();
				mGroupFlags &= ~FLAG_CLEAR_TRANSFORMATION;
			}
			android.view.animation.Transformation transformToApply = null;
			android.view.animation.Transformation invalidationTransform;
			android.view.animation.Animation a = child.getAnimation();
			bool concatMatrix = false;
			bool scalingRequired = false;
			bool caching;
			int layerType = mDrawLayers ? child.getLayerType() : LAYER_TYPE_NONE;
			bool hardwareAccelerated = canvas.isHardwareAccelerated();
			if ((flags & FLAG_CHILDREN_DRAWN_WITH_CACHE) == FLAG_CHILDREN_DRAWN_WITH_CACHE ||
				 (flags & FLAG_ALWAYS_DRAWN_WITH_CACHE) == FLAG_ALWAYS_DRAWN_WITH_CACHE)
			{
				caching = true;
				if (mAttachInfo != null)
				{
					scalingRequired = mAttachInfo.mScalingRequired;
				}
			}
			else
			{
				caching = (layerType != LAYER_TYPE_NONE) || hardwareAccelerated;
			}
			if (a != null)
			{
				bool initialized = a.isInitialized();
				if (!initialized)
				{
					a.initialize(cr - cl, cb - ct, getWidth(), getHeight());
					a.initializeInvalidateRegion(0, 0, cr - cl, cb - ct);
					child.onAnimationStart();
				}
				more = a.getTransformation(drawingTime, mChildTransformation, scalingRequired ? mAttachInfo
					.mApplicationScale : 1f);
				if (scalingRequired && mAttachInfo.mApplicationScale != 1f)
				{
					if (mInvalidationTransformation == null)
					{
						mInvalidationTransformation = new android.view.animation.Transformation();
					}
					invalidationTransform = mInvalidationTransformation;
					a.getTransformation(drawingTime, invalidationTransform, 1f);
				}
				else
				{
					invalidationTransform = mChildTransformation;
				}
				transformToApply = mChildTransformation;
				concatMatrix = a.willChangeTransformationMatrix();
				if (more)
				{
					if (!a.willChangeBounds())
					{
						if ((flags & (FLAG_OPTIMIZE_INVALIDATE | FLAG_ANIMATION_DONE)) == FLAG_OPTIMIZE_INVALIDATE)
						{
							mGroupFlags |= FLAG_INVALIDATE_REQUIRED;
						}
						else
						{
							if ((flags & FLAG_INVALIDATE_REQUIRED) == 0)
							{
								// The child need to draw an animation, potentially offscreen, so
								// make sure we do not cancel invalidate requests
								mPrivateFlags |= DRAW_ANIMATION;
								invalidate(cl, ct, cr, cb);
							}
						}
					}
					else
					{
						if (mInvalidateRegion == null)
						{
							mInvalidateRegion = new android.graphics.RectF();
						}
						android.graphics.RectF region = mInvalidateRegion;
						a.getInvalidateRegion(0, 0, cr - cl, cb - ct, region, invalidationTransform);
//.........这里部分代码省略.........
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:101,代码来源:ViewGroup.cs

示例4: removeViewInternal

		private void removeViewInternal(int index, android.view.View view)
		{
			if (mTransition != null)
			{
				mTransition.removeChild(this, view);
			}
			bool clearChildFocus_1 = false;
			if (view == mFocused)
			{
				view.clearFocusForRemoval();
				clearChildFocus_1 = true;
			}
			if (view.getAnimation() != null || (mTransitioningViews != null && mTransitioningViews
				.contains(view)))
			{
				addDisappearingView(view);
			}
			else
			{
				if (view.mAttachInfo != null)
				{
					view.dispatchDetachedFromWindow();
				}
			}
			onViewRemoved(view);
			needGlobalAttributesUpdate(false);
			removeFromArray(index);
			if (clearChildFocus_1)
			{
				clearChildFocus(view);
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:32,代码来源:ViewGroup.cs

示例5: canViewReceivePointerEvents

		/// <summary>Returns true if a child view can receive pointer events.</summary>
		/// <remarks>Returns true if a child view can receive pointer events.</remarks>
		/// <hide></hide>
		private static bool canViewReceivePointerEvents(android.view.View child)
		{
			return (child.mViewFlags & VISIBILITY_MASK) == VISIBLE || child.getAnimation() !=
				 null;
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:8,代码来源:ViewGroup.cs


注:本文中的android.getAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。