android_custom_view_kotlin模块介绍

Author Avatar
夜孤黎 1月 10, 2018
  • 在其它设备中阅读本文章

android_custom_view_kotlin模块中封装了一些针对android_custom_view模块的kotlin扩展方法,这里只列出部分,更多扩展方法及其具体实现请查看源码。

Int.px2AutoWidth         : px转换为适配Autolayout的值
Int.px2AutoHeight()      : px转换为适配Autolayout的值
Context.dimen2AutoWidth  : 从dimen.xml获取px并转换为适配Autolayout的值
Context.dimen2AutoHeight : 从dimen.xml获取px并转换为适配Autolayout的值
View.v2auto()            : 将View适配Autolayout

SwipeRefreshLayout.setDistanceParamAuto : 设置下拉刷新图标的距离
RecyclerView.addHorizontalDivider       : 添加横向divider
RecyclerView.addVerticalDivider         : 添加竖向divider

<T:RecyclerView.Adapter<AutoViewHolder>>T.convert2EmptyWrapper : 添加默认的无数据提示

注意:

依赖本模块时需要同时依赖 android_custom_view模块才能正常使用。

如何使用:

api 'com.sumavision.android_base_kotlin:android_base_kotlin:v1.x.x'

查看源码:

svn://192.165.152.13/sumard5/Project/Tetris/trunk/platform/android-platform/AndroidPlatform/android_base_kotlin

This blog is under a CC BY-NC-SA 3.0 Unported License
本文链接:http://yeguli.cn/2018/01/10/android-custom-view-kotlin模块介绍/