This commit is contained in:
@ -25,6 +25,8 @@ public class ExpendTextView extends android.support.v7.widget.AppCompatTextView
|
||||
private boolean mInitLayout = false;
|
||||
private boolean mOpenLayout = false;
|
||||
|
||||
private ExpandCallback mExpandCallback;
|
||||
|
||||
public ExpendTextView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
@ -50,6 +52,10 @@ public class ExpendTextView extends android.support.v7.widget.AppCompatTextView
|
||||
this.mExpendText = text;
|
||||
}
|
||||
|
||||
public void setExpandCallback(ExpandCallback callback) {
|
||||
this.mExpandCallback = callback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(CharSequence text, BufferType type) {
|
||||
mInitLayout = true;
|
||||
@ -98,6 +104,9 @@ public class ExpendTextView extends android.support.v7.widget.AppCompatTextView
|
||||
setMaxLines(Integer.MAX_VALUE);
|
||||
setText(mSnapshotText);
|
||||
|
||||
if (mExpandCallback != null) {
|
||||
mExpandCallback.onExpand();
|
||||
}
|
||||
}
|
||||
}, length - mExpendText.length(), length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
@ -105,4 +114,8 @@ public class ExpendTextView extends android.support.v7.widget.AppCompatTextView
|
||||
setMovementMethod(CustomLinkMovementMethod.getInstance());
|
||||
}
|
||||
|
||||
interface ExpandCallback {
|
||||
void onExpand();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user