问题
I have a ListView. There is a TextView for each list row. For the TextView, I have set the following properties in the xml file:
android:autoLink="web"
android:focusable="false"
android:focusableInTouchMode="false"
Also, for the parent layout of the list row, I have set:
android:descendantFocusability="blocksDescendants"
The three focus-related properties were set after going through several SO answers for the problem in which the TextView used to become un-clickable if it contained a link (e.g., www.example.com).
Now the clicks are all registered properly. However, the problem now is the following: for TextViews which have a link, the setOnItemClickListener
and setOnItemLongClickListener
animations are lost. The animations are lost only when I click the TextView
part of the ListView row. They still occur when I click the remaining part of the ListView row.
That is, the clicks are working, but the animation is lost. How do I get those back?
来源:https://stackoverflow.com/questions/31426409/textview-with-autolink-web-inside-listview-has-animation-issue