对接游戏详情数据(未完)

This commit is contained in:
张玉久
2020-04-15 18:57:46 +08:00
parent bb741013d4
commit 7f23cda97a
31 changed files with 725 additions and 296 deletions

View File

@ -24,6 +24,7 @@ public class ExpandTextView extends AppCompatTextView {
private CharSequence mSnapshotText;
private String mExpendText = "...全文";
private int expandTextBackgroundColor = Color.WHITE;
private int mMaxLines = 3; // 由于sdk版本限制(getMaxLines) 这里设置默认值
@ -43,6 +44,7 @@ public class ExpandTextView extends AppCompatTextView {
}
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.ExpandTextView);
mExpendText = array.getString(R.styleable.ExpandTextView_expandText) == null ? mExpendText : array.getString(R.styleable.ExpandTextView_expandText);
expandTextBackgroundColor = array.getColor(R.styleable.ExpandTextView_expandTextBackgroundColor, expandTextBackgroundColor);
array.recycle();
}
@ -119,7 +121,7 @@ public class ExpandTextView extends AppCompatTextView {
}
}
}, startPosition + 3, msp.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
msp.setSpan(new BackgroundColorSpan(Color.WHITE), startPosition, msp.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
msp.setSpan(new BackgroundColorSpan(expandTextBackgroundColor), startPosition, msp.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
setText(msp);
setMovementMethod(CustomLinkMovementMethod.getInstance());