Advertising

ProgressManager

Listen the progress of downloading and uploading in Okhttp (compatible Retrofit and Glide).

Overview

Introduction

ProgressManager a line of code to listen App all the links and upload the progress of the network, including Glide picture loading progress, to achieve the principle of similar EventBus, you can be in anywhere in App, the number of listeners to Url address as an identifier, registered to the framework, when this Url address haves to download or upload the action, the framework will take the initiative to call All listeners registered with this Url address are synchronized to multiple modules.

Feature

Low coupling, the actual request and the progress of the receiver does not exist directly or indirectly, that can be anywhere in App 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 use EventBus achieve multiple port synchronization update progress.

Support multi-file upload.

Support URL 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.

Download

implementation 'me.jessyan:progressmanager:1.5.0'

Usage

Step 1

// When building OkHttpClient, the OkHttpClient.Builder() is passed to the with() method to initialize the configurationOkHttpClient=ProgressManager.getInstance().with(newOkHttpClient.Builder())
.build();

About Me

License

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.