{"id":15036337,"url":"https://github.com/julien-mialon/expectanimxamarin","last_synced_at":"2026-03-12T11:01:37.313Z","repository":{"id":69111467,"uuid":"83962029","full_name":"Julien-Mialon/ExpectAnimXamarin","owner":"Julien-Mialon","description":"Xamarin.Android Binding, describe your animation and just run","archived":false,"fork":false,"pushed_at":"2017-03-05T17:27:23.000Z","size":520,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T07:37:45.815Z","etag":null,"topics":["android","animation","csharp","design","expectation","fluent","material","xamarin"],"latest_commit_sha":null,"homepage":"https://github.com/florent37/ExpectAnim","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julien-Mialon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-05T10:29:18.000Z","updated_at":"2022-04-14T06:34:22.000Z","dependencies_parsed_at":"2023-12-19T13:31:01.629Z","dependency_job_id":null,"html_url":"https://github.com/Julien-Mialon/ExpectAnimXamarin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-Mialon%2FExpectAnimXamarin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-Mialon%2FExpectAnimXamarin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-Mialon%2FExpectAnimXamarin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julien-Mialon%2FExpectAnimXamarin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julien-Mialon","download_url":"https://codeload.github.com/Julien-Mialon/ExpectAnimXamarin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126939,"owners_count":21052106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","animation","csharp","design","expectation","fluent","material","xamarin"],"created_at":"2024-09-24T20:30:50.277Z","updated_at":"2026-03-12T11:01:37.117Z","avatar_url":"https://github.com/Julien-Mialon.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExpectAnimXamarin\n\n[![nuget](https://img.shields.io/nuget/v/Florent37.XamarinExpectAnim.svg)](https://www.nuget.org/packages/Florent37.XamarinExpectAnim)\n\nDescribe your animation and run !\n\n[![gif](https://raw.githubusercontent.com/florent37/ExpectAnim/master/media/sample.gif)](https://github.com/Julien-Mialon/ExpectAnimXamarin)\n\n```csharp\nnew ExpectAnim()\n\n                .Expect(avatar)\n                .ToBe(\n                    Expectations...\n                )\n                .ToAnimation()\n                .Start();\n```\n\n#Download\n\nThis library is available on [nuget](https://www.nuget.org/packages/Florent37.XamarinExpectAnim) \n\n```\nInstall-Package Florent37.XamarinExpectAnim\n```\n\nThis code describe the video above\n\n```csharp\nnew ExpectAnim()\n\t.Expect(_avatar)\n\t.ToBe(\n\t\tBottomOfParent().WithMarginDp(36),\n\t\tLeftOfParent().WithMarginDp(16),\n\t\tWidth(40).ToDp().KeepRatio())\n\t.Expect(_name)\n\t.ToBe(\n\t\tToRightOf(_avatar).WithMarginDp(16),\n\t\tSameCenterVerticalAs(_avatar),\n\t\tToHaveTextColor(Color.White)\n\t)\n\n\t.Expect(_subname)\n\t.ToBe(\n\t\tToRightOf(_name).WithMarginDp(5),\n\t\tSameCenterVerticalAs(_name),\n\t\tToHaveTextColor(Color.White)\n\t)\n\n\t.Expect(_follow)\n\t.ToBe(\n\t\tRightOfParent().WithMarginDp(4),\n\t\tBottomOfParent().WithMarginDp(12),\n\t\tToHaveBackgroundAlpha(0f)\n\t)\n\n\t.Expect(_message)\n\t.ToBe(\n\t\tAboveOf(_follow).WithMarginDp(4),\n\t\tRightOfParent().WithMarginDp(4),\n\t\tToHaveBackgroundAlpha(0f)\n\t)\n\n\t.Expect(_bottomLayout)\n\t.ToBe(\n\t\tAtItsOriginalPosition()\n\t)\n\n\t.Expect(_content)\n\t.ToBe(\n\t\tAtItsOriginalPosition(),\n\t\tVisible()\n\t)\n\t.ToAnimation()\n\t.SetDuration(1500)\n\t.Start();\n```\n\n## Follow scroll\n\n[![gif](https://raw.githubusercontent.com/florent37/ExpectAnim/master/media/scroll.gif)](https://github.com/Julien-Mialon/ExpectAnimXamarin)\n\nUse `SetPercent` to apply modify the current step of the animation\n\nExemple with a scrollview\n\n```csharp\n_expectAnimMove = new ExpectAnim()\n\t\t\t\t.Expect(_avatar)\n\t\t\t\t.ToBe(\n\t\t\t\t\tTopOfParent().WithMarginDp(20),\n\t\t\t\t\tLeftOfParent().WithMarginDp(20),\n\t\t\t\t\tScale(0.5f, 0.5f)\n\t\t\t\t)\n\n\t\t\t\t.Expect(_username)\n\t\t\t\t.ToBe(\n\t\t\t\t\tToRightOf(_avatar).WithMarginDp(16),\n\t\t\t\t\tSameCenterVerticalAs(_avatar),\n\n\t\t\t\t\tAlpha(0.5f)\n\t\t\t\t)\n\n\t\t\t\t.Expect(_follow)\n\t\t\t\t.ToBe(\n\t\t\t\t\tRightOfParent().WithMarginDp(20),\n\t\t\t\t\tSameCenterVerticalAs(_avatar)\n\t\t\t\t)\n\n\t\t\t\t.Expect(_background)\n\t\t\t\t.ToBe(\n\t\t\t\t\tHeight(_height).WithGravity(Java.Lang.Integer.ValueOf((int)GravityFlags.Left), Java.Lang.Integer.ValueOf((int)GravityFlags.Top))\n\t\t\t\t)\n\t\t\t\t.ToAnimation();\n\n\t\t\t_scrollView.ScrollChange += (sender, args) =\u003e {\n\t\t\t\tfloat percent = args.ScrollY * 1f / _scrollView.MaxScrollAmount;\n\t\t\t\t_expectAnimMove.SetPercent(percent);\n\t\t\t};\n```\n\n## Apply directly\n\nUse `SetNow` to apply directly the transformation\n\n```csharp\nnew ExpectAnim()\n\t.Expect(_view).ToBe(Invisible())\n\t.ToAnimation()\n\t.SetNow();\n```\n\n## Reset\n\nUse `reset` to return to the initial state of views\n\n```csharp\n_expectAnimMove.Reset():\n```\n\n# List of expectations\n\n```csharp\nnew ExpectAnim()\n                .Expect(view)\n                .ToBe(\n\n                    //.WithMargin(marginPx)\n                    //.WithMarginDp(margin)\n                    //.WithMarginDimen(R.dimen.margin)\n\n                    ToRightOf(view)\n                    ToLeftOf(view)\n                    BelowOf(view)\n                    AboveOf(view)\n\n                    AtItsOriginalPosition()\n\n\n                    SameCenterAs(view, horizontal, vertical)\n                    SameCenterHorizontalAs(view)\n                    SameCenterVerticalAs(view)\n                    CenterInParent(horizontal, vertical)\n                    CenterVerticalInParent()\n                    CenterHorizontalInParent()\n\n                    CenterBetweenViews(view1, view2, horizontal, vertical)\n                    CenterBetweenViewAndParent(otherView, horizontal, vertical, toBeOnRight, toBeOnBottom)\n\n                    TopOfParent()\n                    RightOfParent()\n                    BottomOfParent()\n                    LeftOfParent()\n\n                    AlignBottom(otherView)\n                    AlignTop(otherView)\n                    AlignLeft(otherView)\n                    AlignRight(otherView)\n\n                    OutOfScreen(gravitiy)  //GravityFlags.Left / GravityFlags.Right / GravityFlags.Top / GravityFlags.Bottom\n\n                \tAlpha(alpha)\n                    SameAlphaAs(otherView)\n                    Visible()\n                    Invisible()\n\n                    //.KeepRatio()\n                    //.WithGravity(horizontalGravity, verticalGravity)\n\n                    AtItsOriginalScale()\n\n                    Scale(scaleX, scaleY)\n                    Height(height)\n                    Width(width)\n                    SameScaleAs(otherView)\n                    SameWidthAs(otherView)\n                    SameHeightAs(otherView)\n\n\n                    ToHaveTextColor(textColor)\n                    ToHaveBackgroundAlpha(alpha)\n\n                    Rotated(rotation)\n                    Vertical(bottomOfViewAtLeft)\n                    AtItsOriginalRotation()\n                )\n\n````\n\n# Changelog\n\n##1.0.2\n\nAdded `flips` rotations\n\n`FlippedHorizontally()`\n`FlippedVertically()`\n`FlippedHorizontallyAndVertically()`\n`WithCameraDistance(1000f)`\n\n##1.0.\n\nAdded `rotations`\n\n[![gif](https://raw.githubusercontent.com/florent37/ExpectAnim/master/media/rotations.gif)](https://github.com/Julien-Mialon/ExpectAnimXamarin)\n\n# Credits\n\nAuthor (xamarin binding): Julien Mialon\n\n[![Follow me on Twitter](https://raw.githubusercontent.com/Julien-Mialon/ExpectAnimXamarin/32f4d7c7c8f995858cfdbe55e987e4cd69e84153/.assets/twitter.png)](https://twitter.com/Storm0x2A)\n[![Follow me on Linkedin](https://raw.githubusercontent.com/Julien-Mialon/ExpectAnimXamarin/f543205233c75ecf453d330b5f3bfd4e7a746376/.assets/in.png)](https://fr.linkedin.com/in/julienmialon)\n\nOriginal author (android version): Florent Champigny\n\n[![Follow me on Twitter](https://raw.githubusercontent.com/Julien-Mialon/ExpectAnimXamarin/32f4d7c7c8f995858cfdbe55e987e4cd69e84153/.assets/twitter.png)](https://twitter.com/florent_champ)\n[![Follow me on Linkedin](https://raw.githubusercontent.com/Julien-Mialon/ExpectAnimXamarin/f543205233c75ecf453d330b5f3bfd4e7a746376/.assets/in.png)](https://fr.linkedin.com/in/florentchampigny)\n\n#Original license\n\n    Copyright 2017 florent37, Inc.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulien-mialon%2Fexpectanimxamarin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulien-mialon%2Fexpectanimxamarin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulien-mialon%2Fexpectanimxamarin/lists"}