
Before getting into code, it is good to get an understanding of
animation terminology used in Android. After that, you'll learn about
the android.view.animation package. This API has been
around since Android API 1, so you will be able to use it on all Android
devices! In this lectures, you will learn about various APIs this
package provides for animating views.
Learn to move between two Android activities with smooth animations, using translate-based slide left and slide right resources, start an activity, and override pending transition for entering and exiting.
In this lesson you learn about AnimationListener. You learn how to add animation listeners to your animations and even combine different types of animations to play them in sequence.
Learn to create a background selector for recycler view items in Android, defining focus, selected, pressed, and hover states with drawable resources and a stateful item background.
Learn to use animator sets to run several animations together or sequentially on a button. Define object animators for translation, scale, and text color with rgb evaluator; play together.
Create and manage transition resources to animate between multiple layouts using a transition set and transition manager, inflating scenes and wiring buttons for animated navigation.
explore lollipop's new transition apis, including arc, motion, clip, bounce, and shared element transitions, to create compelling window and content transitions that enhance user experience.
Android Lollipop allows Android developers to share a view between two activities. Make sure you use a Material theme. If your activity extends AppCompatActivity, then material theme is enabled by default.
Window content transitions are transitions in Android Lollipop and above that allow you to run certain animations on your views when you enter an activity, exit an activity, return from an activity or reenter an activity.
Window content transitions can be used very easily in two different ways:
In code
In your theme (styles.xml)
The following transitions are supported as content transitions:
- Explode
- Slide
- Fade
Let's say we want to run a an explode transition on the views when we enter an activity. First, we create a transition file in the transition folder and name it e.g. my_explode.xml. The file contains:
<explode/>
Next, we add the transition in our theme file i.e. styles.xml:
<item name="android:windowEnterTransition">@transition/my_explode</item>
Finally, to see the transition in action, use the following format when you start a new activity:
Intent newIntent = new Intent(SourceActivity.this, DestinationActivity.class); startActivity(newIntent, ActivityOptionsCompat.makeSceneTransitionAnimation(SourceActvity.this).toBundle());
Alternatively, if you want to specify your transition in code rather than styles.xml, you can do that as follows:
//Inside MainActivity.java Transition explode = new Explode(); getWindow().setEnterTransition(explode);
You can even specify certain views as targets of content transitions. Let's say you want only an ImageView named someImage to be animated when you enter an activity rather than all views. You can do that in code as follows:
explode.addTarget(someImage);
Or declaratively in a transitionSet tag:
<explode xmlns:android="http://schemas.android.com/apk/res/android">
<targets>
<target android:targetId="@+id/cat"/>
</targets>
</explode>
Like window and shared elements transitions, fragments can also be used with transitions. You can use Slide, Explode and Fade transitions (in fact, every transition that extends the Visibility class) for fragments. In order to add transitions to fragments, you must set transitions before adding the fragment to a fragment transaction.
Two common cases for using transitions with fragments is when you enter a fragment or when you return from a fragment. In this lesson you will learn to create transitions for these two cases.
What you can find particularly useful is applying transitions as enter and return transitions for fragments as follows:
MyFragment frag = new MyFragment();
Transition enter = new Slide(Gravity.TOP); //Create a slide transition that is revealed from the top of screen
transition.setDuration(3000); //You can give it a duration
fragment.setEnterTransition(enter);
Transition return = new Explode();
return.setDuration(2500);
fragment.setReturnTransition(return);
FragmentTransaction transaction = getSupportFragmentManager.beginTransaction();
transaction.addFragment(fragment); //Add fragment to transaction
transaction.addToBackStack(null); //Add to back stack so we can return from it with the back button
transaction.commit(); //Commit the transaction
You can also use transitions inflated from resources for your fragments. For example, the above enter transition can be created this way:
Transition enter = TransitionInflater.from(getContext()).inflateTransition(R.transition.enter_transition);
This lecture will give you an introduction to vectors by presenting basic concepts and terminology about this graphics technology. Then it will move on to discuss Android's support for vector graphics.
Import svg files as vector drawables in Android Studio using the asset studio, then apply them to image views and review vector xml details like path data and fill.
Master advanced vector animations and path morphing with shapeshifter, transforming paths via curves, stroke color changes, rotations, and group pivots to export animated vector drawables for Android apps.
Learn to animate trim path to create handwriting effects by drawing in Inkscape, exporting to SVG, importing into Shapeshifter, and exporting an Android animator drawable for Android Studio.
In this lecture, you learn to create a spring animation and apply it to a bottom sheet.
In this lecture, learners create a simple animation in Adobe After Effects, animate two rectangles and a text caption with keyframes, and export the composition as JSON for Android.
In this lecture you learn about LottieFiles, a good online resource full of free Lottie animations for use in Android apps.
Learn motion layout, a declarative android animation system built on constraint layout, using XML motion scenes to animate between start and end endpoints, with keyframes and Android Studio tooling.
Configure a swipe trigger to start motion in motion layout, using on swipe in XML or the visual motion editor, set the target view and drag direction.
Learn to craft complex animations with motion layout keyframes, using position and attribute keyframes to rotate, scale, and move views via XML or the visual motion editor.
Explore constraint layout to design Android app layouts and create appealing animations. Learn to animate using features like constraint group, set, and placeholder.
Learn to build a simple fade animation with ConstraintLayout Group to reveal multiple login views from hidden to visible, using a fade transition for smooth, coordinated UI animation.
Have you ever been curious where those fancy motions in your favorite Android app come from? Have you ever asked yourself "Hey man! How can I add such animations to my apps?!"
Here's the good news!
In this course, you will understand how animation works in Android and will get a grip on Android's animation capabilities. You will also learn practical techniques to apply various animations in your Android apps. I will discuss many of Android's built-in APIs for creating animations in Android applications. Further, you will also get guides on several useful libraries to help you take your user interface / user experience to the next level by adding fantastic animations to your apps.
The course starts with view animations and then talks about animators, transitions, window animations, MotionLayout, animated vector drawables, third-party animation libraries and many more. So, the course can be beneficial to you if you are either a beginner or a professional Android app developer. The content can be consumed with minimum requirements. Only a decent computer and Internet connection will sufficie.
I look forward to seeing you in the course.
You will get guaranteed access to the eductional material, videos, and my support. If for any reason you didn't find the course meeting your expectations, you can get a refund within 30 days of your purchase. So, I assure you this will be a good investment in taking your development journey to the next level.