Open gagan1994 opened 6 years ago
I got the same issue.
use public class ReadMoreLoad extends ReadMoreTextView { public ReadMoreLoad(Context context) { super(context); }
public ReadMoreLoad(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public ReadMoreLoad(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onGlobalLayoutLineEndIndex() {
getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
ViewTreeObserver obs = getViewTreeObserver();
obs.removeOnPreDrawListener(this);
refreshLineEndIndex();
setText();
return false;
}
});
}
}
this will work for setting text with delay
It doesn't work when we set text with delay. i.e after executing onCreate