android:ellipsize="end"
android:maxLines="2"
在代码中
if (holder.mTvContentLongArticle.getLineCount()>2){//第二行设置省略号
int lineEnd = holder.mTvContentLongArticle.getLayout().getLineEnd(1);
String text = holder.mTvContentLongArticle.getText().subSequence(0, lineEnd) + "...";
holder.mTvContentLongArticle.setText(text);
}