我是一名热爱 Android 技术的程序员,平时爱造轮子,人送外号轮子哥 。
我的理想是让这个世界没有难开发的安卓项目,消灭一切难维护的代码。
Android 代码规范文档
License: Apache License 2.0
Resource IDs will be non-final in Android Gradle Plugin version 5.0, avoid using them in switch case statements
对于资源id还是避免用switch case 好
1、layout_marginStart、layout_marginHorizontal在style中书写时存在使用局限。
2、关于全局变量命名不提倡使用mInstrument这种形式,模型使用如果同时出现set、get方法时,使用public更便捷。理由参考《代码整洁之道》。
3、资源ID命名上不建议带上模块名称(layout除外)。存在重复使用的string,带有模块名称并不合适。建议使用资源的属性功能去命名,这样虽然可能损失了某种程度上的美观,但是总体来说,提升代码开发效率,不必花时间去翻找重复的资源。
4、部分规范不必完全遵守,应根据实际出发。
当然:还是如作者所讲应当首推start和end属性
如果跳转的 Activity 需要传递参数,应该在目标的 Activity 中定义静态的 start 又或者 newIntent 方法。
在Activity中定义静态方法,会不会引起内存泄漏,因为静态方法的生命周期和APP一样长,导致Activity无法被回收。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.