💠Metaphor is the library to easily add Material Motion animations

Related tags

Animations Metaphor
Overview

Metaphor


Metaphor is the library to easily add Material Motion animations.


Google

License Medium Profile



Who's using Metaphor?

👉 Check out who's using Metaphor

Include in your project

Maven Central

Gradle

Add the dependency below to your module's build.gradle file:

dependencies {
    implementation("io.github.androidpoet:metaphor:1.0.5")
}

Metaphor provides support for all four motion patterns defined in the Material spec.

  1. Container transform
  2. Shared axis
  3. Fade through
  4. Fade

Container transform How to use In Fragments

  //Start Fragments onclick// 
  val extras = FragmentNavigatorExtras(view to item.pos.toString())
        val action = ArtistListFragmentDirections.navToCharacterDetailFragment(item)
        findNavController().navigate(action, extras)
		
//start fragment 
metaphorStartFragmentMaterialContainerTransform(view)// inside on onviewcreated  ////it also retuns the object of MaterialContainerTransform() you can use .apply { } to change values

//destination fragment		
  metaphorDestinationFragmentMaterialContainerTransform(view, args.data.pos.toString())// inside onviewcreated ////it also retuns the object of MaterialContainerTransform() you can use .apply { } to change values

Container transform How to use in views

   metaphorMaterialContainerTransformViewIntoAnotherView(
        viewBinding.root,
        viewBinding.fabDetail,
        viewBinding.controlsPanel
      ) //it also retuns the object of MaterialContainerTransform() you can use .apply { } to change values

Shared axis How to use In Fragments

		
//start fragment 

metaphorMaterialSharedAxisInFragment(Metaphor.SharedX, true)// inside on onCreate   ////it also retuns the object of MaterialSharedAxis() you can use .apply { } to change values

//destination fragment		

metaphorMaterialSharedAxisInFragment(Metaphor.SharedX, true)// inside onCreate   ////it also retuns the object of MaterialSharedAxis() you can use .apply { } to change values

Shared axis How to use in views

     metaphorSharedAxisTransformationBetweenViews(
        binding.root,
        binding.img,
        binding.img,
        Metaphor.SharedX,
        true
      )  ////it also retuns the object of MaterialSharedAxis() you can use .apply { } to change values

Fade through How to use In Fragments

		
//start fragment 

metaphorMaterialFadeThroughInFragment()// inside on onCreate  ////it also retuns the object of MaterialFadeThrough () you can use .apply { } to change values
 
//destination fragment		

metaphorMaterialFadeThroughInFragment()// inside onCreate  ////it also retuns the object of MaterialFadeThrough () you can use .apply { } to change values

Fade through How to use in views

    metaphorMaterialFadeThroughBetweenViews(
  root: CoordinatorLayout,
  startView: View,
  endView: View
) ////it also retuns the object of MaterialFadeThrough () you can use .apply { } to change values

Fade How to use In Fragments

		
//start fragment 

metaphorMaterialFadeInFragment()// inside on onCreate  ////it also retuns the object of MaterialFade () you can use .apply { } to change values

//destination fragment		

metaphorMaterialFadeInFragment()// inside onCreate  ////it also retuns the object of MaterialFade () you can use .apply { } to change values

Fade How to use in views

  //ShowView
   metaphorShowViewWithMaterialFade(root: CoordinatorLayout, view: View)  ////it also retuns the object of MaterialFade () you can use .apply { } to change values

//Hide View

metaphorHideViewWithMaterialFade(root: CoordinatorLayout, view: View)  ////it also retuns the object of MaterialFade () you can use .apply { } to change values

images credit=https://unsplash.com/

Find this library useful? ❤️

Support it by joining stargazers for this repository.

License

Copyright 2022 AndroidPoet (Ranbir Singh)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
FragmentTransactionExtended is a library which provide us a set of custom animations between fragments.

