代码拉取完成,页面将自动刷新
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.jxiang112:ExpandCollapseTextView:v1.0.2'
}
属性名称 | 属性类型 | 属性默认值 | 属性描述 |
---|---|---|---|
expand_text | string | 展开>> | 展开按钮显示的文本 |
collapse_text | string | 收起>> | 收起按钮显示的文本 |
expand_text_size | integer | 14 | 展开/折叠文本字体大小,单位sp |
expand_text_color | color | #00C25F | 展开/折叠文本颜色 |
content_text | string | 文本内容 | |
text_line_height | dimension | 0 | 行高 |
content_text_size | integer | 14 | 文本文字大小 |
content_text_color | color | #333333 | 文本文字颜色 |
collapse_show_line_number | integer | 2 | 折叠状态下,显示的行数 |
expand_state | enum | collapse | 设置展开折叠状态,collapse: 折叠状态;expend:展开状态 |
collapse_line_space_percent | integer | 20 | 折叠状态下,最后一行空白所占宽度的百分比,0-100 |
expend_click_event_on | enum | all | 点击可以展开/收起的事件源,all:点击文本的任何地方都可以展开/收起;expand_text:只有点击展开/收起按钮才可以展开/收起 |
//xml布局文件中:
<com.wyx.components.widgets.ExpandCollpaseTextView
android:id="@+id/expand_textview"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:content_text_color="#999999"
app:content_text_size="12"
app:text_line_height="2dp"
app:expand_text_color="#06C362"
app:collapse_line_space_percent="70"
/>
//java文件中:
ExpandCollpaseTextView expandTextView = findViewById(R.id.expand_textview);
expandTextView.setText("XXXXXXXXXXXXXXXXXXX");
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。