Udacity Code Review Suggestions
来源:互联网 发布:淘宝分享链接打不开 编辑:程序博客网 时间:2024/04/30 13:13
昨天提交了Udacity Android Developer Nanodegree Program的第一次作业,今天给了答复,还有些批注。其实就是一个针对我个人代码风格的及其具有针对性的专业化建议,实在是个好东西,这里必须记下来。
Similar to how it is a good practice to keep your labels and prompts inside of the Strings.xml file, it is also a good practice to keep your colors inside of the colors.xml file.
Nice choice for the identifiers names. Good selection of identifiers makes a huge difference when your application gets more complicated.
<Button android:id="@+id/spotify_btn" ............>
Your buttons share a lot of common attributes. It may be a good idea to create a Style and place all of the common attributes inside of that style. Doing so you will achieve two things:
- If you decide to change the style of your buttons one day you will be able to make the change across the whole application by making a change in the single place
- Your layouts will become a lot shorter, because you will be able to remove repetitive lines of code.
(style相当于把多个view的相同属性提取出来,而且更方便的是,个别view有例外的属性时可以像之前一样定义,不受影响。)
0 0
- Udacity Code Review Suggestions
- code review
- Code review
- Code Review
- Code Review
- Code Review
- Code Review
- code review
- Code Review
- code review
- code-review
- code review
- code Review
- Code Review
- code review
- code review
- Code Review
- code review
- 博主写博客的初衷
- BFS — 北京林业大学“计蒜客”杯程序设计竞赛 网络赛 —— 大钉骑马走江湖
- 电压控制型开关电源的基本电路
- Servlet的生命周期
- Runtime Error R6016问题
- Udacity Code Review Suggestions
- 三种默认路由的区别ip default-gateway、ip default-network、ip route 0.0.0.0 0.0.0.0
- 设计模式-观察者模式
- Java “==”与“equals"的区别
- 加锁
- 白话空间统计二十一:密度分析(三)
- php数组操作方法
- android源代码编译
- 方便的自动Spring注解注入