All Projects β†’ AlexandrGraschenkov β†’ Liquidtransition

AlexandrGraschenkov / Liquidtransition

Licence: mit
New way to perform animated transitions

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Liquidtransition

Simple Slider
🎠 The 1kb JavaScript Carousel
Stars: ✭ 583 (+177.62%)
Mutual labels:  transition-animation
Uberux
Project that demonstrates the entire animation stack present in the Uber app (android)
Stars: ✭ 1,201 (+471.9%)
Mutual labels:  transition-animation
Lantern
基于Swiftηš„ι«˜ε―η”¨θ§†ε›Ύζ‘†ζžΆ
Stars: ✭ 181 (-13.81%)
Mutual labels:  transition-animation
React Move
React Move | Beautiful, data-driven animations for React
Stars: ✭ 6,395 (+2945.24%)
Mutual labels:  transition-animation
Transitionbutton
UIButton sublass for loading and transition animation.
Stars: ✭ 1,124 (+435.24%)
Mutual labels:  transition-animation
Android Material Avatar
Example of material transition (AKA Hero views) to pick your profile avatar.
Stars: ✭ 102 (-51.43%)
Mutual labels:  transition-animation
Lottie Ios
An iOS library to natively render After Effects vector animations
Stars: ✭ 22,295 (+10516.67%)
Mutual labels:  transition-animation
Web Portfolio
Personal portfolio website made with the React
Stars: ✭ 207 (-1.43%)
Mutual labels:  transition-animation
Ibanimatable
Design and prototype customized UI, interaction, navigation, transition and animation for App Store ready Apps in Interface Builder with IBAnimatable.
Stars: ✭ 8,585 (+3988.1%)
Mutual labels:  transition-animation
Loginpageconcept
Login Page and dashboard concept with awesome transition animation
Stars: ✭ 171 (-18.57%)
Mutual labels:  transition-animation
Swiftui Animation Library
SwiftUI Animation Library. Useful SwiftUI animations including Loading/progress, Looping, On-off, Enter, Exit, Fade, Spin and Background animations that you can directly implement in your next iOS application or project. The library also contains huge examples of spring animations such as Inertial Bounce, Shake, Twirl, Jelly, Jiggle, Rubber Band, Kitchen Sink and Wobble effects. Browse, find and download the animation that fits your needs.
Stars: ✭ 898 (+327.62%)
Mutual labels:  transition-animation
Urmovingtransitionanimator
Moving view transition with the blurring effect between view controllers for Swift3
Stars: ✭ 44 (-79.05%)
Mutual labels:  transition-animation
Clippathlayout
Android δΈθ§„εˆ™ε›Ύε½’εΈƒε±€
Stars: ✭ 104 (-50.48%)
Mutual labels:  transition-animation
Popping
A collection of animation examples for iOS apps.
Stars: ✭ 5,587 (+2560.48%)
Mutual labels:  transition-animation
Imagetransition
Library for smooth animation of images during transitions.
Stars: ✭ 195 (-7.14%)
Mutual labels:  transition-animation
30 Swift Projects In 30 Days
This is the demos to show 30 demos finishes in 30 days (or more)
Stars: ✭ 527 (+150.95%)
Mutual labels:  transition-animation
Compose Shared Element
Experiment with SharedElement transition in Jetpack Compose, inspired by Flutter Hero widget.
Stars: ✭ 102 (-51.43%)
Mutual labels:  transition-animation
Android Animation Set
πŸ“š Android ζ‰€ζœ‰εŠ¨η”»η³»εˆ—θ―¦ε°½ζ•™η¨‹γ€‚ Explain all animations in Android.
Stars: ✭ 2,452 (+1067.62%)
Mutual labels:  transition-animation
Tksubmittransition
Animated UIButton of Loading Animation and Transition Animation. Inspired by https://dribbble.com/shots/1945593-Login-Home-Screen
Stars: ✭ 2,279 (+985.24%)
Mutual labels:  transition-animation
React Simple Animate
🎯 React UI animation made easy
Stars: ✭ 1,626 (+674.29%)
Mutual labels:  transition-animation

LiquidTransition   Tweet

Cocoapods iOS 8.0+ Version Swift 5 License Donate

LiquidTransition provide new API for transition creation.

Features:

  • Easy and convinient API (less boilerplate code)
  • Animate backward
  • Interrupt transition at any time to continue interactive
  • Helper class for restore views state
  • Animation of custom properties (or CALayer properties)
  • Complex transition without 'lag'

