TextView with autoLink=“web” inside ListView has animation issue

心已入冬 提交于 2020-01-02 09:54:19

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!