androidtextviewmarqueefadinghwui

Abnormal rectangle block appears in marquee text with fading edge in android


Why abnormal square block appears on the edge of textview ?

when it has

TextView defination

    <TextView
    android:id="@+id/mytext"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:ellipsize="marquee"
    android:fadingEdge="horizontal"
    android:text="@string/hello_world"
    android:singleLine="true"  
    android:textSize="55sp" />

TextView property

TextView textView = (TextView) findViewById(R.id.mytext);
textView.setAlpha(0.7f);

This problem is not seen on android 4.1 but it's present on android 4.2 onwards if fading edge is enabled.


Solution

  • After further research it was bug in android framework after uploading below change it is resolved. https://android-review.googlesource.com/#/c/69101/

    The issue is no longer appear in latest version of android.