Code Monkey home page Code Monkey logo

butter's Introduction

一个对butterKnife 源码的 学习实践项目。 难点是学习 R2的生成及使用。

Butter Knife Attention: This tool is now deprecated. Please switch to view binding. Existing versions will continue to work, obviously, but only critical bug fixes for integration with AGP will be considered. Feature development and general bug fixes have stopped.ding.

上边来自 ButterKnife github 主页。虽然一代神库要落下帷幕了,但是它带给了我们很多。通过学习它可以get 到很多技能,这些很重要。

这里有一个问题:把项目clean以后,所有使用到R2的地方都会爆红,IDE会提示异常。为何编译的时候不收影响呢?

具体原因见(asset/pic3.png)

一个问题:依赖R2的这种写法,有一个不太友好的地方,就是每次变动了xml布局文件。例如:增加view,修改View id 的时候,R2肯定又是一片爆红。而且还没有办法像R那样智能提示开发者的能力。

解决思路:提供一个AS插件,实时监测xml文件变动,就像R那样,coding阶段也生成一份R2文件(有别于编译阶段的R2), 这样既可以提示开发者,又能把爆红信息取掉。

butter's People

Contributors

daddyno1 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.