修改问题详情/回答详情UI(15.16) https://gitlab.ghzs.com/pm/halo-app-issues/issues/650#note_30101
This commit is contained in:
@ -21,7 +21,6 @@ import androidx.core.content.ContextCompat;
|
||||
public class ExpendTextView extends AppCompatTextView {
|
||||
|
||||
private CharSequence mSnapshotText;
|
||||
private CharSequence mCloseText;
|
||||
|
||||
private String mExpendText = "...全文";
|
||||
|
||||
@ -48,7 +47,6 @@ public class ExpendTextView extends AppCompatTextView {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
if (mInitLayout && !mOpenLayout && getLineCount() > mMaxLines) {
|
||||
mSnapshotText = getText();
|
||||
mCloseText = getText();
|
||||
mInitLayout = false;
|
||||
showExpendButton();
|
||||
}
|
||||
@ -81,7 +79,7 @@ public class ExpendTextView extends AppCompatTextView {
|
||||
float expendTextWidth = paint.measureText(mExpendText);
|
||||
CharSequence content = mSnapshotText.subSequence(start, lastLineEnd);
|
||||
if (viewWidth - lastLineRight > expendTextWidth) {
|
||||
content = content.toString().trim() + mExpendText;
|
||||
content = content.toString().trim() + mExpendText ;
|
||||
} else {
|
||||
CharSequence lastText = mSnapshotText.subSequence(lastLineStart, lastLineEnd);
|
||||
for (int i = lastText.length() - 1; i > 0; i--) {
|
||||
@ -93,7 +91,7 @@ public class ExpendTextView extends AppCompatTextView {
|
||||
}
|
||||
}
|
||||
}
|
||||
SpannableStringBuilder msp = new SpannableStringBuilder(mCloseText);
|
||||
SpannableStringBuilder msp = new SpannableStringBuilder(mSnapshotText);
|
||||
int length = msp.length();
|
||||
int startPosition = content.length() - mExpendText.length();
|
||||
startPosition = startPosition < 0 ? 0 : startPosition;
|
||||
|
||||
Reference in New Issue
Block a user