Open In App
Related Articles

How to add fading TextView animation in Android

Improve Article
Save Article
Like Article

TextView is the basic building block of user interface components. It is used to set the text and display it to the user. It is a very basic component and used a lot.

A Fading TextView is a TextView that changes its content automatically every few seconds. If we want to design a beautiful interface than we can use Fading TextView.


  1. Add this to your root build.gradle file (not your module build.gradle file):

    allprojects {
        repositories {


  2. Add the support Library in your module’s build.gradle file and add dependency in the dependencies section.

    dependencies {
        implementation 'com.tomer:fadingtextview:2.5'


  3. Now add the following code in the activity_main.xml file.


    <?xml version="1.0" encoding="utf-8"?>
            app:layout_constraintTop_toTopOf="parent" />


  4. Now add the following code in the file.

    package org.geeksforgeeks.gfgFadingTextView;
    import android.os.Bundle;
    import com.tomer.fadingtextview.FadingTextView;
    public class MainActivity extends AppCompatActivity {
        FadingTextView fadingTextView;
        String[] text
            = { "GeeksForGeeks", "A",
                "Computer", "Science", "Portal",
                "For", "Geeks" };
        protected void onCreate(Bundle savedInstanceState)
                = findViewById(;



Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 23 Feb, 2021
Like Article
Save Article
Similar Reads
Complete Tutorials