Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

AnimationBehavior enhancements: #1180

Merged
merged 7 commits into from
Apr 11, 2021
Merged

AnimationBehavior enhancements: #1180

merged 7 commits into from
Apr 11, 2021

Conversation

bijington
Copy link
Contributor

@bijington bijington commented Apr 7, 2021

Description of Change

Addition of AnimateCommand to the AnimationBehavior class which lets the animation be triggered from a read-only Command.

Bugs Fixed

API Changes

Added:

  • ICommand AnimationBehavior.AnimateCommand { get; }

Behavioral Changes

PR Checklist

  • Has a linked Issue, and the Issue has been approved
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR well develop this time
  • Changes adhere to coding standard

bijington and others added 2 commits April 7, 2021 23:03
- AnimateCommand now lets the animation be triggered from a Command
@bijington bijington mentioned this pull request Apr 7, 2021
6 tasks

behavior.AnimateCommand.Execute(null);

Assert.That(mockAnimation.HasAnimated, Is.True);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.IsTrue(mockAnimation.HasAnimated)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to resolve these now that I have actioned them?

Assert.That(mockAnimation.HasAnimated, Is.True);
}

class MockAnimationType : AnimationBase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please move this class to Mocks folder?

@@ -7,12 +10,25 @@ public class AnimationBehavior : EventToCommandBehavior
public static readonly BindableProperty AnimationTypeProperty =
BindableProperty.Create(nameof(AnimationType), typeof(AnimationBase), typeof(AnimationBehavior));

public static readonly BindablePropertyKey AnimateCommandPropertyKey =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be internal

nameof(AnimateCommand),
typeof(ICommand),
typeof(AnimationBehavior),
null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null is fine, but also you may use "default" keyword

@pictos pictos added a/animation a/behaviors This issue/PR is related to behaviors labels Apr 9, 2021
@pictos
Copy link
Contributor

pictos commented Apr 9, 2021

@bijington are you able to write the docs for this feature?

@pictos pictos added the needs-documentation This needs better documentation to be closed out. label Apr 9, 2021
@bijington
Copy link
Contributor Author

Yes of course. At first I thought there wasn't much at all for AnimationBehavior but I have found this which I should be able to update easily enough. https://github.com/MicrosoftDocs/xamarin-communitytoolkit/blob/master/docs/behaviors/animationbehavior.md

I will aim to fork and submit a PR to that repo over the weekend

@AndreiMisiukevich
Copy link
Contributor

Could you please resolve conflicts?

@bijington
Copy link
Contributor Author

@pictos the documentation PR is here: MicrosoftDocs/xamarin-communitytoolkit#115 I assume you want to wait for that to be merged before accepting this?

@AndreiMisiukevich merge conflicts have been resolved

@pictos
Copy link
Contributor

pictos commented Apr 11, 2021

@bijington can you please double-check your merge? Looks like something went wrong.

@bijington
Copy link
Contributor Author

@bijington can you please double-check your merge? Looks like something went wrong.

Oh dear. I'm not sure what I've done. I thought I had just rebased off develop.

@pictos pictos removed the needs-documentation This needs better documentation to be closed out. label Apr 11, 2021
@pictos
Copy link
Contributor

pictos commented Apr 11, 2021

@bijington I'll see if I can fix it (:
No worries, git can be tricky sometimes

@bijington
Copy link
Contributor Author

@pictos oh thank you! I'm happy to try and see if I can fix it first to not take up your time

@pictos
Copy link
Contributor

pictos commented Apr 11, 2021

@bijington try this, on your terminal type
git reset --soft HEAD~2, this will move your branch two commits backward. Unstage and delete the changes. Double check if your code is there, I believe they are just two commits AnimationBehavior: and AnimationBehavior enhancements:.

If the project builds and runs as expected, just do a force push

@bijington
Copy link
Contributor Author

@pictos Great thanks. I will try that out in a little bit and tidy up my mess 🙂

@bijington
Copy link
Contributor Author

@pictos I am a little confused now. I definitely want to keep the commit from Resolved merge conflicts as this brought in a unit test that was missed as part of the initial merge from develop. The bit that confuses me are the additional 102 file changes... these seem to map back to commit d9ef5f7 and PR #1185.

I am starting to think I should have branched off develop as it may have made merging in a little easier (at least given my limited experience with git).

@pictos
Copy link
Contributor

pictos commented Apr 11, 2021

@bijington Ooh, I see now, you didn't create another branch to do this fix... Yeah, this can cause some confusion... I would say to delete the Resolved merge conflicts because that test shouldn't be in your PR files changed.
SO my idea here is to move your branch to the point that you did the fix, and then do a merge or rebase against our develop branch, is that make sense for you?

@bijington
Copy link
Contributor Author

@pictos thank you for the assistance, this latest set of changes looks much more like what you are expecting :).

Sorry about the mess I created. I will make sure to branch in future to simplify the merging

@pictos
Copy link
Contributor

pictos commented Apr 11, 2021

@pictos thank you for the assistance, this latest set of changes looks much more like what you are expecting :).

Sorry about the mess I created. I will make sure to branch in future to simplify the merging

No need to be sorry, as I said before git can be tricky sometimes. Glad that you were able to fix all :D
Anytime that you need help feel free to ping me ❤

Copy link
Contributor

@pictos pictos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bijington thanks for this PR, I'm awaiting for the next ones❣

@pictos pictos merged commit 7f41cfa into xamarin:develop Apr 11, 2021
@bijington
Copy link
Contributor Author

Thank you for accepting the change and all the help getting it merged! This one had a big benefit for me, I will try to see if I can find something else to help out on.

Keep up the great work! I have been surprised at how useful this toolkit has been for my project!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/animation a/behaviors This issue/PR is related to behaviors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants