

{"id":76570,"date":"2020-03-03T10:00:38","date_gmt":"2020-03-03T04:30:38","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=76570"},"modified":"2021-08-25T14:04:37","modified_gmt":"2021-08-25T08:34:37","slug":"android-animations","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-animations\/","title":{"rendered":"Android Animations &#8211; How to make your Android App attractive?"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1172,&quot;href&quot;:&quot;https:\\\/\\\/developer.android.com\\\/reference\\\/android\\\/view\\\/animation\\\/Interpolator&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250923102422\\\/https:\\\/\\\/developer.android.com\\\/reference\\\/android\\\/view\\\/animation\\\/Interpolator&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 02:38:27&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-17 10:47:02&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-26 08:33:21&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-04 14:21:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-31 05:24:23&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-10 11:08:37&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-24 10:27:56&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-06 14:53:32&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-19 18:45:48&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-23 06:09:11&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-02 02:45:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-28 07:28:00&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-11 22:58:27&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-11 22:58:27&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>In Android, we have the ability to make Animations. The animation is a process in which pictures are manipulated to appear as if they are moving. It creates moving images or shapes that are in motion. Animations are useful for the changes in UI state when new actions take place. Android Animations adds a new look to the application and gives them a new feel and quality.<\/p>\n<p><em><strong>Learn to build your first <a href=\"https:\/\/data-flair.training\/blogs\/create-android-app\/\">Android App<\/a> with DataFlair.<\/strong><\/em><\/p>\n<h3>Ways to Animate User-Interface Components<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ways-to-animate-user-interface-components.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76615 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ways-to-animate-user-interface-components.jpg\" alt=\"animate user interface components\" width=\"402\" height=\"478\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ways-to-animate-user-interface-components.jpg 402w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ways-to-animate-user-interface-components-126x150.jpg 126w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/ways-to-animate-user-interface-components-252x300.jpg 252w\" sizes=\"auto, (max-width: 402px) 100vw, 402px\" \/><\/a><\/h3>\n<p>Now, in Android Animations, let&#8217;s see the different ways to animate user-interface components.<\/p>\n<h4>1. Animate the Bitmaps<\/h4>\n<p>If we want to get the bitmaps in motion, we can easily get them. We can animate the bitmaps such as icons, using drawable animation APIs. We define them statically using a drawable resource, but it can also be defined at runtime.<\/p>\n<h4>2. Animate the UI Visibility and Motion<\/h4>\n<p>Using Android animations, we can bring some changes in Visibility or position of views in a layout. To move, hide or show views within a layout, we can use the property animation system by <strong>android.animation package<\/strong>. This will update the properties of the view that we want to bring change in.<\/p>\n<p>For this, we can enable android animations on our layout to create animations at ease.<\/p>\n<h4>3. Animate Layout Changes<\/h4>\n<p>We can apply android animations in the Layouts as well. For this, we would have to specify the starting and ending of the layout and the type of Android Animation that we want. The system will then find and execute the animation between the two layouts.<\/p>\n<p>Now for this, we will store the starting and the ending of the layout in a <strong>Scene<\/strong>. The starting scene is usually automatically determined from the current layout. Then we will create a Transition to tell the system the required type of animation. After that, we will call <strong>TransitionManager.go()<\/strong> and the system then runs the Animation.<\/p>\n<h4>4. Animate between Activities<\/h4>\n<p>We can provide animation between the activities of an application. So, we can add android animations that are showing some transition from one activity to another.<\/p>\n<p>For this, we will <strong>call startActivity()<\/strong> &amp; pass some options provided by\u00a0<strong>ActivityOptions.makeSceneTransitionAnimation()<\/strong>. This may include the views shared between the activities so that transition can connect them during the animation.<\/p>\n<h3>Tween Animation in Android<\/h3>\n<p>Tween Animation is basically used to make a GUI of the <a href=\"https:\/\/data-flair.training\/blogs\/android-activity\/\"><em><strong>Activity<\/strong><\/em><\/a> or Application more interactive and happening. It is basically an animation that translates, rotates, and scales any type of view in Android. Tween animation takes some parameters such as values, times, duration, size, etc and performs the required animation on that object. It applies to all types of objects.<\/p>\n<p>In order to perform this animation, we will call static function <strong>loadAnimation()<\/strong> of AnimationUtils. The syntax is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Animation myanimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.this_animation);<\/pre>\n<p>To apply animation to an object, we call <strong>startAnimation()<\/strong> method of the object, as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">TextView text = (TextView)findViewById(R.id.tv1);\r\ntext.startAnimation(animation);<\/pre>\n<p>This Animation class has the following functions that are very useful:<\/p>\n<table class=\"df-table-center\">\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">Method<\/span><\/td>\n<td><span style=\"font-weight: 400\">Description<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">start()<\/span><\/td>\n<td><span style=\"font-weight: 400\">It starts the animation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">setDuration(long duration)<\/span><\/td>\n<td><span style=\"font-weight: 400\">It sets the time duration of the animation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">getDuration()<\/span><\/td>\n<td><span style=\"font-weight: 400\">It gets the method to be set by the above.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">end()<\/span><\/td>\n<td><span style=\"font-weight: 400\">It ends the animation that was started<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">cancel()<\/span><\/td>\n<td><span style=\"font-weight: 400\">It cancels the working of animation<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Interpolator in Android<\/h3>\n<p>An <a href=\"https:\/\/developer.android.com\/reference\/android\/view\/animation\/Interpolator\">interpolator<\/a> by name means to alter, intercept or insert between two things. Similarly, Interpolator applies some additional effects between the start() and the end() values of a property of an object. It also defines the rate of change in animation.<\/p>\n<h4>Types of Interpolators in Android<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76616 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators.jpg\" alt=\"types of interpolators in android animations\" width=\"554\" height=\"592\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators.jpg 554w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators-140x150.jpg 140w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators-281x300.jpg 281w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-interpolators-520x556.jpg 520w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/a><\/h4>\n<p>Interpolators can be of 9 types as shown in the following:<\/p>\n<p><strong>1. Linear Interpolator &#8211;<\/strong> It is the default interpolator of all android animations. It states that the rate of change is constant.<\/p>\n<p><strong>2. Accelerate Interpolator &#8211;<\/strong> It accelerates the movement of a view. It starts slowly and accelerates gradually.<\/p>\n<p><strong>3. Decelerate Interpolator &#8211;<\/strong> It does the reverse of an accelerator and decreases the speed gradually.<\/p>\n<p><strong>4. Anticipate Interpolator &#8211;<\/strong> It moves the animation backward prior to its start.<\/p>\n<p><strong>5. Overshoot Interpolator &#8211;<\/strong> It does the reverse of Anticipate interpolator.<\/p>\n<p><strong>6. Bounce Interpolator &#8211;<\/strong> It gives a bouncing view to the animation.<\/p>\n<p><strong>7. Cycle Interpolator &#8211;<\/strong> It repeats the animations for a number of cycles.<\/p>\n<p><strong>8. Anticipate Overshoot Interpolator &#8211;<\/strong> It combines both the Anticipate and overshoot interpolators.<\/p>\n<p><strong>9. Accelerate Decelerate Interpolator &#8211;<\/strong> It keeps the animation slow in the beginning and fast in the middle. It again slows it down at the end.<\/p>\n<h2>Implementation of Android Animations<\/h2>\n<p><strong>Step 1:<\/strong> First of all we will create a new project and name it.<\/p>\n<p>After that, we will create the layout of our application, in the\u00a0<strong>acitvity_main.xml <\/strong>file<strong>.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout\r\n   xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n   xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n   android:layout_width=\"match_parent\"\r\n   android:layout_height=\"match_parent\"\r\n   tools:context=\".MainActivity\"&gt;\r\n\r\n   &lt;TextView\r\n       android:id=\"@+id\/tV1\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_centerHorizontal=\"true\"\r\n       android:layout_marginLeft=\"90dp\"\r\n       android:layout_marginTop=\"40dp\"\r\n       android:fontFamily=\"@font\/aclonica\"\r\n       android:text=\"DataFlair \"\r\n       android:textColor=\"@color\/colorPrimaryDark\"\r\n       android:textSize=\"50dp\" \/&gt;\r\n\r\n\r\n   &lt;ImageView\r\n       android:id=\"@+id\/imageView\"\r\n       android:layout_width=\"89dp\"\r\n       android:layout_height=\"124dp\"\r\n       android:layout_centerHorizontal=\"true\"\r\n       android:layout_marginLeft=\"-19dp\"\r\n       android:layout_marginTop=\"130dp\"\r\n       android:layout_marginRight=\"19dp\"\r\n       android:src=\"@drawable\/ic_android\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:id=\"@+id\/button\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"78dp\"\r\n       android:background=\"@android:color\/white\"\r\n       android:onClick=\"zoom\"\r\n       android:text=\"zoom\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:id=\"@+id\/button2\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"21dp\"\r\n       android:background=\"@android:color\/white\"\r\n       android:onClick=\"rotate\"\r\n       android:text=\"rotate\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:id=\"@+id\/button3\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"137dp\"\r\n       android:background=\"@android:color\/white\"\r\n       android:onClick=\"fade\"\r\n       android:text=\"fade\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"203dp\"\r\n       android:background=\"@android:color\/white\"\r\n       android:onClick=\"blink\"\r\n       android:text=\"blink\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:id=\"@+id\/button5\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"260dp\"\r\n       android:background=\"@android:color\/white\"\r\n       android:onClick=\"move\"\r\n       android:text=\"move\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n   &lt;Button\r\n       android:id=\"@+id\/button6\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_below=\"@id\/imageView\"\r\n       android:layout_marginLeft=\"150dp\"\r\n       android:layout_marginTop=\"321dp\"\r\n       android:onClick=\"slide\"\r\n       android:text=\"slide\"\r\n       android:background=\"@android:color\/white\"\r\n       android:textColor=\"@android:color\/black\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p><strong>Step 2:<\/strong> Then we will write code for <strong>MainAcitivty.java<\/strong> file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.DataFlair.myanime;\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.view.animation.Animation;\r\nimport android.view.animation.AnimationUtils;\r\nimport android.widget.ImageView;\r\n\r\npublic class MainActivity extends Activity {\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.activity_main);\r\n   }\r\n\r\n   public void zoom(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),\r\n               R.anim.myanimation);\r\n       image.startAnimation(animation);\r\n   }\r\n\r\n   public void rotate(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation1 = \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AnimationUtils.loadAnimation(getApplicationContext(),\r\n               R.anim.clockwise);\r\n       image.startAnimation(animation1);\r\n   }\r\n\r\n   public void fade(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation1 =\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AnimationUtils.loadAnimation(getApplicationContext(),\r\n                       R.anim.fade);\r\n       image.startAnimation(animation1);\r\n   }\r\n\r\n   public void blink(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation1 =\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AnimationUtils.loadAnimation(getApplicationContext(),\r\n                       R.anim.blink);\r\n       image.startAnimation(animation1);\r\n   }\r\n\r\n   public void move(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation1 =\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AnimationUtils.loadAnimation(getApplicationContext(), R.anim.move);\r\n       image.startAnimation(animation1);\r\n   }\r\n\r\n   public void slide(View view){\r\n       ImageView image = (ImageView)findViewById(R.id.imageView);\r\n       Animation animation1 =\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide);\r\n       image.startAnimation(animation1);\r\n   }\r\n}<\/pre>\n<p><strong>Step 3:<\/strong> Now we will write codes for zoom, rotate, slide, etc. in <strong>res\/anim\/ files<\/strong>:<\/p>\n<ul>\n<li><strong>res\/anim\/zoom<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\r\n\r\n   &lt;scale xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n       android:fromXScale=\"0.5\"\r\n       android:toXScale=\"3.0\"\r\n       android:fromYScale=\"0.5\"\r\n       android:toYScale=\"3.0\"\r\n       android:duration=\"6000\"\r\n       android:pivotX=\"50%\"\r\n       android:pivotY=\"50%\" &gt;\r\n   &lt;\/scale&gt;\r\n\r\n   &lt;scale xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n       android:startOffset=\"6000\"\r\n       android:fromXScale=\"3.0\"\r\n       android:toXScale=\"0.5\"\r\n       android:fromYScale=\"3.0\"\r\n       android:toYScale=\"0.5\"\r\n       android:duration=\"6000\"\r\n       android:pivotX=\"50%\"\r\n       android:pivotY=\"50%\" &gt;\r\n   &lt;\/scale&gt;\r\n\r\n&lt;\/set&gt;<\/pre>\n<ul>\n<li><strong>res\/anim\/slide<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\nandroid:fillAfter=\"true\" &gt;\r\n\r\n   &lt;scale\r\n       android:duration=\"800\"\r\n       android:fromXScale=\"1.0\"\r\n       android:fromYScale=\"1.0\"\r\n       android:interpolator=\"@android:anim\/linear_interpolator\"\r\n       android:toXScale=\"1.0\"\r\n       android:toYScale=\"0.0\" \/&gt;\r\n&lt;\/set&gt;<\/pre>\n<ul>\n<li><strong>res\/anim\/rotate<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\r\n\r\n   &lt;rotate xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n       android:fromDegrees=\"0\"\r\n       android:toDegrees=\"360\"\r\n       android:pivotX=\"50%\"\r\n       android:pivotY=\"50%\"\r\n       android:duration=\"2000\" &gt;\r\n   &lt;\/rotate&gt;\r\n\r\n   &lt;rotate xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n       android:startOffset=\"5000\"\r\n       android:fromDegrees=\"360\"\r\n       android:toDegrees=\"0\"\r\n       android:pivotX=\"50%\"\r\n       android:pivotY=\"50%\"\r\n       android:duration=\"2000\" &gt;\r\n   &lt;\/rotate&gt;\r\n\r\n&lt;\/set&gt;<\/pre>\n<ul>\n<li><strong>res\/anim\/fade<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n<b>\u00a0\u00a0\u00a0<\/b>android:interpolator=\"@android:anim\/accelerate_interpolator\" &gt;\r\n\r\n   &lt;alpha\r\n       android:fromAlpha=\"0\"\r\n       android:toAlpha=\"1\"\r\n       android:duration=\"3000\" &gt;\r\n   &lt;\/alpha&gt;\r\n\r\n   &lt;alpha\r\n       android:startOffset=\"2000\"\r\n       android:fromAlpha=\"1\"\r\n       android:toAlpha=\"0\"\r\n       android:duration=\"3000\" &gt;\r\n   &lt;\/alpha&gt;\r\n\r\n&lt;\/set&gt;<\/pre>\n<ul>\n<li><strong>res\/anim\/blink<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;set xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"&gt;\r\n   &lt;alpha android:fromAlpha=\"0.0\"\r\n       android:toAlpha=\"1.0\"\r\n       android:interpolator=\"@android:anim\/accelerate_interpolator\"\r\n       android:duration=\"600\"\r\n       android:repeatMode=\"reverse\"\r\n       android:repeatCount=\"infinite\"\/&gt;\r\n&lt;\/set&gt;<\/pre>\n<ul>\n<li><strong>res\/anim\/move<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;set\r\n   xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n   android:interpolator=\"@android:anim\/linear_interpolator\"\r\n   android:fillAfter=\"true\"&gt;\r\n\r\n   &lt;translate\r\n       android:fromXDelta=\"0%p\"\r\n       android:toXDelta=\"75%p\"\r\n       android:duration=\"2000\" \/&gt;\r\n&lt;\/set&gt;<\/pre>\n<p><strong>Step 5:<\/strong> After we run the app we will see the following in the output:<a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/run-the-app.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76641 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/03\/run-the-app.gif\" alt=\"running of android animations\" width=\"290\" height=\"604\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>So in this article, we have learned the different kinds of android animations that can be provided in an application. And we have seen the methods that are required for it. Other than that we also read various types of android Animations and where they can be applied. At the end, we also implemented it in our application as well. That was all for this article.<\/p>\n<p>If you have any queries in DataFlair&#8217;s Android Animations article, mention them in the comment section. We will be happy to help you.<\/p>\n<p>Happy Learning\ud83d\ude03<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In Android, we have the ability to make Animations. The animation is a process in which pictures are manipulated to appear as if they are moving. It creates moving images or shapes that are&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":76619,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[22031,22032,22037,22035,22034,22036,22033],"class_list":["post-76570","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-animations","tag-animations-in-android","tag-implementation-of-android-animations","tag-interpolator-in-android","tag-tween-animation-in-android","tag-types-of-interpolators-in-android","tag-ways-to-animate-user-interface-components"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Animations - How to make your Android App attractive? - DataFlair<\/title>\n<meta name=\"description\" content=\"Know the ways to animate user-interface components, tweet animations in android, concept of interpolators and its types. Also, learn to implement android animations in your application.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/android-animations\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Animations - How to make your Android App attractive? - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Know the ways to animate user-interface components, tweet animations in android, concept of interpolators and its types. Also, learn to implement android animations in your application.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-animations\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-03T04:30:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:34:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Animations - How to make your Android App attractive? - DataFlair","description":"Know the ways to animate user-interface components, tweet animations in android, concept of interpolators and its types. Also, learn to implement android animations in your application.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/android-animations\/","og_locale":"en_US","og_type":"article","og_title":"Android Animations - How to make your Android App attractive? - DataFlair","og_description":"Know the ways to animate user-interface components, tweet animations in android, concept of interpolators and its types. Also, learn to implement android animations in your application.","og_url":"https:\/\/data-flair.training\/blogs\/android-animations\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-03-03T04:30:38+00:00","article_modified_time":"2021-08-25T08:34:37+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Android Animations &#8211; How to make your Android App attractive?","datePublished":"2020-03-03T04:30:38+00:00","dateModified":"2021-08-25T08:34:37+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/"},"wordCount":918,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg","keywords":["Android Animations","animations in android","Implementation of Android Animations","Interpolator in Android","Tween Animation in Android","Types of Interpolators in Android","Ways to Animate User-Interface Components"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-animations\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-animations\/","url":"https:\/\/data-flair.training\/blogs\/android-animations\/","name":"Android Animations - How to make your Android App attractive? - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg","datePublished":"2020-03-03T04:30:38+00:00","dateModified":"2021-08-25T08:34:37+00:00","description":"Know the ways to animate user-interface components, tweet animations in android, concept of interpolators and its types. Also, learn to implement android animations in your application.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-animations\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-animations.jpg","width":802,"height":420,"caption":"animations in android"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-animations\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Android Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/android\/"},{"@type":"ListItem","position":3,"name":"Android Animations &#8211; How to make your Android App attractive?"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76570","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=76570"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76570\/revisions"}],"predecessor-version":[{"id":76642,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76570\/revisions\/76642"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/76619"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=76570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=76570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=76570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}