I am experiencing a rather strange bug with TextView on Android. The text can flow over TextView's top border at random times then user interacts with it. It looks like this happens when TextView changes it height with animation (it expands and shrinks on click).
So here how it looks (views borders drawing enabled with android dev tools, and I've marked TextView's borders with red ) http://s7.postimage.org/c1ynrbwjv/so_full.png
I've tried calling invalidate() (postInvalidate() either), requestLayout() and resetting gravity of TextView.
I also tried to rewrite expanding and shrinking animation, to use getLayoutParams().height to set height, instead of setMaxHeight().
At the end I've put TextView into LinearLayout (setting TextView height to layout_height="wrap_content"), and expanding/shrinking LinearLayout instead of TextView (so TextView's bounds doesn't change directly). But that, as you can guess, didn't help.
TextView layout (BoardPostText extends TextView):
<my.package.view.BoardPostText
android:id="@+id/postText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/postTitle"
android:clickable="true"
android:linksClickable="true"
android:longClickable="true"
android:maxHeight="@dimen/post_image_max_height"
android:paddingLeft="5dp"
android:textColor="@color/post_data_text_color"
android:textSize="@dimen/post_data_text_size"
android:textColorLink="@color/post_link_color" />
TextView's code https://gist.github.com/d47e8eafb1bcff7c8db1