Forum Xamarin.Android

Question regarding ObjectAninimator.OfInt

I Ported code from a demo in java that animates the width of a view. Need help with the ObjectAninimator.OfInt method. See below.

The method requires the existence of a public Setter function and depending could also require a Getter function. The Naming convention of the getter/setter functions are based on the second parameter "middleWidth".

As written below the setMiddleWidth method is not called. I have played with the case of the string parameter "middleWidth" as well as the setter name. There is an overload which I thought would allow me to use a c# property but it want's an Android.Util.Property. I don't know how to get past this. Thanks for any help.

public void showLeft()
{
ObjectAnimator.OfInt(this, "middleWidth",
leftWidth, middleWidthNormal).SetDuration(ANIM_DURATION).Start();
}

public void setMiddleWidth(int value)
{
middle.LayoutParameters.Width = value;
RequestLayout();
}

Sign In or Register to comment.