Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

How to add fading TextView animation in Android

Improve Article
Save Article
Like Article
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(;


My Personal Notes arrow_drop_up
Last Updated : 23 Feb, 2021
Like Article
Save Article
Similar Reads
Related Tutorials