I am to animate the textView which might have long text inside a CardView. I found couple of answers from this question animate textView.
<androidx.cardview.widget.CardView
android:id="@+id/lineCard"
android:layout_width="match_parent"
android:layout_height="120dp"
android:foreground="?attr/selectableItemBackground"
app:cardBackgroundColor="@color/Black">
<TextView
android:id="@+id/tvCallerName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:backgroundTint="#00FFFFFF"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAlignment="center"
android:textColor="@color/White"
android:textSize="32sp"/>
</androidx.cardview.widget.CardView>
I am using ellipsize,marqueeRepeatLimit,scrollHorizontally,singleLine
. But still it doesnt work. The text is displayed in two lines. What am I missinh here ? Thank you in advance.