TextWriter in Android with Example Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report TextWriter is used to animate text. TextWriter can be used when users open the app i.e. in place of Splash Screen. One can also use Splash Screen instead of TextWriter but TextWriter is an animation library and it is known that animations help to gain the attention of the user so it is best to learn it. TextWriter can be customized according to the requirements like textColor, textSize, letterSpacing, and many more. Approach Step 1: Add the support library in the root build.gradle file (not in module build.gradle file). This library jitpack is a novel package repository. It is made for JVM so that any library which is present in github and bigbucket can be directly used in the application. XML allprojects { repositories { maven { url 'https://jitpack.io/' } } } Step 2: Add the support Library in build.gradle file and add dependency in the dependencies section. XML implementation 'com.github.sarnavakonar:TextWriter:v1.0' Step 3: Add the following code in activity_main.xml file. In this file add the TextWriter to the layout. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <com.sarnava.textwriter.TextWriter android:id="@+id/textWriter" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:android="http://schemas.android.com/apk/res/android" /> </androidx.constraintlayout.widget.ConstraintLayout> Step 4: Add the following code in MainActivity.java file. In this file add important tags of TextWriter and also add a setListner() to it which will invoked automatically when TextWriter written the whole text. MainActivity.java package org.geeksforgeeks.textWriter import android.graphics.Color; import android.os.Bundle; import android.widget.Toast; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import com.sarnava.textwriter.TextWriter; public class Activity extends AppCompatActivity { TextWriter textWriter; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textWriter = findViewById(R.id.textWriter); textWriter // sets the width of the view .setWidth(8) // More the value of delay, // more time it will take to finish // duration is in milliseconds .setDelay(30) // set color of text .setColor(Color.GREEN) // sets the configuration/shape of the drawing // based on Configuration selected .setConfig(TextWriter.Configuration.INTERMEDIATE) // set size of text .setSizeFactor(30f) // set letter spacing of text .setLetterSpacing(15f) .setText("ALGORITHM GFG") // when writing is finished this // function will get invoked automaically. .setListener(new TextWriter.Listener() { @Override public void WritingFinished() { Toast.makeText(Activity.this, "Learn Algorithm!", Toast.LENGTH_SHORT).show(); } }) .startAnimation(); } } Output: Run on Emulator Comment More infoAdvertise with us Next Article TextView in Android with Example M madhavmaheshwarimm20 Follow Improve Article Tags : Android Android-Animation Similar Reads TextView in Android with Example TextView is a simple widget that is seen in every android application. This widget is used to display simple text within the android application. We can add custom styling to the text that we have to show. In this article, we will take a look at How to create a simple Text View in an android applica 2 min read TextView widget in Android with Examples Widget refers to the elements of the UI (User Interface) that help the user interact with the Android App. TextView is one of many such widgets which can be used to improve the UI of the app. TextView refers to the widget which displays some text on the screen based on the layout, size, colour, etc 5 min read TextView widget in Android with Examples Widget refers to the elements of the UI (User Interface) that help the user interact with the Android App. TextView is one of many such widgets which can be used to improve the UI of the app. TextView refers to the widget which displays some text on the screen based on the layout, size, colour, etc 5 min read Expandable TextView in Android ExpandableTextView is an Android library which allows us to easily create a TextView which can expand/collapse when user clicks on it .we can use this feature in many apps such as movie review app or storytelling app and in many other apps. A sample GIF is given below to get an idea about what we ar 4 min read EditText widget in Android with Example Widget refers to the elements of the UI (User Interface) that helps user interacts with the Android App. EditText is one of many such widgets which can be used to retrieve text data from user.EditText refers to the widget that displays an empty text field in which a user can enter the required text 4 min read EditText widget in Android with Example Widget refers to the elements of the UI (User Interface) that helps user interacts with the Android App. EditText is one of many such widgets which can be used to retrieve text data from user.EditText refers to the widget that displays an empty text field in which a user can enter the required text 4 min read Like