Grial-UI-Kit-Support icon indicating copy to clipboard operation
Grial-UI-Kit-Support copied to clipboard

Rotation on CIrcleImage Android goes wonky

Open ianvink opened this issue 5 years ago • 0 comments

When applying a Rotation to an CIrcleImage, Android renders wonky in XF 3.5

See attached animated Gif animation

Description

await this.RotateTo(rotation); will rotate the image

Steps to Reproduce

          public class FabImage : CircleImage
	        {
	        	public static readonly BindableProperty CommandProperty = BindableProperty.Create("Command", typeof(ICommand), typeof(FabImage), null);

		     public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create("CommandParameter", typeof(object), typeof(FabImage), null);

		public event EventHandler ItemTapped = (e, a) => { };

		public FabImage()
		{
			Initialize();
			this.Source = "fab_white_plus.png";
			HeightRequest = WidthRequest = 50;
			Margin = new Thickness(10,10,10,10);
			AbsoluteLayout.SetLayoutBounds(this, new Rectangle(1.0, 1.0, -1, -1));
			AbsoluteLayout.SetLayoutFlags(this, AbsoluteLayoutFlags.PositionProportional);

		}

		public ICommand Command
		{
			get { return (ICommand)GetValue(CommandProperty); }
			set { SetValue(CommandProperty, value); }
		}

		public object CommandParameter
		{
			get { return GetValue(CommandParameterProperty); }
			set { SetValue(CommandParameterProperty, value); }
		}


        private double rotation = 45;
		private ICommand TransitionCommand
		{
			get
			{
				return new Command(async () =>
				{

					AnchorX = 0.48;
					AnchorY = 0.48;
					await this.FadeTo(0.8, 50, Easing.Linear);
                    await this.RotateTo(rotation);
                    rotation = rotation == 0 ? 45 : 0;
					await Task.Delay(100);
					await this.FadeTo(1, 50, Easing.Linear);
					Command?.Execute(CommandParameter);
					ItemTapped(this, EventArgs.Empty);
				});
			}
		}

		public void Initialize()
		{
			GestureRecognizers.Add(new TapGestureRecognizer
			{
				Command = TransitionCommand
			});
		}
	} 
  `

### Expected Behavior
<!--- Tell us what should happen -->

### Actual Behavior
<!--- Tell us what happens instead of the expected behavior -->

### Basic Information

- Version with issue:
- Last known good version:
- IDE:
- Platform Target Frameworks: <!-- All that apply -->
 
  - Android: 9
 



### Screenshots
<!-- If the issue is a visual issue, please include screenshots showing the problem if possible -->

ianvink avatar Feb 27 '19 22:02 ianvink