补充一些代码注释
This commit is contained in:
@ -29,7 +29,7 @@ public class ExpandTextView extends AppCompatTextView {
|
||||
private String mExpandText = mEndText + "全文";
|
||||
private CharSequence mExpandedText = "";
|
||||
private boolean mUseGradientAlphaEndText = false;
|
||||
private boolean mShowExpandTextRegardlessOfMaxLines = false;
|
||||
private boolean mShowExpandTextRegardlessOfMaxLines = false; // 不论文字超过 maxLines 都显示"...展开"文字
|
||||
|
||||
private int mMaxLines = 3; // 由于sdk版本限制(getMaxLines) 这里设置默认值
|
||||
|
||||
@ -98,6 +98,11 @@ public class ExpandTextView extends AppCompatTextView {
|
||||
this.mExpandCallback = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* 适用于不使用 maxLines 而是整段收起时的文字来确定“...更多”的位置的样式
|
||||
* @param shrankText 收起时的文字 (“...更多”跟在 shrankText 后)
|
||||
* @param expandedText 展开时的文字
|
||||
*/
|
||||
public void setShrankTextAndExpandedText(CharSequence shrankText, CharSequence expandedText) {
|
||||
mShrankText = shrankText;
|
||||
mExpandedText = expandedText;
|
||||
|
||||
Reference in New Issue
Block a user