TextWriter in Android with Example
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.
- 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.
- Step 2: Add the support Library in build.gradle file and add dependency in the dependencies section.
- Step 3: Add the following code in activity_main.xml file. In this file add the TextWriter to the layout.
<?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>