zoukankan      html  css  js  c++  java
  • 一行代码搞定Adapter

    15年Google I/O大会发不了三个重要支持库

    >Material design (Android Support Design)

    >百分比布局:Percent support lib

    >数据绑定: Data Binding Library

    如果你还不没用过Data Bind Library 没关系 那你知道ButterKnife吧 DataBindLibrary 和ButterKnife都是编译时期生成相应的注解文件 

    因此 在性能上不会有什么大的影响 因此放心的尝试吧。(个人感觉DataBind 比ButterKnife 稍微复杂一些 但是用起来也比较爽一些 后面会附上关于

    Data Binding使用的一些链接)

    一行代码搞定Adapter: 基于 RxJava + Data Binding + RxRecyclerView

    new RxDataSource<String>(dataSet).repeat(1).bindRecyclerView
    (fragmentBinding.mGridView,R.layout.item_homepage_gridview)
    .subscribe(stringViewDataBindingSimpleViewHolder -> {

    });

    详情见 github: https://github.com/ahmedrizwan/RxRecyclerAdapter

    关于Data Dinding:

    https://www.bignerdranch.com/blog/descent-into-databinding

    https://segmentfault.com/a/1190000002876984

    https://realm.io/cn/news/data-binding-android-boyar-mount/
    https://github.com/LyndonChin/MasteringAndroidDataBinding
    https://gold.xitu.io/post/578b944a128fe10063ad6c05

    最后附上一张妹子图接着赶路:

    
    
  • 相关阅读:
    时间插件--daterangepicker使用和配置详解
    AdminLTE 前端框架
    vue element-ui 绑定@keyup事件无效
    Plugin/Preset files are not allowed to export objects,webpack报错/babel报错的解决方法
    webpack学习
    指令
    【Nuxt】配置路由
    【面试】常见面试题
    安装虚拟机
    【linux】基础知识
  • 原文地址:https://www.cnblogs.com/yizuochengchi2012/p/5760833.html
Copyright © 2011-2022 走看看