11 2017 档案

摘要:如下分析针对的API 25的AsyncTask的源码: 使用AsyncTask如果是调用execute方法则是同步执行任务,想要异步执行任务可以直接调用executeOnExecutor方法,多数情况下我们会使用AsyncTask内部静态的线程池, THREAD_POOL_EXECUTOR,这里并不 阅读全文
posted @ 2017-11-10 16:42 sphere 阅读(1376) 评论(0) 推荐(1)
摘要:内部使用了OKIO库, 此库中Source表示输入流(相当于InputStream),Sink表示输出流(相当于OutputStream) 特点: ·既支持同步请求,也支持异步请求,同步请求会阻塞当前线程,异步请求不阻塞当前线程,异步执行完成后回掉相应的方法 ·支持HTTP/2协议,通过HTTP/2 阅读全文
posted @ 2017-11-09 17:06 sphere 阅读(1002) 评论(0) 推荐(0)
摘要:如下是官方文档描述此库的特点: All requests are made outside of your app’s main UI thread, but any callback logic will be executed on the same thread as the callback 阅读全文
posted @ 2017-11-08 16:31 sphere 阅读(2391) 评论(0) 推荐(1)
摘要:https://github.com/nispok/snackbar 默认Snackbar支持底部或者顶部显示,不支持居中显示 查看Snackbar.java的源码可以看到createMarginLayoutParams方法中有位置的处理SnackbarPosition , 针对不同的显示位置设置对 阅读全文
posted @ 2017-11-01 12:35 sphere 阅读(3545) 评论(0) 推荐(0)