Web browser   Photo browser   Complex animation

Instalation

CocoaPods

Add the following entry to your Podfile:

pod 'LiquidTransition'

Then run pod install.

Don't forget to import LiquidTransition in every file you'd like to use LiquidTransition.

Usage

Like this you can create simple transition

import LiquidTransition

class FadeTransition: Animator<FromViewController, ToViewController> {

    init() {
        super.init(from: FromViewController.self, to: ToViewController.self, direction: .both)
        
        duration = 0.3
        timing = Timing.default
        // do not perform here complex operations, cause it calls on app initialization
    }
    
    override func animation(src: FromViewController, dst: ToViewController, container: UIView, duration: Double) {
        dst.view.alpha = 0
        
        // perform linear animation and manage timing function with `self.timing`
        UIView.animate(withDuration: duration, delay: 0, options: [.curveLinear], animations: {
            dst.view.alpha = 1
        }) { _ in
            dst.view.alpha = 1 // if anim somehow canceled
        }
    }
}

On app starts you can setup transitions

Liquid.shared.becomeDelegate() // Liquid automaticly becomes delegates for all animated transitions
Liquid.shared.addTransitions([FadeTransition()])

That's it! Easy enought?! :)

Customization

import LiquidTransition

class ExampleTransition: Animator<SampleController, CardsNavigationController> {

    var imgView: UIImageView!
    init() {
        super.init(from: SampleController.self, to: CardsNavigationController.self, direction: .both)
        
        duration = 0.4
        timing = Timing.init(closure: { $0 * $0 })
        
        addCustomAnimation {[weak self] (progress) in
            self?.imgView?.layer.cornerRadius = 20 * (1-progress)
        }
    }
    
    override func animation(src: SampleController, dst: CardsNavigationController, container: UIView, duration: Double) {
        imgView = dst.imgView
        
        // this class restore all views state before transition
        // when you have lot of property changes, it can be might helpfull
        let restore = TransitionRestorer()
        restore.addRestore(imgView, src.fadeView)
        
        // cause on end transition we dont want restore superview of `src.view` and `dst.view`
        restore.addRestore(dst.view, ignoreFields: [.superview])
        
        dst.view.alpha = 0
        UIView.animate(withDuration: duration, delay: 0, options: [.curveLinear], animations: {
            dst.view.alpha = 1
            src.fadeView.alpha = 0
            self.imgView.frame = CGRect(/*new frame*/)
        }) { _ in
            restore.restore()
        }
    }
}

Sometimes we need that one transition work for multiple controllers. In this case you can define UIViewController as template classes and call init method with multiple classes defined:

class FadeTransition: Animator<UIViewController, UIViewController> {

init() {
    super.init(from: [VC1.self, VC2.self, VC3.self], to: [VC4.self, VC5.self], direction: .both)
    duration = 0.3
}

override func animation(src: UIViewController, dst: UIViewController, container: UIView, duration: Double) {
// animation
}

Or use protocol, to have access to common views. If it's not your case, you can ovverride canAnimate function

open func canAnimate(src: UIViewController, dst: UIViewController, direction animDirection: Direction) -> Bool

and define your conditions

TODO

  • [x] Backward animation
  • [x] Custom timing function
  • [x] Allow custom animation
  • [x] Restore view state helper class
  • [x] Smooth interactive animation for complex prepare animation
  • [x] Support Cocoapods
  • [ ] Support Carthage
  • [x] Add custom save keys for TransitionRestorer
  • [ ] Add some default animations

Notes

LiquidTransition controls animation percent completion. So if you define animation in one direction, it can run animation backward. In backward animation run from 1 to 0. So if you works with NSNavigationController with navigationBar, you can see that navigationBar animates backward (see example with photos). In this case better to define animation in both directions.

LiquidTransition 'inspired' by Hero. We have complex UI with custom animation. Several weaks we try to implement performance animation in Hero. When nothing works with Hero, we check manual implementation of transition. It works much faster. Cause Hero do a lot of snapshots, performs transition becomes laggy. In real project Hero showed not enough performance and require a lot of code to say what you really want. So in real app manual transition looks more suitable. Hero was removed from project and we move to transitions with manual control. Some pieces of new library start appear in our project. Now some ideas and code was moved and refactored for common usage in one library.

If you look for something similar, take a look on Transition and EasyTransitions. I found this projects after finish LiquidTransition and they have good ideas behind. They less convenient, but still good lib.

Credits

Alexandr Graschenkov: [email protected]
iOS and Computer Vision developer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].