I have a TextView with onClickListener() . When I click on the TextView , it blinks. How to disable this effect?
Here is the XML
<TextView android:id="@+id/descriptionText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/background" android:ellipsize="end" android:paddingTop="4dp" android:paddingLeft="8dp" android:maxLines="3" />
I tried to remove the android:ellipsize and android:maxLines - no effect.
And here is the code:
accountDescriptionTextView = (TextView) v.findViewById(R.id.descriptionText); accountDescriptionTextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (descriptionOpened) { // accountDescriptionTextView.setEllipsize(TextUtils.TruncateAt.END); // accountDescriptionTextView.setMaxLines(3); descriptionOpened = false; } else { // accountDescriptionTextView.setEllipsize(null); // accountDescriptionTextView.setMaxLines(100); descriptionOpened = true; } } });
I need to have commented functionality, but even when these lines are commented out, I still see how the text is viewed.
The text just disappears when I press my finger on the screen and appears when I remove my finger.
source share