Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/OliveTreeBible/Xamarin.Transitions

Declarative & implicit animations Library for Xamarin Forms
https://github.com/OliveTreeBible/Xamarin.Transitions

Last synced: about 2 months ago
JSON representation

Declarative & implicit animations Library for Xamarin Forms

Awesome Lists containing this project

README

        

# Xamarin Transitions [![Build](https://github.com/OliveTreeBible/Xamarin.Transitions/workflows/Build/badge.svg)](https://github.com/OliveTreeBible/Xamarin.Transitions/actions) [![NuGet Status](https://img.shields.io/nuget/v/OliveTree.Transitions?logo=nuget)](https://www.nuget.org/packages/OliveTree.Transitions/) [![Downloads](https://img.shields.io/nuget/dt/OliveTree.Transitions?logo=nuget)](https://www.nuget.org/packages/OliveTree.Transitions/)

Declarative & implicit animations Library for Xamarin Forms.

 

## Why Not `Xamarin.Forms.Animation`?
Xamarin Forms provides a common animation API, especially powerful with its `async`/`await` structure and extensibility. For many apps, it may be all that is necessary. **However**, it operates by setting up its own timing and modifying native view propertiies as it goes. This means the platform's hardware acceleration around animations can't be leveraged. Our experience was a sluggish feel that didn't "pop" the way a native app would.

## Example
To automatically animate the opacity of an element, simply add the transition to its attached property. Any property changes will then be animated according to the declaration.

```XML
xmlns:trans="clr-namespace:OliveTree.Transitions;assembly=OliveTree.Transitions"









```

Or triggered in code-behind:
```C#
StatusIndicator.Opacity = 0;
```

## Setup
For the common implementation to resolve platform animations, it must be given an `ITransitionProvider`. Each platform has one built in, but you are welcome to override it should needs arise. Generally, you will initialize it with:
```C#
Forms.Init();
TransitionsLibrary.Register();
```