项目作者: tornikegomareli

项目描述 :
🌒 Gradient animations on Xamarin-iOS
高级语言: C#
项目地址: git://github.com/tornikegomareli/PastelXamarinIos.git
创建时间: 2018-01-15T14:13:56Z
项目社区:https://github.com/tornikegomareli/PastelXamarinIos

开源协议:MIT License

下载


🚀🚀

C#
CI Status
Version
Platform
license

pastel_01.gif
pastel_02.gif
pastel_03.gif

Pastel library Xamarin-iOS version

Pastel is swift library for gradient animation effects, we’ve inspired from this project.
Xamarin-iOS didn’t had anything like gradient animation library, so we rewrited C# version of it for Xamarin.

Installing / Getting started

You can install library from the NuGet Packages.
https://www.nuget.org/packages/MPDC.Xamarin.iOS.Pastel

From the console you can

  1. PM> Install-Package MPDC.Xamarin.iOS.Pastel

Developing

This project is in very begining stage, so if you have some improvements or bug fixes, feel free to send PR

Example

  1. public override void ViewDidLoad()
  2. {
  3. base.ViewDidLoad();
  4. // Initializing pastelView object
  5. var pastelView = new MPDCPastelXamarinIOS.PastelView(View.Bounds);
  6. pastelView.AnimationDuration = 2.0;
  7. // init start point and end point
  8. pastelView.StartPoint = PastelPoint.BottomLeft.Point();
  9. pastelView.EndPoint = PastelPoint.TopRight.Point();
  10. // seting colors
  11. pastelView.SetColors(PastelGradient.WinterNeva.Colors());
  12. // pastelView.AddColor(SecondGradientColor);
  13. pastelView.StartAnimation();
  14. View.InsertSubview(pastelView,0);
  15. }
  16. }

You need to include MPDCPastelXamarinIOS.Extensions namespace to use Colors and Point extension methods.

In PastelGradient enum, we have some custom gradient colors

  • Warflame
  • NightFade
  • SpringWarmth
  • JuicyPeach
  • YoungPassion
  • LadyLips
  • SunnyMorning
  • RainyAshville
  • FrozenDreams
  • WinterNeva

You can use this custom colors, or feel free to add some more gradient colors.

In SetColors method you can implement and add your own colors array.

pastel_gradients_gif_01

For startpoint and endpoint you have 8 point choice.

  • Left
  • Top
  • Right
  • Bottom
  • TopLeft
  • TopRight
  • BottomLeft
  • BottomRight

Contributing

“If you’d like to contribute, please fork the repository and use a feature
branch. Pull requests are warmly welcome.”

Credits

This software uses some code examples from open source Swift Pastel project.

Authors

Licensing

“The code in this project is licensed under MIT license.”