Android底层类库集合Bolts.zip

时间:2022-08-05 23:51:40
【文件属性】:
文件名称:Android底层类库集合Bolts.zip
文件大小:147KB
文件格式:ZIP
更新时间:2022-08-05 23:51:40
开源项目 Bolts 是一款底层类库集合, 在后台实现异步操作, 并提供接口反馈当前异步执行的程度 (可以通过接口实现UI进度更新), 最后反馈执行的结果给UI主线程, 与AsyncTask比较: (1)使用的是无大小限制的线程池; (2)任务可组合可级联,防止了代码耦合。使用dependencies {   compile 'com.parse.bolts:bolts-tasks:1.4.0'   compile 'com.parse.bolts:bolts-applinks:1.4.0'}示例代码/**  Gets a String asynchronously.  */ public Task getStringAsync() {   // Let's suppose getIntAsync() returns a Task.   return getIntAsync().continueWith(     // This Continuation is a function which takes an Integer as input,     // and provides a String as output. It must take an Integer because     // that's what was returned from the previous Task.     new Continuation() {       // The Task getIntAsync() returned is passed to "then" for convenience.       public String then(Task task) throws Exception {         Integer number = task.getResult();         return String.format("%d", Locale.US, number);       }     }   ); } 标签:Bolts
【文件预览】:
Bolts-Android-master
----.gitignore(120B)
----gradle()
--------wrapper()
----README.md(27KB)
----build.gradle(1KB)
----gradlew.bat(2KB)
----bolts-applinks()
--------build.gradle(4KB)
--------src()
----gradlew(5KB)
----LICENSE(1KB)
----CONTRIBUTING.md(1KB)
----bolts-android()
--------build.gradle(4KB)
--------src()
----CODE_OF_CONDUCT.md(244B)
----gradle.properties(225B)
----scripts()
--------publish_snapshot.sh(766B)
----.travis.yml(797B)
----bolts-tasks()
--------build.gradle(3KB)
--------src()
----settings.gradle(259B)

网友评论