Android orm, bitmap, http, view inject...
xUtils 包含了orm, http(s), image, view注解, 但依然很轻量级(251K), 并且特性强大, 方便扩展.
orm: 高效稳定的orm工具, 使得http接口实现时更方便的支持cookie和缓存.http(s): 基于UrlConnection, Android4.4以后底层为okHttp实现.image: 有了http(s)及其下载缓存的支持, image模块的实现相当的简洁.view注解: view注解模块仅仅400多行代码却灵活的支持了各种View注入和事件绑定.implementation 'org.xutils:xutils:3.9.0'
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
// 在application的onCreate中初始化
@Override
public void onCreate() {
super.onCreate();
x.Ext.init(this);
x.Ext.setDebug(BuildConfig.DEBUG); // 是否输出debug日志, 开启debug会影响性能.
...
}
/**
* 1. 方法必须私有限定,
* 2. 方法参数形式必须和type对应的Listener接口一致.
* 3. 注解参数value支持数组: value={id1, id2, id3}
* 4. 其它参数说明见{@link org.xutils.event.annotation.Event}类的说明.
**/
@Event(value = R.id.btn_test1,
type = View.OnClickListener.class/*可选参数, 默认是View.OnClickListener.class*/)
private void onTest1Click(View view) {
...
}
…
…
`
…
…
…
No open issues yet, or sync has not completed.