对接游戏详情数据(未完)
This commit is contained in:
@ -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());
|
||||
|
||||
Reference in New Issue
Block a user