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

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

    
    
  • 相关阅读:
    nginx 禁止访问某个目录
    ssh 无法链接的解决思路
    linux 时间修改(同步到时间服务器)
    BitNami Gitlab的重启问题
    gitlab push时报错
    VirtualBox 安装centos后无法上网
    VirtualBox 创建64位系统的问题
    NOIP2010 题解
    NOIP2011 题解
    NOIP2012 题解
  • 原文地址:https://www.cnblogs.com/yizuochengchi2012/p/5760833.html
Copyright © 2011-2022 走看看