android
尼格拉斯的帽子戏法
这个作者很懒,什么都没留下…
展开
-
android View的三个构造方法 简单总结
在android开发中,我们经常会涉及到自定义View,View有3个构造方法(可能以后会更多),如下: public CircleView(Context context) { this(context,null); } public CircleView(Context context, AttributeSet attrs) { this(context,attrs,R.attr.c原创 2016-09-15 18:04:01 · 3355 阅读 · 0 评论 -
Dagger2的使用以及源码分析
一,简介 Dagger2是Dagger1的分支,由谷歌公司接手开发的,Dagger2中没有再使用反射机制,而是使用派遣方法,自动生成如同自己手写的代码,好处是:第一,谷歌声称提高了13%的效率;第二,代码的调试变得更简单,缺点是缺乏灵活性。 二,接入 在app的gradle文件中添加插件 apply plugin: 'com.neenbedankt.android-apt'原创 2017-04-13 10:20:27 · 1511 阅读 · 0 评论 -
Android LayoutInflater 源码分析及个人总结
我们经常用到的布局解析器LayoutInflater,主要在ListView或者RecycleView的Adapter中,用两个常用方法 第一个方法是 LayoutInflater.from(context).inflate(resource, root); 第二个方法是LayoutInflater.from(context).inflate(resource, root, attachToR原创 2017-04-19 14:26:44 · 346 阅读 · 0 评论