
自定义控件
文章平均质量分 68
点滴之路
这个作者很懒,什么都没留下…
展开
-
带弹性滑动的ScrollView
public class SpringScrollView extends ScrollView { // 移动因子,手指移动100px,那么View就只移动50px private static final float MOVE_FACTOR = 0.5f; // 松开手指后, 界面回到正常位置需要的动画时间 private static final int A...原创 2020-04-15 09:56:56 · 306 阅读 · 0 评论 -
RecycleView中使用ExpandView实现折叠效果
效果图: 最近实现业务:点击了解更多加载商品,再点折叠上去,实现方法:item中嵌套expandView上代码:<com.xxxx.xxx.widget.ExpandView android:id="@+id/expandView" android:layout_width="match_parent" android:layout_height="wr...原创 2018-12-03 18:15:27 · 2890 阅读 · 2 评论 -
自定义FlowLayout控件实现自定义宽度并换行
最近的需求是实现添加购物车页面,展示规格的时候会出现显示不全,数据会自动剪切掉,后边重新自定义了FlowLayout问题得到解决,下面直接上代码public class FlowLayoutView extends ViewGroup { private final int DEFAULT_SPACING = 15; private int horizontalSpacing...原创 2018-12-10 14:41:02 · 1202 阅读 · 0 评论 -
RecycleView中实现折叠列表--之自定义ExpandView
先上效果图:这是一个RecycleView列表,点击了解更多展开显示主营业务及商品列表,再次点击了解更多收起。实现起来其实就是item列表中嵌套一个ExpandView默认隐藏,点击了解更多的时候显示,再点击是隐藏,实现起来其实挺简单的,在这块主要是自定义了一个ExpanView,下面直接上代码:public class ExpandView extends FrameLayou...原创 2018-12-10 15:09:43 · 2030 阅读 · 2 评论