Esempio n. 1
0
        protected internal override android.view.animation.Animation clone()
        {
            android.view.animation.AnimationSet animation = (android.view.animation.AnimationSet
                                                             )base.clone();
            animation.mTempTransformation = new android.view.animation.Transformation();
            animation.mAnimations         = new java.util.ArrayList <android.view.animation.Animation>
                                                ();
            int count = mAnimations.size();

            java.util.ArrayList <android.view.animation.Animation> animations = mAnimations;
            {
                for (int i = 0; i < count; i++)
                {
                    animation.mAnimations.add(animations.get(i).clone());
                }
            }
            return(animation);
        }
Esempio n. 2
0
        /// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
        /// <exception cref="System.IO.IOException"></exception>
        private static android.view.animation.Animation createAnimationFromXml(android.content.Context
                                                                               c, org.xmlpull.v1.XmlPullParser parser, android.view.animation.AnimationSet parent
                                                                               , android.util.AttributeSet attrs)
        {
            android.view.animation.Animation anim = null;
            // Make sure we are on a start tag.
            int type;
            int depth = parser.getDepth();

            while (((type = parser.next()) != org.xmlpull.v1.XmlPullParserClass.END_TAG || parser
                    .getDepth() > depth) && type != org.xmlpull.v1.XmlPullParserClass.END_DOCUMENT)
            {
                if (type != org.xmlpull.v1.XmlPullParserClass.START_TAG)
                {
                    continue;
                }
                string name = parser.getName();
                if (name.Equals("set"))
                {
                    anim = new android.view.animation.AnimationSet(c, attrs);
                    createAnimationFromXml(c, parser, (android.view.animation.AnimationSet)anim, attrs
                                           );
                }
                else
                {
                    if (name.Equals("alpha"))
                    {
                        anim = new android.view.animation.AlphaAnimation(c, attrs);
                    }
                    else
                    {
                        if (name.Equals("scale"))
                        {
                            anim = new android.view.animation.ScaleAnimation(c, attrs);
                        }
                        else
                        {
                            if (name.Equals("rotate"))
                            {
                                anim = new android.view.animation.RotateAnimation(c, attrs);
                            }
                            else
                            {
                                if (name.Equals("translate"))
                                {
                                    anim = new android.view.animation.TranslateAnimation(c, attrs);
                                }
                                else
                                {
                                    throw new java.lang.RuntimeException("Unknown animation name: " + parser.getName(
                                                                             ));
                                }
                            }
                        }
                    }
                }
                if (parent != null)
                {
                    parent.addAnimation(anim);
                }
            }
            return(anim);
        }
Esempio n. 3
0
		/// <exception cref="org.xmlpull.v1.XmlPullParserException"></exception>
		/// <exception cref="System.IO.IOException"></exception>
		private static android.view.animation.Animation createAnimationFromXml(android.content.Context
			 c, org.xmlpull.v1.XmlPullParser parser, android.view.animation.AnimationSet parent
			, android.util.AttributeSet attrs)
		{
			android.view.animation.Animation anim = null;
			// Make sure we are on a start tag.
			int type;
			int depth = parser.getDepth();
			while (((type = parser.next()) != org.xmlpull.v1.XmlPullParserClass.END_TAG || parser
				.getDepth() > depth) && type != org.xmlpull.v1.XmlPullParserClass.END_DOCUMENT)
			{
				if (type != org.xmlpull.v1.XmlPullParserClass.START_TAG)
				{
					continue;
				}
				string name = parser.getName();
				if (name.Equals("set"))
				{
					anim = new android.view.animation.AnimationSet(c, attrs);
					createAnimationFromXml(c, parser, (android.view.animation.AnimationSet)anim, attrs
						);
				}
				else
				{
					if (name.Equals("alpha"))
					{
						anim = new android.view.animation.AlphaAnimation(c, attrs);
					}
					else
					{
						if (name.Equals("scale"))
						{
							anim = new android.view.animation.ScaleAnimation(c, attrs);
						}
						else
						{
							if (name.Equals("rotate"))
							{
								anim = new android.view.animation.RotateAnimation(c, attrs);
							}
							else
							{
								if (name.Equals("translate"))
								{
									anim = new android.view.animation.TranslateAnimation(c, attrs);
								}
								else
								{
									throw new java.lang.RuntimeException("Unknown animation name: " + parser.getName(
										));
								}
							}
						}
					}
				}
				if (parent != null)
				{
					parent.addAnimation(anim);
				}
			}
			return anim;
		}