FragmentTransactionExtended FragmentTransactionExtended is a library which provide us a set of custom animations between fragments. FragmentTransactio

An Android library which provides simple Item animations to RecyclerView items
An Android library which provides simple Item animations to RecyclerView items

RecyclerViewItemAnimators Library Travis master: This repo provides: Appearance animations Simple animators for the item views Quick start You can now

Library containing common animations needed for transforming ViewPager scrolling for Android v13+.
Library containing common animations needed for transforming ViewPager scrolling for Android v13+.

ViewPagerTransforms Library containing common animations needed for transforming ViewPager scrolling on Android v13+. This library is a rewrite of the

Android library to create complex multi-state animations.
Android library to create complex multi-state animations.

MultiStateAnimation Android library to create complex multi-state animations. Overview A class that allows for complex multi-state animations using An

Lightweight Android library for cool activity transition animations

Bungee min SDK 16 (Android Jellybean 4.1) written in Java A lightweight, easy-to-use Android library that provides awesome activity transition animati

A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix.
A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix.

SuperForwardView About A lightweight android library that allows to you create custom fast forward/rewind animations like on Netflix. GIF Design Credi

🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

Orbitary 🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition. Download Gradle Add the depen

🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.
🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

🪐 Jetpack Compose animation library that allows you to implement animations such as shared element transition.

This library provides easy ways to add onboarding or pager screens with different animation and indicators.
This library provides easy ways to add onboarding or pager screens with different animation and indicators.

WalkThroughAndroid Make amazing OnBoarding Screens easily for your app with different colorful animations, fonts, styles, and many more. Customize you

Releases(1.1.5)
Owner
Ranbir Singh
Android Poet, I love perfect MVVM Architecture and MaterialYou design language:(not all programmers love coffee)
Ranbir Singh
[] An Android library which allows developers to easily add animations to ListView items

DEPRECATED ListViewAnimations is deprecated in favor of new RecyclerView solutions. No new development will be taking place, but the existing versions

Niek Haarman 5.6k Dec 30, 2022
Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animations painless.

AnimatableCompose Add Animatable Material Components in Android Jetpack Compose. Create jetpack compose animation painless. What you can create from M

Emir Demirli 12 Jan 2, 2023
Sophisticated and cool intro with Material Motion Animation

☯️Sophisticated and cool intro with Material Motion Animations(No more viewpager transformer)

Ranbir Singh 34 Sep 8, 2022
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.

EtsyBlur EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the past Etsy app. Try out the sa

Manabu S. 755 Dec 29, 2022
Easily add slide to dismiss functionality to an Activity

Slidr Easily add slide-to-dismiss functionality to your Activity by calling Slidr.attach(this) in your onCreate(..) method. Usage An example usage: pu

Drew Heavner 2.7k Jan 6, 2023
An application demoing meaningful motion on Android

Animate You'll find the supporting medium article for this project here! Animate is a simple application I quickly put together to demo meaningful mot

Joe Birch 3.1k Dec 30, 2022
A motion-driven animation framework for Android.

Backboard A motion-driven animation framework for Android. backboard is a framework on top of rebound that makes it easier to use by coupling it to vi

Tumblr 1.7k Dec 30, 2022
How to apply meaningful and delightful motion in a sample Android app

Applying meaningful motion on Android How to apply meaningful and delightful motion in a sample Android app Read the complete post at https://medium.c

André Mion 166 Nov 12, 2022
Animation samples with motion layout and object animator 🦹🏻‍♀️

?? Animations ?? Animation samples with motion layout and object animator ????‍♀️ Car Animation with Object Animator ?? ?? I've created this project b

Yağmur Erdoğan 25 Dec 28, 2022
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.

TextFieldBoxes A new Material Design text field that comes in a box, based on Google Material Design guidelines. ???? 中文看这里 UPDATE NOTICE 1.4.5 Releas

Mark Wang 769 Jan 7, 2023