Skip to content

weareyou/Redhotminute-Xamarin-iOS-AnimatedTransitions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Animated transitions for Xamarin.iOS

You can find a lot of animated transitions for iOS on the web, but most of them are written either in Objective-C or Swift. This library contains a small amount of cool transitions, ported to C# for Xamarin.iOS.

There is some sample code available, currenyly the MvvmCross 5 sample "Cool Animations" is up-to-date. I am working hard to bring more samples and more transitions into this library.

Usage

Transitions

Using transitions with MvvmCross

Add the nuget package "Redhotminute.Plugin.iOS.AnimatedTransitions" to your iOS project.

Create start and a target MxvViewController, create bindings, viewmodels, etc, make sure the navigation between the ViewControllers work.

For all transitions:

  1. The starting ViewController should be of type IStartAnimationViewController.
public partial class HomeViewController : MvxViewController<HomeViewModel>, IStartAnimationViewController
{
	...
  1. The target ViewController should look like this:
[MvxModalPresentation(ModalPresentationStyle = UIModalPresentationStyle.FullScreen,
                          ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve)]
public partial class SettingsViewController : MvvmCross.iOS.Views.MvxViewController<SettingsViewModel>
{
	public override void ViewDidLoad()
	{
		base.ViewDidLoad();

		TransitioningDelegate = new CirculairRevealTransitioningDelegate(0.4f, UIColor.White);
  1. Set the StartFrame (and StartImage if needed) in the starting viewcontroller
SettingsButton.TouchUpInside += async (sender, e) =>
{
	StartFrame = AnimationHelper.GetFrameFromViewInScrollView(ScrollView, SettingsButton.Frame);
	await ViewModel.SettingsCommand.ExecuteAsync().ConfigureAwait(false);
};

TODO

  • Add Wiki
  • Add more transitions
  • Dive into interactive transitions
  • Add multiple parameters (open vs close duration), open vs close alpha

Inspiration, Docs, Links

License

Redhotminute.Plugin.iOS.AnimatedTransitions is licensed under the MIT License

About

Plugin for animated transitions in Xamarin.iOS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages