Skip to content

Commit 5630f4f

Browse files
author
zaaach
committed
*release 1.0.6
1 parent 17534b8 commit 5630f4f

7 files changed

Lines changed: 70 additions & 13 deletions

File tree

.idea/gradle.xml

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dependencies {
6060
app:tl_scrollbarHeight="4dp"
6161
app:tl_scrollbarRadius="2dp"
6262
app:tl_scrollbarMarginTop="6dp"
63+
app:tl_scrollbarMarginBottom="6dp"
6364
app:tl_scrollbarTrackColor="#f0f0f0"
6465
app:tl_scrollbarThumbColor="#FFC107"/>
6566
```
@@ -109,6 +110,7 @@ TransformersOptions options = new TransformersOptions.Builder()
109110
.scrollBarHeight(Util.dp2px(this, 3))
110111
.scrollBarRadius(Util.dp2px(this, 3) / 2f)
111112
.scrollBarTopMargin(Util.dp2px(this, 6))
113+
.scrollBarBottomMargin(Util.dp2px(this, 6))
112114
.scrollBarTrackColor(Color.parseColor("#e5e5e5"))
113115
.scrollBarThumbColor(Color.parseColor("#658421"))
114116
.build();
@@ -143,23 +145,28 @@ header.apply(options)//options可为null
143145
| tl_scrollbarWidth | dimension \| reference | scrollbar宽度,默认48dp |
144146
| tl_scrollbarHeight | dimension \| reference | scrollbar高度,默认3dp |
145147
| tl_scrollbarMarginTop | dimension \| reference | scrollbar上间距 |
148+
| tl_scrollbarMarginBottom | dimension \| reference | scrollbar下间距 |
146149
| tl_scrollbarRadius | dimension \| reference | scrollbar圆角,默认高度的一半 |
147150
| tl_scrollbarTrackColor | color \| reference | scrollbar轨道颜色 |
148151
| tl_scrollbarThumbColor | color \| reference | scrollbar高亮颜色 |
149152

150153
# Change log
151154

152-
2020-2-1
155+
2020-12-04
156+
157+
- 增加scrollbar下间距属性
158+
159+
2020-02-01
153160

154161
- 修复数据更新问题
155162

156-
2020-1-21
163+
2020-01-21
157164

158165
- 新方法修复滚动条变长变短问题(很完美)
159166
- 支持数据重新排序
160167
- 回调方法变动
161168

162-
2020-1-5
169+
2020-01-05
163170

164171
- 修复滚动条突然变长变短的问题
165172
- 优化默认圆角大小显示效果
@@ -170,18 +177,20 @@ header.apply(options)//options可为null
170177

171178
# About me
172179

173-
掘金主页:[ https://juejin.im/user/56f3dfe8efa6310055ac719f ](https://juejin.im/user/56f3dfe8efa6310055ac719f)
180+
掘金:[ https://juejin.im/user/56f3dfe8efa6310055ac719f ](https://juejin.im/user/56f3dfe8efa6310055ac719f)
181+
182+
简书:[ https://www.jianshu.com/u/913a8bb93d12 ](https://www.jianshu.com/u/913a8bb93d12)
174183

175-
简书主页[ https://www.jianshu.com/u/913a8bb93d12 ](https://www.jianshu.com/u/913a8bb93d12)
184+
淘宝店[ LEON家居生活馆 (动漫摆件)]( https://shop238932691.taobao.com)
176185

177-
我的淘宝店:[ https://shop238932691.taobao.com ]( https://shop238932691.taobao.com)
186+
![LEON](https://raw.githubusercontent.com/zaaach/imgbed/master/arts/leon_shop_qrcode.png)
178187

179-
:smile:是时候来一波三连了~
188+
:wink:淘宝店求个关注:wink:
180189

181190
# License
182191

183192
```
184-
Copyright (c) 2019 zaaach
193+
Copyright (c) 2020 zaaach
185194
186195
Licensed under the Apache License, Version 2.0 (the "License");
187196
you may not use this file except in compliance with the License.

transformerslayout/src/main/java/com/zaaach/transformerslayout/TransformersLayout.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class TransformersLayout<T> extends LinearLayout {
5151
private int scrollBarTrackColor;
5252
private int scrollBarThumbColor;
5353
private int scrollBarTopMargin;
54+
private int scrollBarBottomMargin;
5455
private int scrollBarWidth;
5556
private int scrollBarHeight;
5657
private boolean pagingMode;
@@ -96,6 +97,7 @@ private void parseAttrs(Context context, AttributeSet attrs) {
9697
scrollBarTrackColor = array.getColor(R.styleable.TransformersLayout_tl_scrollbarTrackColor, DEFAULT_TRACK_COLOR);
9798
scrollBarThumbColor = array.getColor(R.styleable.TransformersLayout_tl_scrollbarThumbColor, DEFAULT_THUMB_COLOR);
9899
scrollBarTopMargin = array.getDimensionPixelSize(R.styleable.TransformersLayout_tl_scrollbarMarginTop, 0);
100+
scrollBarBottomMargin = array.getDimensionPixelSize(R.styleable.TransformersLayout_tl_scrollBarMarginBottom, 0);
99101
scrollBarWidth = array.getDimensionPixelSize(R.styleable.TransformersLayout_tl_scrollbarWidth, dp2px(DEFAULT_SCROLL_BAR_WIDTH));
100102
scrollBarHeight = array.getDimensionPixelSize(R.styleable.TransformersLayout_tl_scrollbarHeight, dp2px(DEFAULT_SCROLL_BAR_HEIGHT));
101103
array.recycle();
@@ -146,6 +148,7 @@ public boolean canScrollVertically() {
146148
private void setupScrollBar() {
147149
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(scrollBarWidth, scrollBarHeight);
148150
params.topMargin = scrollBarTopMargin;
151+
params.bottomMargin = scrollBarBottomMargin;
149152
scrollBar.setLayoutParams(params);
150153
scrollBar.setTrackColor(scrollBarTrackColor)
151154
.setThumbColor(scrollBarThumbColor)

transformerslayout/src/main/java/com/zaaach/transformerslayout/TransformersOptions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class TransformersOptions {
1515
public final int scrollBarWidth;
1616
public final int scrollBarHeight;
1717
public final int scrollBarTopMargin;
18+
public final int scrollBarBottomMargin;
1819
public final int scrollBarTrackColor;
1920
public final int scrollBarThumbColor;
2021
public final float scrollBarRadius;
@@ -26,6 +27,7 @@ private TransformersOptions(Builder builder) {
2627
scrollBarWidth = builder.scrollBarWidth;
2728
scrollBarHeight = builder.scrollBarHeight;
2829
scrollBarTopMargin = builder.scrollBarTopMargin;
30+
scrollBarBottomMargin = builder.scrollBarBottomMargin;
2931
scrollBarTrackColor = builder.scrollBarTrackColor;
3032
scrollBarThumbColor = builder.scrollBarThumbColor;
3133
scrollBarRadius = builder.scrollBarRadius;
@@ -38,6 +40,7 @@ public static class Builder{
3840
private int scrollBarWidth;
3941
private int scrollBarHeight;
4042
private int scrollBarTopMargin;
43+
private int scrollBarBottomMargin;
4144
private int scrollBarTrackColor;
4245
private int scrollBarThumbColor;
4346
private float scrollBarRadius = -1;
@@ -68,6 +71,11 @@ public Builder scrollBarTopMargin(@Px int topMargin){
6871
return this;
6972
}
7073

74+
public Builder scrollBarBottomMargin(@Px int bottomMargin){
75+
scrollBarBottomMargin = bottomMargin;
76+
return this;
77+
}
78+
7179
public Builder scrollBarWidth(@Px int width) {
7280
this.scrollBarWidth = width;
7381
return this;

transformerslayout/src/main/res/values/attrs.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<attr name="tl_scrollbarHeight" format="dimension|reference"/>
1414
<!--滚动条上间距-->
1515
<attr name="tl_scrollbarMarginTop" format="dimension|reference"/>
16+
<!--滚动条下间距-->
17+
<attr name="tl_scrollBarMarginBottom" format="dimension|reference"/>
1618
<!--滚动条圆角-->
1719
<attr name="tl_scrollbarRadius" format="dimension|reference"/>
1820
<!--滚动条轨道颜色-->

0 commit comments

Comments
 (0)