Anti Aliasing Text in 4V
Learn to display text using the Anti-Aliasing Text View
Android provides reusable views like the TextView to render text in Android Applications. While displaying text using a TextView, it can often appear aliased and pixelated when the backlight is turned on.
The Android Media SDK provides the AntialiasingTextView which extends the functionality of a TextView to fix this issue.
You can use the AntiAliasingTextView in your app, if you need to display text along with your Media in 4V.

Using the AntiAliasingTextView

The AntialiasingTextView is a subclass of the TextView and therefore works exactly like it

Setting text in XML

The following snippet shows how to add the AntialiasingTextView to your layout's XML file.
1
<com.leiainc.androidsdk.core.AntialiasingTextView
2
android:id="@+id/text_view"
3
android:layout_width="match_parent"
4
android:layout_height="match_parent"
5
text="Hello World" />
Copied!

Setting text in Activity/Fragment

Alternately, you can also set the text in your Activity/Fragment.
Kotlin
Java
1
val textView: AntialiasingTextView = findViewById(R.id.text_view)
2
textView.text = "Hello World"
Copied!
1
AntialiasingTextView textView = findViewById(R.id.text_view);
2
textView.setText("Hello World");
Copied!