I have an ArrayAdapter for my ListView. It has a textview and an arrow image. If the TextView has 3 lines or more, I have to show the image of the arrow, but if the line is count <3, the arrow should be hidden. But in fact, the adapter does not have their lines if it draws before the TextView. Any ideas? I need to show an element with an arrow or not, depends on the number of lines.
This code does not work (TextView gets the number of lines only after drawing)
if(holder.text.getLineCount() < 3)
{
holder.arrow.setVisibility(View.GONE);
}
else
{
holder.arrow.setVisibility(View.VISIBLE);
}
source
share