/// <summary>Creates a new layout animation controller from external resources.</summary> /// <remarks>Creates a new layout animation controller from external resources.</remarks> /// <param name="context"> /// the Context the view group is running in, through which /// it can access the resources /// </param> /// <param name="attrs"> /// the attributes of the XML tag that is inflating the /// layout animation controller /// </param> public LayoutAnimationController(android.content.Context context, android.util.AttributeSet attrs) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.LayoutAnimation); android.view.animation.Animation.Description d = android.view.animation.Animation .Description.parseValue(a.peekValue([email protected]_delay )); mDelay = d.value; mOrder = a.getInt([email protected]_animationOrder, ORDER_NORMAL ); int resource = a.getResourceId([email protected]_animation , 0); if (resource > 0) { setAnimation(context, resource); } resource = a.getResourceId([email protected]_interpolator , 0); if (resource > 0) { setInterpolator(context, resource); } a.recycle(); }
/// <summary>Creates a new grid layout animation controller from external resources.</summary> /// <remarks>Creates a new grid layout animation controller from external resources.</remarks> /// <param name="context"> /// the Context the view group is running in, through which /// it can access the resources /// </param> /// <param name="attrs"> /// the attributes of the XML tag that is inflating the /// layout animation controller /// </param> public GridLayoutAnimationController(android.content.Context context, android.util.AttributeSet attrs) : base(context, attrs) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.GridLayoutAnimation); android.view.animation.Animation.Description d = android.view.animation.Animation .Description.parseValue(a.peekValue([email protected]_columnDelay )); mColumnDelay = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.GridLayoutAnimation_rowDelay)); mRowDelay = d.value; //noinspection PointlessBitwiseExpression mDirection = a.getInt([email protected]_direction , DIRECTION_LEFT_TO_RIGHT | DIRECTION_TOP_TO_BOTTOM); mDirectionPriority = a.getInt([email protected]_directionPriority , PRIORITY_NONE); a.recycle(); }
/// <summary>Constructor used when a RotateAnimation is loaded from a resource.</summary> /// <remarks>Constructor used when a RotateAnimation is loaded from a resource.</remarks> /// <param name="context">Application context to use</param> /// <param name="attrs">Attribute set from which to read values</param> public RotateAnimation(android.content.Context context, android.util.AttributeSet attrs) : base(context, attrs) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.RotateAnimation); mFromDegrees = a.getFloat([email protected]_fromDegrees , 0.0f); mToDegrees = a.getFloat([email protected]_toDegrees, 0.0f); android.view.animation.Animation.Description d = android.view.animation.Animation .Description.parseValue(a.peekValue([email protected]_pivotX )); mPivotXType = d.type; mPivotXValue = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.RotateAnimation_pivotY)); mPivotYType = d.type; mPivotYValue = d.value; a.recycle(); }
/// <summary>Constructor used when a TranslateAnimation is loaded from a resource.</summary> /// <remarks>Constructor used when a TranslateAnimation is loaded from a resource.</remarks> /// <param name="context">Application context to use</param> /// <param name="attrs">Attribute set from which to read values</param> public TranslateAnimation(android.content.Context context, android.util.AttributeSet attrs) : base(context, attrs) { android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.TranslateAnimation); android.view.animation.Animation.Description d = android.view.animation.Animation .Description.parseValue(a.peekValue([email protected]_fromXDelta )); mFromXType = d.type; mFromXValue = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.TranslateAnimation_toXDelta)); mToXType = d.type; mToXValue = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.TranslateAnimation_fromYDelta)); mFromYType = d.type; mFromYValue = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.TranslateAnimation_toYDelta)); mToYType = d.type; mToYValue = d.value; a.recycle(); }
/// <summary>Constructor used when a ScaleAnimation is loaded from a resource.</summary> /// <remarks>Constructor used when a ScaleAnimation is loaded from a resource.</remarks> /// <param name="context">Application context to use</param> /// <param name="attrs">Attribute set from which to read values</param> public ScaleAnimation(android.content.Context context, android.util.AttributeSet attrs) : base(context, attrs) { mResources = context.getResources(); android.content.res.TypedArray a = context.obtainStyledAttributes(attrs, [email protected] .styleable.ScaleAnimation); android.util.TypedValue tv = a.peekValue([email protected]_fromXScale ); mFromX = 0.0f; if (tv != null) { if (tv.type == android.util.TypedValue.TYPE_FLOAT) { // This is a scaling factor. mFromX = tv.getFloat(); } else { mFromXType = tv.type; mFromXData = tv.data; } } tv = a.peekValue([email protected]_toXScale); mToX = 0.0f; if (tv != null) { if (tv.type == android.util.TypedValue.TYPE_FLOAT) { // This is a scaling factor. mToX = tv.getFloat(); } else { mToXType = tv.type; mToXData = tv.data; } } tv = a.peekValue([email protected]_fromYScale); mFromY = 0.0f; if (tv != null) { if (tv.type == android.util.TypedValue.TYPE_FLOAT) { // This is a scaling factor. mFromY = tv.getFloat(); } else { mFromYType = tv.type; mFromYData = tv.data; } } tv = a.peekValue([email protected]_toYScale); mToY = 0.0f; if (tv != null) { if (tv.type == android.util.TypedValue.TYPE_FLOAT) { // This is a scaling factor. mToY = tv.getFloat(); } else { mToYType = tv.type; mToYData = tv.data; } } android.view.animation.Animation.Description d = android.view.animation.Animation .Description.parseValue(a.peekValue([email protected]_pivotX )); mPivotXType = d.type; mPivotXValue = d.value; d = android.view.animation.Animation.Description.parseValue(a.peekValue([email protected] .styleable.ScaleAnimation_pivotY)); mPivotYType = d.type; mPivotYValue = d.value; a.recycle(); }