- Notifications
You must be signed in to change notification settings - Fork291
⏳ Listen the progress of downloading and uploading in Okhttp, compatible Retrofit and Glide (一行代码即可监听 App 中所有网络链接的上传以及下载进度, 包括 Glide 的图片加载进度).
License
JessYanCoding/ProgressManager
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ProgressManager a line of code to listenApp all the links and upload the progress of the network, includingGlide picture loading progress, to achieve the principle of similarEventBus, you can be in anywhere inApp, the number of listeners toUrl address as an identifier, registered to the framework, when thisUrl address haves to download or upload the action, the framework will take the initiative to call All listeners registered with thisUrl address are synchronized to multiple modules.
- Easy to use, just a line of code to listen progress.
- Multi-platform support, supportOkhttp ,Retrofit ,Glide ,UseOkhttp nativeApi , there is no compatibility problem.
- Low coupling, the actual request and the progress of the receiver does not exist directly or indirectly, that can be anywhere inApp to receive progress information.
- Low intrusion, use this framework you do not need to change the code before uploading or downloading, ie using or not using this framework does not affect the original code.
- Multi-end synchronization, the same data source upload or download progress can specify a number of different receivers, less to useEventBus achieve multiple port synchronization update progress.
- Support multi-file upload.
- SupportURL redirection.
- Automatic management of the listener, less to manually cancel the trouble of the listener.
- The default run in the main line layer, less to switch the thread of trouble.
- Lightweight framework, does not contain any three-party library, very small size.
implementation'me.jessyan:progressmanager:1.5.0'
// When building OkHttpClient, the OkHttpClient.Builder() is passed to the with() method to initialize the configurationOkHttpClient =ProgressManager.getInstance().with(newOkHttpClient.Builder()) .build();
// Glide loadProgressManager.getInstance().addResponseListener(IMAGE_URL,getGlideListener());// Okhttp/Retofit downloadProgressManager.getInstance().addResponseListener(DOWNLOAD_URL,getDownloadListener());// Okhttp/Retofit uploadProgressManager.getInstance().addRequestListener(UPLOAD_URL,getUploadListener());
-keep class me.jessyan.progressmanager.** { *; } -keep interface me.jessyan.progressmanager.** { *; }
- Email:jess.yan.effort@gmail.com
- Home:http://jessyan.me
- 掘金:https://juejin.im/user/57a9dbd9165abd0061714613
- 简书:https://www.jianshu.com/u/1d0c0bc634db
Copyright 2017, jessyan Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
About
⏳ Listen the progress of downloading and uploading in Okhttp, compatible Retrofit and Glide (一行代码即可监听 App 中所有网络链接的上传以及下载进度, 包括 Glide 的图片加载进度).
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Contributors2
Uh oh!
There was an error while loading.Please reload this page.