Full Code of jeasonlzy/okhttp-OkGo for AI

master e34c2fa150db cached
276 files
889.0 KB
217.3k tokens
1654 symbols
1 requests
Download .txt
Showing preview only (969K chars total). Download the full file or copy to clipboard to get everything.
Repository: jeasonlzy/okhttp-OkGo
Branch: master
Commit: e34c2fa150db
Files: 276
Total size: 889.0 KB

Directory structure:
gitextract_01imco5q/

├── .gitignore
├── LICENSE
├── README.md
├── appkey.jks
├── build.gradle
├── demo/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── srca.cer
│           ├── java/
│           │   └── com/
│           │       └── lzy/
│           │           └── demo/
│           │               ├── GApp.java
│           │               ├── MainActivity.java
│           │               ├── PayFragment.java
│           │               ├── WebActivity.java
│           │               ├── base/
│           │               │   ├── BaseActivity.java
│           │               │   ├── BaseDetailActivity.java
│           │               │   ├── BaseFragment.java
│           │               │   ├── BaseRecyclerAdapter.java
│           │               │   ├── BaseRxDetailActivity.java
│           │               │   ├── DividerItemDecoration.java
│           │               │   └── MainFragment.java
│           │               ├── callback/
│           │               │   ├── BitmapDialogCallback.java
│           │               │   ├── DialogCallback.java
│           │               │   ├── EncryptCallback.java
│           │               │   ├── JsonCallback.java
│           │               │   ├── JsonConvert.java
│           │               │   └── StringDialogCallback.java
│           │               ├── model/
│           │               │   ├── ApkModel.java
│           │               │   ├── GankModel.java
│           │               │   ├── GankResponse.java
│           │               │   ├── ItemModel.java
│           │               │   ├── LzyResponse.java
│           │               │   ├── ServerModel.java
│           │               │   └── SimpleResponse.java
│           │               ├── okdownload/
│           │               │   ├── DesActivity.java
│           │               │   ├── DownloadAdapter.java
│           │               │   ├── DownloadAllActivity.java
│           │               │   ├── DownloadFinishActivity.java
│           │               │   ├── DownloadListActivity.java
│           │               │   ├── DownloadingActivity.java
│           │               │   ├── LogDownloadListener.java
│           │               │   └── OkDownloadFragment.java
│           │               ├── okgo/
│           │               │   ├── BitmapRequestActivity.java
│           │               │   ├── CacheActivity.java
│           │               │   ├── CommonActivity.java
│           │               │   ├── CookieActivity.java
│           │               │   ├── FormUploadActivity.java
│           │               │   ├── HttpsActivity.java
│           │               │   ├── JsonActivity.java
│           │               │   ├── MethodActivity.java
│           │               │   ├── OkGoFragment.java
│           │               │   ├── RedirectActivity.java
│           │               │   ├── SimpleDownloadActivity.java
│           │               │   ├── SyncActivity.java
│           │               │   ├── TestActivity.java
│           │               │   └── UpActivity.java
│           │               ├── okrx2/
│           │               │   ├── OkRx2Fragment.java
│           │               │   ├── OkRxFragment.java
│           │               │   ├── RxBitmapActivity.java
│           │               │   ├── RxCacheActivity.java
│           │               │   ├── RxCommonActivity.java
│           │               │   ├── RxFileDownloadActivity.java
│           │               │   ├── RxFormUploadActivity.java
│           │               │   ├── RxRetrofitActivity.java
│           │               │   ├── RxUtils.java
│           │               │   └── ServerApi.java
│           │               ├── okupload/
│           │               │   ├── LogUploadListener.java
│           │               │   ├── OkUploadFragment.java
│           │               │   ├── UploadAdapter.java
│           │               │   ├── UploadAllActivity.java
│           │               │   ├── UploadFinishActivity.java
│           │               │   ├── UploadListActivity.java
│           │               │   └── UploadingActivity.java
│           │               ├── supercache/
│           │               │   ├── NewsAdapter.java
│           │               │   ├── NewsCallback.java
│           │               │   ├── NewsTabFragment.java
│           │               │   └── SuperCacheActivity.java
│           │               ├── ui/
│           │               │   ├── NumberProgressBar.java
│           │               │   ├── ProgressPieView.java
│           │               │   ├── SimpleViewBehavior.java
│           │               │   └── TranslateUpDownBehavior.java
│           │               └── utils/
│           │                   ├── AnimHelper.java
│           │                   ├── ApkUtils.java
│           │                   ├── ColorUtils.java
│           │                   ├── Convert.java
│           │                   ├── GlideImageLoader.java
│           │                   ├── MD5Utils.java
│           │                   ├── PicassoImageLoader.java
│           │                   └── Urls.java
│           └── res/
│               ├── drawable/
│               │   └── progress_bar_states.xml
│               ├── layout/
│               │   ├── activity_base.xml
│               │   ├── activity_bitmap_request.xml
│               │   ├── activity_cache.xml
│               │   ├── activity_cookie.xml
│               │   ├── activity_custom_request.xml
│               │   ├── activity_download_all.xml
│               │   ├── activity_download_details.xml
│               │   ├── activity_download_list.xml
│               │   ├── activity_file_download.xml
│               │   ├── activity_form_upload.xml
│               │   ├── activity_https.xml
│               │   ├── activity_main.xml
│               │   ├── activity_method.xml
│               │   ├── activity_recycler.xml
│               │   ├── activity_redirect.xml
│               │   ├── activity_rx_cache.xml
│               │   ├── activity_rx_common.xml
│               │   ├── activity_rx_file_download.xml
│               │   ├── activity_rx_form_upload.xml
│               │   ├── activity_rx_retrofit.xml
│               │   ├── activity_super_cache.xml
│               │   ├── activity_sync.xml
│               │   ├── activity_test.xml
│               │   ├── activity_up_text.xml
│               │   ├── activity_upload_list.xml
│               │   ├── activity_web.xml
│               │   ├── fragment_pay.xml
│               │   ├── include_data.xml
│               │   ├── item_download_list.xml
│               │   ├── item_download_manager.xml
│               │   ├── item_main_list.xml
│               │   ├── item_main_type.xml
│               │   ├── item_news.xml
│               │   ├── item_no_data.xml
│               │   ├── item_refresh.xml
│               │   └── item_upload_manager.xml
│               └── values/
│                   ├── attrs.xml
│                   ├── colors.xml
│                   ├── dimens.xml
│                   ├── strings.xml
│                   └── styles.xml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── jar/
│   ├── okgo-3.0.4.jar
│   ├── okhttp-3.8.1.jar
│   ├── okio-1.13.0.jar
│   ├── okrx-1.0.2.jar
│   ├── okrx2-2.0.2.jar
│   └── okserver-2.0.5.jar
├── okgo/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okgo/
│                           ├── OkGo.java
│                           ├── adapter/
│                           │   ├── AdapterParam.java
│                           │   ├── CacheCall.java
│                           │   ├── Call.java
│                           │   ├── CallAdapter.java
│                           │   └── DefaultCallAdapter.java
│                           ├── cache/
│                           │   ├── CacheEntity.java
│                           │   ├── CacheMode.java
│                           │   └── policy/
│                           │       ├── BaseCachePolicy.java
│                           │       ├── CachePolicy.java
│                           │       ├── DefaultCachePolicy.java
│                           │       ├── FirstCacheRequestPolicy.java
│                           │       ├── NoCachePolicy.java
│                           │       ├── NoneCacheRequestPolicy.java
│                           │       └── RequestFailedCachePolicy.java
│                           ├── callback/
│                           │   ├── AbsCallback.java
│                           │   ├── BitmapCallback.java
│                           │   ├── Callback.java
│                           │   ├── FileCallback.java
│                           │   └── StringCallback.java
│                           ├── convert/
│                           │   ├── BitmapConvert.java
│                           │   ├── Converter.java
│                           │   ├── FileConvert.java
│                           │   └── StringConvert.java
│                           ├── cookie/
│                           │   ├── CookieJarImpl.java
│                           │   ├── SerializableCookie.java
│                           │   └── store/
│                           │       ├── CookieStore.java
│                           │       ├── DBCookieStore.java
│                           │       ├── MemoryCookieStore.java
│                           │       └── SPCookieStore.java
│                           ├── db/
│                           │   ├── BaseDao.java
│                           │   ├── CacheManager.java
│                           │   ├── ColumnEntity.java
│                           │   ├── CookieManager.java
│                           │   ├── DBHelper.java
│                           │   ├── DBUtils.java
│                           │   ├── DownloadManager.java
│                           │   ├── TableEntity.java
│                           │   └── UploadManager.java
│                           ├── exception/
│                           │   ├── CacheException.java
│                           │   ├── HttpException.java
│                           │   ├── OkGoException.java
│                           │   └── StorageException.java
│                           ├── https/
│                           │   └── HttpsUtils.java
│                           ├── interceptor/
│                           │   └── HttpLoggingInterceptor.java
│                           ├── model/
│                           │   ├── HttpHeaders.java
│                           │   ├── HttpMethod.java
│                           │   ├── HttpParams.java
│                           │   ├── Priority.java
│                           │   ├── Progress.java
│                           │   ├── Response.java
│                           │   └── Result.java
│                           ├── request/
│                           │   ├── DeleteRequest.java
│                           │   ├── GetRequest.java
│                           │   ├── HeadRequest.java
│                           │   ├── OptionsRequest.java
│                           │   ├── PatchRequest.java
│                           │   ├── PostRequest.java
│                           │   ├── PutRequest.java
│                           │   ├── TraceRequest.java
│                           │   └── base/
│                           │       ├── BodyRequest.java
│                           │       ├── HasBody.java
│                           │       ├── NoBodyRequest.java
│                           │       ├── ProgressRequestBody.java
│                           │       └── Request.java
│                           └── utils/
│                               ├── HeaderParser.java
│                               ├── HttpUtils.java
│                               ├── IOUtils.java
│                               └── OkLogger.java
├── okrx/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okrx/
│                           ├── adapter/
│                           │   ├── AnalysisParams.java
│                           │   ├── CompletableResponse.java
│                           │   ├── ObservableBody.java
│                           │   ├── ObservableResponse.java
│                           │   ├── ObservableResult.java
│                           │   ├── SingleBody.java
│                           │   ├── SingleResponse.java
│                           │   └── SingleResult.java
│                           └── subscribe/
│                               ├── BodyOnSubscribe.java
│                               ├── CallArbiter.java
│                               ├── CallEnqueueOnSubscribe.java
│                               ├── CallExecuteOnSubscribe.java
│                               └── ResultOnSubscribe.java
├── okrx2/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okrx2/
│                           ├── adapter/
│                           │   ├── AnalysisParams.java
│                           │   ├── CompletableResponse.java
│                           │   ├── FlowableBody.java
│                           │   ├── FlowableResponse.java
│                           │   ├── FlowableResult.java
│                           │   ├── MaybeBody.java
│                           │   ├── MaybeResponse.java
│                           │   ├── MaybeResult.java
│                           │   ├── ObservableBody.java
│                           │   ├── ObservableResponse.java
│                           │   ├── ObservableResult.java
│                           │   ├── SingleBody.java
│                           │   ├── SingleResponse.java
│                           │   └── SingleResult.java
│                           └── observable/
│                               ├── BodyObservable.java
│                               ├── CallEnqueueObservable.java
│                               ├── CallExecuteObservable.java
│                               └── ResultObservable.java
├── okserver/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okserver/
│                           ├── OkDownload.java
│                           ├── OkUpload.java
│                           ├── ProgressListener.java
│                           ├── download/
│                           │   ├── DownloadListener.java
│                           │   ├── DownloadTask.java
│                           │   └── DownloadThreadPool.java
│                           ├── task/
│                           │   ├── PriorityBlockingQueue.java
│                           │   ├── PriorityObject.java
│                           │   ├── PriorityRunnable.java
│                           │   └── XExecutor.java
│                           └── upload/
│                               ├── UploadListener.java
│                               ├── UploadTask.java
│                               └── UploadThreadPool.java
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.iml
.gradle
/.idea
/screenshots
/local.properties
.DS_Store
/build
/captures
libs/


================================================
FILE: LICENSE
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "{}"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright 2016 jeasonlzy(廖子尧)

   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.



================================================
FILE: README.md
================================================
![](http://7xss53.com1.z0.glb.clouddn.com/markdown/aqyyw.jpg)

## OkGo - 3.0 震撼来袭, 一个基于okhttp的标准RESTful风格的网络框架

> 工程结构全新优化  
支持RxJava  
支持RxJava2  
支持自定义缓存策略  
支持下载管理  
支持上传管理  

该库部分思想借鉴了以下项目:

 * [https://github.com/yanzhenjie/NoHttp](https://github.com/Y0LANDA/NoHttp) 
 * [https://github.com/square/retrofit](https://github.com/square/retrofit)

在此特别感谢上述作者,喜欢原作的可以去使用原项目。同时欢迎大家下载体验本项目,如果使用过程中遇到什么问题,欢迎反馈。

## 友情链接
本项目中使用的图片选择是我的另一个开源项目
> 完全仿微信的图片选择库,自带矩形图片裁剪和圆形图片裁剪功能,有需要的可以去下载使用。  
附上地址:[https://github.com/jeasonlzy/ImagePicker](https://github.com/jeasonlzy/ImagePicker)

本项目中的九宫格控件也是我的开源项目
> 类似QQ空间,微信朋友圈,微博主页等,展示图片的九宫格控件,自动根据图片的数量确定图片大小和控件大小,使用Adapter模式设置图片,对外提供接口回调,使用接口加载图片,支持任意的图片加载框架如:Glide、ImageLoader、xUtils3、Picasso 等,支持点击图片全屏预览大图。  
附上地址:[https://github.com/jeasonlzy/NineGridView](https://github.com/jeasonlzy/NineGridView)

## 联系方式
 * email: liaojeason@126.com
 * QQ群: 489873144 <a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=ba5dbb5115a165866ec77d96cb46685d1ad159ab765b796699d6763011ffe151"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Android 格调小窝" title="Android 格调小窝"></a>(点击图标,可以直接加入,建议使用QQ群,邮箱使用较少,可能看的不及时)
 * 如果遇到问题欢迎在群里提问,个人能力也有限,希望一起学习一起进步。

## 演示
![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo13.gif)![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo8.gif)![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo11.gif)![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo9.gif)![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo10.gif)![image](https://github.com/jeasonlzy/Screenshots/blob/master/okgo/demo12.gif)

## 未来版本
### [v3.1.x]版本
- 计划分离params参数的具体作用,分为paramsPath,paramsQuery和params,支持url路径动态替换
- 计划支持请求优先级,方便有些重要请求优先进行
- 计划支持自定义线程池,使用自己的线程池管理网络请求

### [v3.2.x]版本
- 计划增加扩展库OkAnno,作用是让okgo支持注解方式请求,具体写法与Retrofit相似,但是更简单方便,也更强大,方便Retrofit用户平滑过渡到OkGo

### 其他功能暂时还没想出来,大家有想法的可以积极加群讨论,或者直接在issue里面提出你的想法,我会第一时间回复。

## 使用

[![](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14) [![](https://img.shields.io/badge/platform-android-brightgreen.svg)](https://developer.android.com/index.html) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5b244560c35c445cbb00b9500b0c5d2a)](https://www.codacy.com/app/jeasonlzy/okhttp-OkGo?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jeasonlzy/okhttp-OkGo&amp;utm_campaign=Badge_Grade)  [![](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/jeasonlzy/okhttp-OkGo/blob/master/LICENSE)  [![](https://img.shields.io/badge/%E4%BD%9C%E8%80%85-jeasonlzy-orange.svg)](https://github.com/jeasonlzy)

[![](https://img.shields.io/badge/OkGo-v3.0.4-brightgreen.svg)](https://github.com/jeasonlzy/okhttp-OkGo) [![](https://img.shields.io/badge/OkRx-v1.0.2-brightgreen.svg)](https://github.com/jeasonlzy/okhttp-OkGo) [![](https://img.shields.io/badge/OkRx2-v2.0.2-brightgreen.svg)](https://github.com/jeasonlzy/okhttp-OkGo) [![](https://img.shields.io/badge/OkServer-v2.0.5-brightgreen.svg)](https://github.com/jeasonlzy/okhttp-OkGo)

Android Studio用户

> 一般来说,只需要添加第一个okgo的核心包即可,其余的三个库根据自己的需要选择添加!!!

```java
//必须使用
compile 'com.lzy.net:okgo:3.0.4'

//以下三个选择添加,okrx和okrx2不能同时使用
compile 'com.lzy.net:okrx:1.0.2'
compile 'com.lzy.net:okrx2:2.0.2'  
compile 'com.lzy.net:okserver:2.0.5'
```

Eclipse的用户(赶紧换AS吧),可以选择添加本项目根目录中 `/jar` 目录下的jar包:

> 一般来说,至少需要okhttp、okio、okgo三个jar包,其余的三个扩展jar包根据自己的需要选择添加!!!

必须使用
> [okhttp-3.8.1.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okhttp-3.8.1.jar)  
[okio-1.13.0.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okio-1.13.0.jar)   
[okgo-3.0.4.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okgo-3.0.4.jar)   

以下三个选择添加,okrx和okrx2不能同时使用
> [okrx-1.0.2.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okrx-1.0.2.jar)  
[okrx2-2.0.2.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okrx2-2.0.2.jar)   
[okserver-2.0.5.jar](https://raw.githubusercontent.com/jeasonlzy/okhttp-OkGo/master/jar/okserver-2.0.5.jar)  

## 文档
### 该项目的文档全部以Wiki的形式展示,wiki文档永远与最新版本的库保持同步,如果你发现文档的说明与你的写法不一样,那么请升级到最新版本,重要的事情说三遍
- [点我,点我,我是3.x文档,Wiki文档首页请猛戳这里](https://github.com/jeasonlzy/okhttp-OkGo/wiki)
- [点我,点我,我是3.x文档,Wiki文档首页请猛戳这里](https://github.com/jeasonlzy/okhttp-OkGo/wiki)
- [点我,点我,我是3.x文档,Wiki文档首页请猛戳这里](https://github.com/jeasonlzy/okhttp-OkGo/wiki)

如果你实在不愿意升级到3.x版本,[这里有2.x版本的文档,点击查看](https://github.com/jeasonlzy/okhttp-OkGo/tree/v2.1.4),注意:老版本库的问题将不在维护,所有bug会在最新版本修复,所以建议跟随最新版本的库。

[![](http://7xss53.com1.z0.glb.clouddn.com/markdown/w0ujl.jpg)](https://github.com/jeasonlzy/okhttp-OkGo/wiki)

如果遇到使用问题,解决办法如下:
1. 看上述文档中是否有相关描述
2. 看别人提的issues是否有你的问题,这里面有很多人的提问,[点击这里看别人的提问](https://github.com/jeasonlzy/okhttp-OkGo/issues?q=is%3Aissue+is%3Aclosed)。
3. 如果你感觉是bug,或者有疑问,也欢迎在issues里面提问,我每天都会认真解答,[点击这里提问](https://github.com/jeasonlzy/okhttp-OkGo/issues)。
4. 还有疑问,加入联系方式中的QQ群,大家一起讨论。

如果你不想编译项目,提供了apk供直接运行,方便查看效果,点击图标下载:[![](https://img.shields.io/badge/downloads-okgo__v3.0.4.apk-blue.svg)](http://7xss53.com1.z0.glb.clouddn.com/file/okgo_v3.0.4.apk)

本项目Demo使用的是我自己的服务器,有时候可能不稳定,网速比较慢时请耐心等待,尴尬呀。。

如果你想查看历史版本信息,请点击图标:[![](https://img.shields.io/badge/release-tags-ff69b4.svg)](https://github.com/jeasonlzy/okhttp-OkGo/releases)

如果你使用遇到了问题,首先请看控制台log,如果log无法看出问题,无法确定是该库的bug还是服务端的问题,建议抓包查看网络数据,[详细的抓包方法猛戳这里](https://github.com/jeasonlzy/okhttp-OkGo/wiki#网络抓包)

### 如果你觉得好,对你有过帮助,请给我一点打赏鼓励吧,一分也是爱呀!
![](https://ws2.sinaimg.cn/large/006tNbRwly1fgidan2gc9j30jg0a2wg6.jpg)

## 混淆
okgo, okrx, okrx2, okserver 所有代码均可以混淆,但是由于底层使用的是 okhttp,它不能混淆,所以只需要添加以下混淆代码就可以了
```java
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}

#okio
-dontwarn okio.**
-keep class okio.**{*;}
```

当然如果你确实不需要混淆okgo的代码,可以继续添加以下代码
```java
#okgo
-dontwarn com.lzy.okgo.**
-keep class com.lzy.okgo.**{*;}

#okrx
-dontwarn com.lzy.okrx.**
-keep class com.lzy.okrx.**{*;}

#okrx2
-dontwarn com.lzy.okrx2.**
-keep class com.lzy.okrx2.**{*;}

#okserver
-dontwarn com.lzy.okserver.**
-keep class com.lzy.okserver.**{*;}
```

## Licenses
```
 Copyright 2016 jeasonlzy(廖子尧)

 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.
```





================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'

        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    versionCode = 29
    versionName_okgo = '3.0.4'
    versionName_okserver = '2.0.5'
    versionName_okrx = '1.0.2'
    versionName_okrx2 = '2.0.2'

    libMinSdkVersion = 14
    appMinSdkVersion = 16
    targetSdkVersion = 25
    compileSdkVersion = 25
    buildToolsVersion = '25.0.2'
    supportVersion = '25.3.1'
}

================================================
FILE: demo/.gitignore
================================================
/build


================================================
FILE: demo/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        applicationId "com.lzy.demo"
        minSdkVersion rootProject.ext.appMinSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode rootProject.ext.versionCode
        versionName rootProject.ext.versionName_okgo
    }

    signingConfigs {
        appkey {
            keyAlias 'OkGo'
            keyPassword '111111'
            storeFile file('../appkey.jks')
            storePassword '111111'
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable false
            signingConfig signingConfigs.appkey
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable true
            signingConfig signingConfigs.appkey
        }
    }
    productFlavors {
        miui {
            proguardFile './proguard-rules.pro'
            signingConfig signingConfigs.appkey
        }
        qihu360 {
            proguardFile './proguard-rules.pro'
            signingConfig signingConfigs.appkey
        }
    }
    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/notice'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/rxjava.properties'
    }
}

task makeApk {
    doLast {
        def versionName = rootProject.ext.versionName_okgo
        def appName = "okgo_v${versionName}.apk"
        copy {
            from "./build/outputs/apk/demo-miui-debug.apk"
            into "../"
            rename {
                appName
            }
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:$supportVersion"
    compile "com.android.support:design:$supportVersion"
    compile "com.android.support:recyclerview-v7:$supportVersion"
    compile "com.android.support:cardview-v7:$supportVersion"

    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v2.0.7'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
    compile 'com.readystatesoftware.chuck:library:1.0.4'

    compile project(':okgo')
    compile project(':okrx')
    compile project(':okrx2')
    compile project(':okserver')
//    compile 'com.lzy.net:okgo:3.0.4'
//    compile 'com.lzy.net:okrx:1.0.2'
//    compile 'com.lzy.net:okrx2:2.0.2'
//    compile 'com.lzy.net:okserver:2.0.5'
    compile 'com.lzy.widget:ninegridview:0.2.1'
    compile 'com.lzy.widget:imagepicker:0.3.2'
    compile 'com.lzy.widget:view-core:0.2.1'
}

================================================
FILE: demo/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in E:\Android\SDK/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

#---------------------------------1.实体类---------------------------------

-keep class com.lzy.okhttpdemo.Bean.** { *; }

#-------------------------------------------------------------------------

#---------------------------------2.第三方包-------------------------------
#okgo
#-dontwarn com.lzy.okgo.**
#-keep class com.lzy.okgo.**{*;}

#okrx
#-dontwarn com.lzy.okrx.**
#-keep class com.lzy.okrx.**{*;}

#okserver
#-dontwarn com.lzy.okserver.**
#-keep class com.lzy.okserver.**{*;}

#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}

-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.squareup.picasso.**
-keepclasseswithmembernames class * {
    native <methods>;
}

#okio
-dontwarn okio.**
-keep class okio.**{*;}

#rxjava
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
 long producerIndex;
 long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
 rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
 rx.internal.util.atomic.LinkedQueueNode consumerNode;
}

#imagepicker
-dontwarn com.lzy.imagepicker.**
-keep class com.lzy.imagepicker.**{*;}

#imagepicker
-dontwarn com.lzy.widget.**
-keep class com.lzy.widget.**{*;}

#butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }

-keepclasseswithmembernames class * {
    @butterknife.* <fields>;
}

-keepclasseswithmembernames class * {
    @butterknife.* <methods>;
}

#gson
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.**{ *; }
-keep class com.google.gson.examples.android.model.**{ *; }
-keep class com.google.gson.**{ *;}

#eventBus
-keepattributes *Annotation*
-keepclassmembers class ** {
    @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
    <init>(java.lang.Throwable);
}
-keepclassmembers class ** {
    public void onEvent*(**);
}

#glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

#log4j
#-libraryjars log4j-1.2.17.jar
-dontwarn org.apache.log4j.**
-keep class  org.apache.log4j.** { *;}

#------------------------------------------------------------------------

#---------------------------------3.与js互相调用的类------------------------

#-keepclasseswithmembers class com.demo.login.bean.ui.MainActivity$JSInterface {
#      <methods>;
#}

#------------------------------------------------------------------------

#---------------------------------4.反射相关的类和方法-----------------------


#------------------------------------------------------------------------

#---------------------------------基本指令区-------------------------------
#代码混淆的压缩比例,值在0-7之间
-optimizationpasses 5
#混淆后类名都为小写
-dontusemixedcaseclassnames
#指定不去忽略非公共的库的类
-dontskipnonpubliclibraryclasses
#指定不去忽略非公共的库的类的成员
-dontskipnonpubliclibraryclassmembers
#不做预校验的操作
-dontpreverify
#生成原类名和混淆后的类名的映射文件
-verbose
-printmapping proguardMapping.txt
#指定混淆是采用的算法
-optimizations !code/simplification/cast,!field/*,!class/merging/*
#不混淆Annotation
-keepattributes *Annotation*,InnerClasses
#不混淆泛型
-keepattributes Signature
#抛出异常时保留代码行号
-keepattributes SourceFile,LineNumberTable
#------------------------------------------------------------------------

#-keep class XXXX   保留类名不变,也就是类名不混淆,而类中的成员名不保证。当然也可以是继承XXX类的所有类名不混淆
#-keepclasseswithmembers class XXXX 保留类名和成员名,当然也可以是类中特定方法

#---------------------------------默认保留区-------------------------------
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.support.**
-keep public class * extends android.app.Fragment
-dontwarn android.support.**
-keep class android.support.** {*;}

#自定义控件不要混淆
-keep public class * extends android.view.View {*;}
#adapter不能混淆
-keep public class * extends android.widget.BaseAdapter {*;}
#CusorAdapter不混淆
-keep public class * extends android.widget.CusorAdapter{*;}

-keepclasseswithmembernames class * {
    native <methods>;
}
-keepclassmembers class * extends android.app.Activity{
    public void *(android.view.View);
}
-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep public class * extends android.view.View{
    *** get*();
    void set*(***);
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}
-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {*;}

-keep class **.R$* {*;}
-keepclassmembers class * {
    void *(**On*Event);
}
#----------------------------------------------------------------------------

#---------------------------------webview------------------------------------
-keepclassmembers class fqcn.of.javascript.interface.for.Webview {
   public *;
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
    public boolean *(android.webkit.WebView, java.lang.String);
}
-keepclassmembers class * extends android.webkit.WebViewClient {
    public void *(android.webkit.WebView, jav.lang.String);
}
#----------------------------------------------------------------------------

================================================
FILE: demo/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2016 jeasonlzy(廖子尧)
    
    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.
-->
<manifest package="com.lzy.demo"
          xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>

    <application
        android:name=".GApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".okgo.MethodActivity"/>
        <activity android:name=".okgo.JsonActivity"/>
        <activity android:name=".okgo.BitmapRequestActivity"/>
        <activity android:name=".okgo.UpActivity"/>
        <activity android:name=".okgo.CookieActivity"/>
        <activity android:name=".okgo.FormUploadActivity"/>
        <activity android:name=".okgo.SimpleDownloadActivity"/>
        <activity android:name=".okgo.CacheActivity"/>
        <activity android:name=".okgo.HttpsActivity"/>
        <activity android:name=".okgo.SyncActivity"/>
        <activity android:name=".okgo.RedirectActivity"/>
        <activity android:name=".okgo.TestActivity"/>
        <activity
            android:name=".supercache.SuperCacheActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".WebActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okgo.CommonActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okdownload.DownloadAllActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okdownload.DownloadingActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okdownload.DownloadFinishActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okdownload.DesActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okdownload.DownloadListActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okupload.UploadListActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okupload.UploadAllActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okupload.UploadFinishActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <activity
            android:name=".okupload.UploadingActivity"
            android:theme="@style/AppTheme.NoActionBar"/>
        <!-- Rx相关 -->
        <activity android:name=".okrx2.RxCommonActivity"/>
        <activity android:name=".okrx2.RxCacheActivity"/>
        <activity android:name=".okrx2.RxRetrofitActivity"/>
        <activity android:name=".okrx2.RxBitmapActivity"/>
        <activity android:name=".okrx2.RxFileDownloadActivity"/>
        <activity android:name=".okrx2.RxFormUploadActivity"/>
    </application>

</manifest>


================================================
FILE: demo/src/main/java/com/lzy/demo/GApp.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo;

import android.app.Application;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.cookie.CookieJarImpl;
import com.lzy.okgo.cookie.store.DBCookieStore;
import com.lzy.okgo.https.HttpsUtils;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.HttpParams;

import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;
import javax.net.ssl.X509TrustManager;

import okhttp3.OkHttpClient;

/**
 * ================================================
 * 作    者:廖子尧   github 地址  https://github.com/jeasonlzy/
 * 版    本:1.0
 * 创建日期:2015/9/23
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class GApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

//        System.setProperty("http.proxyHost", "192.168.1.104");   //个人测试网络时用的,删掉即可
//        System.setProperty("http.proxyPort", "8888");

        initOkGo();
    }

    private void initOkGo() {
        //---------这里给出的是示例代码,告诉你可以这么传,实际使用的时候,根据需要传,不需要就不传-------------//
        HttpHeaders headers = new HttpHeaders();
        headers.put("commonHeaderKey1", "commonHeaderValue1");    //header不支持中文,不允许有特殊字符
        headers.put("commonHeaderKey2", "commonHeaderValue2");
        HttpParams params = new HttpParams();
        params.put("commonParamsKey1", "commonParamsValue1");     //param支持中文,直接传,不要自己编码
        params.put("commonParamsKey2", "这里支持中文参数");
        //----------------------------------------------------------------------------------------//

        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        //log相关
        HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("OkGo");
        loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);        //log打印级别,决定了log显示的详细程度
        loggingInterceptor.setColorLevel(Level.INFO);                               //log颜色级别,决定了log在控制台显示的颜色
        builder.addInterceptor(loggingInterceptor);                                 //添加OkGo默认debug日志
        //第三方的开源库,使用通知显示当前请求的log,不过在做文件下载的时候,这个库好像有问题,对文件判断不准确
        //builder.addInterceptor(new ChuckInterceptor(this));

        //超时时间设置,默认60秒
        builder.readTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);      //全局的读取超时时间
        builder.writeTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);     //全局的写入超时时间
        builder.connectTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS);   //全局的连接超时时间

        //自动管理cookie(或者叫session的保持),以下几种任选其一就行
        //builder.cookieJar(new CookieJarImpl(new SPCookieStore(this)));            //使用sp保持cookie,如果cookie不过期,则一直有效
        builder.cookieJar(new CookieJarImpl(new DBCookieStore(this)));              //使用数据库保持cookie,如果cookie不过期,则一直有效
        //builder.cookieJar(new CookieJarImpl(new MemoryCookieStore()));            //使用内存保持cookie,app退出后,cookie消失

        //https相关设置,以下几种方案根据需要自己设置
        //方法一:信任所有证书,不安全有风险
        HttpsUtils.SSLParams sslParams1 = HttpsUtils.getSslSocketFactory();
        //方法二:自定义信任规则,校验服务端证书
        HttpsUtils.SSLParams sslParams2 = HttpsUtils.getSslSocketFactory(new SafeTrustManager());
        //方法三:使用预埋证书,校验服务端证书(自签名证书)
        //HttpsUtils.SSLParams sslParams3 = HttpsUtils.getSslSocketFactory(getAssets().open("srca.cer"));
        //方法四:使用bks证书和密码管理客户端证书(双向认证),使用预埋证书,校验服务端证书(自签名证书)
        //HttpsUtils.SSLParams sslParams4 = HttpsUtils.getSslSocketFactory(getAssets().open("xxx.bks"), "123456", getAssets().open("yyy.cer"));
        builder.sslSocketFactory(sslParams1.sSLSocketFactory, sslParams1.trustManager);
        //配置https的域名匹配规则,详细看demo的初始化介绍,不需要就不要加入,使用不当会导致https握手失败
        builder.hostnameVerifier(new SafeHostnameVerifier());

        // 其他统一的配置
        // 详细说明看GitHub文档:https://github.com/jeasonlzy/
        OkGo.getInstance().init(this)                           //必须调用初始化
                .setOkHttpClient(builder.build())               //建议设置OkHttpClient,不设置会使用默认的
                .setCacheMode(CacheMode.NO_CACHE)               //全局统一缓存模式,默认不使用缓存,可以不传
                .setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE)   //全局统一缓存时间,默认永不过期,可以不传
                .setRetryCount(3)                               //全局统一超时重连次数,默认为三次,那么最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0
                .addCommonHeaders(headers)                      //全局公共头
                .addCommonParams(params);                       //全局公共参数
    }

    /**
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 重要的事情说三遍,以下代码不要直接使用
     */
    private class SafeTrustManager implements X509TrustManager {
        @Override
        public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
            try {
                for (X509Certificate certificate : chain) {
                    certificate.checkValidity(); //检查证书是否过期,签名是否通过等
                }
            } catch (Exception e) {
                throw new CertificateException(e);
            }
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[0];
        }
    }

    /**
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 这里只是我谁便写的认证规则,具体每个业务是否需要验证,以及验证规则是什么,请与服务端或者leader确定
     * 重要的事情说三遍,以下代码不要直接使用
     */
    private class SafeHostnameVerifier implements HostnameVerifier {
        @Override
        public boolean verify(String hostname, SSLSession session) {
            //验证主机名是否匹配
            //return hostname.equals("server.jeasonlzy.com");
            return true;
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/MainActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import android.util.Pair;
import android.view.View;

import com.lzy.demo.base.BaseActivity;
import com.lzy.demo.okdownload.OkDownloadFragment;
import com.lzy.demo.okgo.OkGoFragment;
import com.lzy.demo.okrx2.OkRx2Fragment;
import com.lzy.demo.okrx2.OkRxFragment;
import com.lzy.demo.okupload.OkUploadFragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class MainActivity extends BaseActivity {

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.viewPager) ViewPager viewPager;
    @Bind(R.id.tab) TabLayout tab;

    private List<Pair<String, Fragment>> items;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initToolBar(toolbar, false, "");

        items = new ArrayList<>();
        items.add(new Pair<String, Fragment>("OkGo", new OkGoFragment()));
        items.add(new Pair<String, Fragment>("打赏", new PayFragment()));
        items.add(new Pair<String, Fragment>("OkRx2", new OkRx2Fragment()));
        items.add(new Pair<String, Fragment>("OkRx", new OkRxFragment()));
        items.add(new Pair<String, Fragment>("OkDownload", new OkDownloadFragment()));
        items.add(new Pair<String, Fragment>("OkUpload", new OkUploadFragment()));

        viewPager.setAdapter(new MainAdapter(getSupportFragmentManager()));
        tab.setupWithViewPager(viewPager);
    }

    @OnClick(R.id.fab)
    public void fab(View view) {
        WebActivity.runActivity(this, "我的Github,欢迎star", "https://github.com/jeasonlzy");
    }

    @Override
    protected boolean translucentStatusBar() {
        return true;
    }

    private class MainAdapter extends FragmentPagerAdapter {

        MainAdapter(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            return items.get(position).second;
        }

        @Override
        public int getCount() {
            return items.size();
        }

        @Override
        public CharSequence getPageTitle(int position) {
            return items.get(position).first;
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/PayFragment.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lzy.demo.base.BaseFragment;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/9
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class PayFragment extends BaseFragment {

    @Override
    protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_pay, container, false);
    }

    @Override
    protected void initData() {

    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/WebActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;

import com.lzy.demo.base.BaseActivity;

import butterknife.Bind;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class WebActivity extends BaseActivity {

    public final static String URL = "url";
    public final static String TITLE = "title";

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.pb) ProgressBar pb;
    @Bind(R.id.webView) WebView webView;

    public static void runActivity(Context context, String title, String url) {
        Intent intent = new Intent(context, WebActivity.class);
        intent.putExtra(URL, url);
        intent.putExtra(TITLE, title);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web);
        String url = getIntent().getStringExtra(URL);
        String title = getIntent().getStringExtra(TITLE);
        initToolBar(toolbar, true, title);

        pb.setMax(100);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setSupportZoom(true);
        webView.getSettings().setBuiltInZoomControls(true);
        webView.setWebChromeClient(new WebChromeClient() {
            @Override
            public void onProgressChanged(WebView view, int newProgress) {
                pb.setProgress(newProgress);
                if (newProgress >= 100) {
                    pb.setVisibility(View.GONE);
                }
            }
        });
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });
        webView.loadUrl(url);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/BaseActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.app.ProgressDialog;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.lzy.demo.R;
import com.lzy.imagepicker.view.SystemBarTintManager;

import butterknife.ButterKnife;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class BaseActivity extends AppCompatActivity {

    @SuppressWarnings("unchecked")
    public <T extends View> T findView(int id) {
        return (T) findViewById(id);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initSystemBarTint();
    }

    @Override
    public void setContentView(@LayoutRes int layoutResID) {
        super.setContentView(layoutResID);
        ButterKnife.bind(this);
    }

    @Override
    public void setContentView(View view) {
        super.setContentView(view);
        ButterKnife.bind(this);
    }

    @Override
    public void setContentView(View view, ViewGroup.LayoutParams params) {
        super.setContentView(view, params);
        ButterKnife.bind(this);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:// 点击返回图标事件
                finish();
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    /** 子类可以重写改变状态栏颜色 */
    protected int setStatusBarColor() {
        return getColorPrimary();
    }

    /** 子类可以重写决定是否使用透明状态栏 */
    protected boolean translucentStatusBar() {
        return false;
    }

    /** 设置状态栏颜色 */
    protected void initSystemBarTint() {
        Window window = getWindow();
        if (translucentStatusBar()) {
            // 设置状态栏全透明
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
                window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
                window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
                window.setStatusBarColor(Color.TRANSPARENT);
            } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            }
            return;
        }
        // 沉浸式状态栏
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            //5.0以上使用原生方法
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(setStatusBarColor());
        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            //4.4-5.0使用三方工具类,有些4.4的手机有问题,这里为演示方便,不使用沉浸式
//            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            tintManager.setStatusBarTintEnabled(true);
            tintManager.setStatusBarTintColor(setStatusBarColor());
        }
    }

    /** 获取主题色 */
    public int getColorPrimary() {
        TypedValue typedValue = new TypedValue();
        getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
        return typedValue.data;
    }

    /** 获取深主题色 */
    public int getDarkColorPrimary() {
        TypedValue typedValue = new TypedValue();
        getTheme().resolveAttribute(R.attr.colorPrimaryDark, typedValue, true);
        return typedValue.data;
    }

    /** 初始化 Toolbar */
    public void initToolBar(Toolbar toolbar, boolean homeAsUpEnabled, String title) {
        toolbar.setTitle(title);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(homeAsUpEnabled);
    }

    public void initToolBar(Toolbar toolbar, boolean homeAsUpEnabled, int resTitle) {
        initToolBar(toolbar, homeAsUpEnabled, getString(resTitle));
    }

    public void showToast(String msg) {
        Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
    }

    private ProgressDialog dialog;

    public void showLoading() {
        if (dialog != null && dialog.isShowing()) return;
        dialog = new ProgressDialog(this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setMessage("请求网络中...");
        dialog.show();
    }

    public void dismissLoading() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }

    public void displayImage(String url, ImageView imageView) {
        Glide.with(getApplicationContext())//
                .load(url)//
                .error(R.mipmap.ic_launcher)//
                .into(imageView);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/BaseDetailActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.lzy.demo.R;
import com.lzy.demo.utils.Convert;
import com.lzy.okgo.model.Response;

import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.Set;

import okhttp3.Call;
import okhttp3.Headers;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class BaseDetailActivity extends BaseActivity {

    protected ActionBar actionBar;
    protected TextView requestState;
    protected TextView requestHeaders;
    protected TextView responseData;
    protected TextView responseHeader;
    protected FrameLayout rootContent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayShowTitleEnabled(true);
            actionBar.setDisplayHomeAsUpEnabled(true);
            actionBar.setDisplayShowHomeEnabled(true);
        }
        getDelegate().setContentView(R.layout.activity_base);
        Window window = getWindow();
        requestState = (TextView) window.findViewById(R.id.requestState);
        requestHeaders = (TextView) window.findViewById(R.id.requestHeaders);
        responseData = (TextView) window.findViewById(R.id.responseData);
        responseHeader = (TextView) window.findViewById(R.id.responseHeader);
        rootContent = (FrameLayout) window.findViewById(R.id.content);
        onActivityCreate(savedInstanceState);
    }

    protected abstract void onActivityCreate(Bundle savedInstanceState);

    @Override
    public void setTitle(CharSequence title) {
        if (actionBar != null) actionBar.setTitle(title);
    }

    @Override
    public void setTitle(int titleId) {
        if (actionBar != null) actionBar.setTitle(titleId);
    }

    @Override
    public View findViewById(int id) {
        return rootContent.findViewById(id);
    }

    private void clearContentView() {
        rootContent.removeAllViews();
    }

    @Override
    public void setContentView(int layoutResID) {
        clearContentView();
        getLayoutInflater().inflate(layoutResID, rootContent, true);
    }

    @Override
    public void setContentView(View view) {
        clearContentView();
        rootContent.addView(view);
    }

    @Override
    public void setContentView(View view, ViewGroup.LayoutParams params) {
        clearContentView();
        rootContent.addView(view, params);
    }

    protected <T> void handleResponse(T data) {
        Response<T> response = new Response<>();
        response.setBody(data);
        handleResponse(response);
    }

    protected <T> void handleResponse(Response<T> response) {
        StringBuilder sb;
        Call call = response.getRawCall();
        if (call != null) {
            requestState.setText("请求成功  请求方式:" + call.request().method() + "\n" + "url:" + call.request().url());

            Headers requestHeadersString = call.request().headers();
            Set<String> requestNames = requestHeadersString.names();
            sb = new StringBuilder();
            for (String name : requestNames) {
                sb.append(name).append(" : ").append(requestHeadersString.get(name)).append("\n");
            }
            requestHeaders.setText(sb.toString());
        } else {
            requestState.setText("--");
            requestHeaders.setText("--");
        }
        T body = response.body();
        if (body == null) {
            responseData.setText("--");
        } else {
            if (body instanceof String) {
                responseData.setText((String) body);
            } else if (body instanceof List) {
                sb = new StringBuilder();
                List list = (List) body;
                for (Object obj : list) {
                    sb.append(obj.toString()).append("\n");
                }
                responseData.setText(sb.toString());
            } else if (body instanceof Set) {
                sb = new StringBuilder();
                Set set = (Set) body;
                for (Object obj : set) {
                    sb.append(obj.toString()).append("\n");
                }
                responseData.setText(sb.toString());
            } else if (body instanceof Map) {
                sb = new StringBuilder();
                Map map = (Map) body;
                Set keySet = map.keySet();
                for (Object key : keySet) {
                    sb.append(key.toString()).append(" : ").append(map.get(key)).append("\n");
                }
                responseData.setText(sb.toString());
            } else if (body instanceof File) {
                File file = (File) body;
                responseData.setText("数据内容即为文件内容\n下载文件路径:" + file.getAbsolutePath());
            } else if (body instanceof Bitmap) {
                responseData.setText("图片的内容即为数据");
            } else {
                responseData.setText(Convert.formatJson(body));
            }
        }

        okhttp3.Response rawResponse = response.getRawResponse();
        if (rawResponse != null) {
            Headers responseHeadersString = rawResponse.headers();
            Set<String> names = responseHeadersString.names();
            sb = new StringBuilder();
            sb.append("url : ").append(rawResponse.request().url()).append("\n\n");
            sb.append("stateCode : ").append(rawResponse.code()).append("\n");
            for (String name : names) {
                sb.append(name).append(" : ").append(responseHeadersString.get(name)).append("\n");
            }
            responseHeader.setText(sb.toString());
        } else {
            responseHeader.setText("--");
        }
    }

    protected <T> void handleError() {
        Response<T> response = new Response<>();
        handleResponse(response);
    }

    protected <T> void handleError(Response<T> response) {
        if (response == null) return;
        if (response.getException() != null) response.getException().printStackTrace();
        StringBuilder sb;
        Call call = response.getRawCall();
        if (call != null) {
            requestState.setText("请求失败  请求方式:" + call.request().method() + "\n" + "url:" + call.request().url());

            Headers requestHeadersString = call.request().headers();
            Set<String> requestNames = requestHeadersString.names();
            sb = new StringBuilder();
            for (String name : requestNames) {
                sb.append(name).append(" : ").append(requestHeadersString.get(name)).append("\n");
            }
            requestHeaders.setText(sb.toString());
        } else {
            requestState.setText("--");
            requestHeaders.setText("--");
        }

        responseData.setText("--");
        okhttp3.Response rawResponse = response.getRawResponse();
        if (rawResponse != null) {
            Headers responseHeadersString = rawResponse.headers();
            Set<String> names = responseHeadersString.names();
            sb = new StringBuilder();
            sb.append("stateCode : ").append(rawResponse.code()).append("\n");
            for (String name : names) {
                sb.append(name).append(" : ").append(responseHeadersString.get(name)).append("\n");
            }
            responseHeader.setText(sb.toString());
        } else {
            responseHeader.setText("--");
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/BaseFragment.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * 若把初始化内容放到initData实现,就是采用Lazy方式加载的Fragment
 * 若不需要Lazy加载则initData方法内留空,初始化内容放到initViews即可
 * -
 * -注1: 如果是与ViewPager一起使用,调用的是setUserVisibleHint。
 * ------可以调用mViewPager.setOffscreenPageLimit(size),若设置了该属性 则viewpager会缓存指定数量的Fragment
 * -注2: 如果是通过FragmentTransaction的show和hide的方法来控制显示,调用的是onHiddenChanged.
 * -注3: 针对初始就show的Fragment 为了触发onHiddenChanged事件 达到lazy效果 需要先hide再show
 */
/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class BaseFragment extends Fragment {

    protected String fragmentTitle;             //fragment标题
    private boolean isVisible;                  //是否可见状态
    private boolean isPrepared;                 //标志位,View已经初始化完成。
    private boolean isFirstLoad = true;         //是否第一次加载
    protected LayoutInflater inflater;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        this.inflater = inflater;
        isFirstLoad = true;
        View view = initView(inflater, container, savedInstanceState);
        isPrepared = true;
        lazyLoad();
        return view;
    }

    /** 如果是与ViewPager一起使用,调用的是setUserVisibleHint */
    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (getUserVisibleHint()) {
            isVisible = true;
            onVisible();
        } else {
            isVisible = false;
            onInvisible();
        }
    }

    /**
     * 如果是通过FragmentTransaction的show和hide的方法来控制显示,调用的是onHiddenChanged.
     * 若是初始就show的Fragment 为了触发该事件 需要先hide再show
     */
    @Override
    public void onHiddenChanged(boolean hidden) {
        super.onHiddenChanged(hidden);
        if (!hidden) {
            isVisible = true;
            onVisible();
        } else {
            isVisible = false;
            onInvisible();
        }
    }

    protected void onVisible() {
        lazyLoad();
    }

    protected void onInvisible() {
    }

    protected void lazyLoad() {
        if (!isPrepared || !isVisible || !isFirstLoad) {
            return;
        }
        isFirstLoad = false;
        initData();
    }

    protected abstract View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);

    protected abstract void initData();

    public String getTitle() {
        return TextUtils.isEmpty(fragmentTitle) ? "" : fragmentTitle;
    }

    public void setTitle(String title) {
        fragmentTitle = title;
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/BaseRecyclerAdapter.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class BaseRecyclerAdapter<T, VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {

    protected Context mContext;
    protected List<T> mDatas;
    protected LayoutInflater inflater;

    public BaseRecyclerAdapter(Context context) {
        this.mContext = context;
        this.mDatas = new ArrayList<>();
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    public BaseRecyclerAdapter(Context context, List<T> datas) {
        if (datas == null) datas = new ArrayList<>();
        this.mContext = context;
        this.mDatas = datas;
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    public BaseRecyclerAdapter(Context context, T[] datas) {
        this.mContext = context;
        this.mDatas = new ArrayList<T>();
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        Collections.addAll(mDatas, datas);
    }

    @Override
    public int getItemCount() {
        return mDatas == null ? 0 : mDatas.size();
    }

    /** 更新数据,替换原有数据 */
    public void updateItems(List<T> items) {
        mDatas = items;
        notifyDataSetChanged();
    }

    /** 插入一条数据 */
    public void addItem(T item) {
        mDatas.add(0, item);
        notifyItemInserted(0);
    }

    /** 插入一条数据 */
    public void addItem(T item, int position) {
        position = Math.min(position, mDatas.size());
        mDatas.add(position, item);
        notifyItemInserted(position);
    }

    /** 在列表尾添加一串数据 */
    public void addItems(List<T> items) {
        int start = mDatas.size();
        mDatas.addAll(items);
        notifyItemRangeChanged(start, items.size());
    }

    /** 移除一条数据 */
    public void removeItem(int position) {
        if (position > mDatas.size() - 1) {
            return;
        }
        mDatas.remove(position);
        notifyItemRemoved(position);
    }

    /** 移除一条数据 */
    public void removeItem(T item) {
        int position = 0;
        ListIterator<T> iterator = mDatas.listIterator();
        while (iterator.hasNext()) {
            T next = iterator.next();
            if (next == item) {
                iterator.remove();
                notifyItemRemoved(position);
            }
            position++;
        }
    }

    /** 清除所有数据 */
    public void removeAllItems() {
        mDatas.clear();
        notifyDataSetChanged();
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/BaseRxDetailActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/10/1
 * 描    述:统一管理所有的订阅生命周期
 * 修订历史:
 * ================================================
 */
public abstract class BaseRxDetailActivity extends BaseDetailActivity {

    private CompositeDisposable compositeDisposable;

    public void addDisposable(Disposable disposable) {
        if (compositeDisposable == null) {
            compositeDisposable = new CompositeDisposable();
        }
        compositeDisposable.add(disposable);
    }

    public void dispose() {
        if (compositeDisposable != null) compositeDisposable.dispose();
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/DividerItemDecoration.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)
 * 版    本:1.0
 * 创建日期:2016/4/7
 * 描    述:我的Github地址  https://github.com/jeasonlzy
 * 修订历史:
 * ================================================
 */
public class DividerItemDecoration extends RecyclerView.ItemDecoration {

    private static final int[] ATTRS = new int[]{android.R.attr.listDivider};

    public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
    public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;
    private Drawable mDivider;
    private int mOrientation;

    public DividerItemDecoration(Context context, int orientation) {
        final TypedArray a = context.obtainStyledAttributes(ATTRS);
        mDivider = a.getDrawable(0);
        a.recycle();
        setOrientation(orientation);
    }

    public void setOrientation(int orientation) {
        if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
            throw new IllegalArgumentException("invalid orientation");
        }
        mOrientation = orientation;
    }

    @Override
    public void onDraw(Canvas c, RecyclerView parent) {
        if (mOrientation == VERTICAL_LIST) {
            drawVertical(c, parent);
        } else {
            drawHorizontal(c, parent);
        }

    }

    public void drawVertical(Canvas c, RecyclerView parent) {
        final int left = parent.getPaddingLeft();
        final int right = parent.getWidth() - parent.getPaddingRight();

        final int childCount = parent.getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);
            final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
            final int top = child.getBottom() + params.bottomMargin;
            final int bottom = top + mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(c);
        }
    }

    public void drawHorizontal(Canvas c, RecyclerView parent) {
        final int top = parent.getPaddingTop();
        final int bottom = parent.getHeight() - parent.getPaddingBottom();

        final int childCount = parent.getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);
            final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
            final int left = child.getRight() + params.rightMargin;
            final int right = left + mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(c);
        }
    }

    @Override
    public void getItemOffsets(Rect outRect, int itemPosition, RecyclerView parent) {
        if (mOrientation == VERTICAL_LIST) {
            outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
        } else {
            outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/base/MainFragment.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.base;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lzy.demo.R;
import com.lzy.demo.model.ItemModel;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/9
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class MainFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener, BaseQuickAdapter.RequestLoadMoreListener {

    @Bind(R.id.refreshLayout) SwipeRefreshLayout refreshLayout;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;

    protected Context context;
    private MainAdapter adapter;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        this.context = context;
    }

    @Override
    protected View initView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.item_refresh, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onRefresh() {
        setRefreshing(false);
    }

    @Override
    public void onLoadMoreRequested() {
        refreshLayout.postDelayed(new Runnable() {
            @Override
            public void run() {
                adapter.loadComplete();
            }
        }, 500);
    }

    @Override
    protected void initData() {
        List<ItemModel> items = new ArrayList<>();
        fillData(items);

        adapter = new MainAdapter(items);
        adapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
        adapter.isFirstOnly(false);
        adapter.setOnLoadMoreListener(this);

        refreshLayout.setColorSchemeColors(Color.RED, Color.BLUE, Color.GREEN);
        refreshLayout.setOnRefreshListener(this);

        recyclerView.setLayoutManager(new LinearLayoutManager(context));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.addItemDecoration(new DividerItemDecoration(context, LinearLayoutManager.VERTICAL));

        recyclerView.setAdapter(adapter);
    }

    public abstract void fillData(List<ItemModel> items);

    public abstract void onItemClick(int position);

    private class MainAdapter extends BaseQuickAdapter<ItemModel> {

        MainAdapter(List<ItemModel> data) {
            super(R.layout.item_main_list, data);
        }

        @Override
        protected void convert(final BaseViewHolder baseViewHolder, ItemModel itemModel) {
            baseViewHolder.setText(R.id.title, itemModel.title);
            baseViewHolder.setText(R.id.des, itemModel.des);
            baseViewHolder.getConvertView().setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    onItemClick(baseViewHolder.getAdapterPosition());
                }
            });
        }
    }

    public void setRefreshing(final boolean refreshing) {
        refreshLayout.post(new Runnable() {
            @Override
            public void run() {
                refreshLayout.setRefreshing(refreshing);
            }
        });
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/BitmapDialogCallback.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.view.Window;

import com.lzy.okgo.callback.BitmapCallback;
import com.lzy.okgo.request.base.Request;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2016/1/14
 * 描    述:请求图图片的时候显示对话框
 * 修订历史:
 * ================================================
 */
public abstract class BitmapDialogCallback extends BitmapCallback {

    private ProgressDialog dialog;

    public BitmapDialogCallback(Activity activity) {
        super(1000, 1000);
        dialog = new ProgressDialog(activity);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setMessage("请求网络中...");
    }

    @Override
    public void onStart(Request<Bitmap, ? extends Request> request) {
        if (dialog != null && !dialog.isShowing()) {
            dialog.show();
        }
    }

    @Override
    public void onFinish() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/DialogCallback.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import android.app.Activity;
import android.app.ProgressDialog;
import android.view.Window;

import com.lzy.okgo.request.base.Request;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2016/1/14
 * 描    述:对于网络请求是否需要弹出进度对话框
 * 修订历史:
 * ================================================
 */
public abstract class DialogCallback<T> extends JsonCallback<T> {

    private ProgressDialog dialog;

    private void initDialog(Activity activity) {
        dialog = new ProgressDialog(activity);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setMessage("请求网络中...");
    }

    public DialogCallback(Activity activity) {
        super();
        initDialog(activity);
    }

    @Override
    public void onStart(Request<T, ? extends Request> request) {
        if (dialog != null && !dialog.isShowing()) {
            dialog.show();
        }
    }

    @Override
    public void onFinish() {
        //网络请求结束后关闭对话框
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/EncryptCallback.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import com.lzy.demo.utils.MD5Utils;
import com.lzy.okgo.model.HttpParams;
import com.lzy.okgo.request.base.Request;

import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public abstract class EncryptCallback<T> extends JsonCallback<T> {

    private static final Random RANDOM = new Random();
    private static final String CHARS = "0123456789abcdefghijklmnopqrstuvwxyz";

    @Override
    public void onStart(Request<T, ? extends Request> request) {
        super.onStart(request);
        //以下是示例加密代码,根据自己的业务需求和服务器的配合,算法自行决定,这里只是demo,不能用于商业项目
        sign(request.getParams());
    }

    /**
     * 针对URL进行签名,关于这几个参数的作用,详细请看
     * http://www.cnblogs.com/bestzrz/archive/2011/09/03/2164620.html
     */
    private void sign(HttpParams params) {
        params.put("nonce", getRndStr(6 + RANDOM.nextInt(8)));
        params.put("timestamp", "" + (System.currentTimeMillis() / 1000L));
        StringBuilder sb = new StringBuilder();
        Map<String, String> map = new HashMap<>();
        for (Map.Entry<String, List<String>> entry : params.urlParamsMap.entrySet()) {
            map.put(entry.getKey(), entry.getValue().get(0));
        }
        for (Map.Entry<String, String> entry : getSortedMapByKey(map).entrySet()) {
            sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
        }
        sb.delete(sb.length() - 1, sb.length());
        String sign = MD5Utils.encode(sb.toString());
        params.put("sign", sign);
    }

    /** 获取随机数 */
    private String getRndStr(int length) {
        StringBuilder sb = new StringBuilder();
        char ch;
        for (int i = 0; i < length; i++) {
            ch = CHARS.charAt(RANDOM.nextInt(CHARS.length()));
            sb.append(ch);
        }
        return sb.toString();
    }

    /** 按照key的自然顺序进行排序,并返回 */
    private Map<String, String> getSortedMapByKey(Map<String, String> map) {
        Comparator<String> comparator = new Comparator<String>() {
            @Override
            public int compare(String lhs, String rhs) {
                return lhs.compareTo(rhs);
            }
        };
        Map<String, String> treeMap = new TreeMap<>(comparator);
        for (Map.Entry<String, String> entry : map.entrySet()) {
            treeMap.put(entry.getKey(), entry.getValue());
        }
        return treeMap;
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/JsonCallback.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import com.lzy.okgo.callback.AbsCallback;
import com.lzy.okgo.request.base.Request;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import okhttp3.Response;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2016/1/14
 * 描    述:默认将返回的数据解析成需要的Bean,可以是 BaseBean,String,List,Map
 * 修订历史:
 * ================================================
 */
public abstract class JsonCallback<T> extends AbsCallback<T> {

    private Type type;
    private Class<T> clazz;

    public JsonCallback() {
    }

    public JsonCallback(Type type) {
        this.type = type;
    }

    public JsonCallback(Class<T> clazz) {
        this.clazz = clazz;
    }

    @Override
    public void onStart(Request<T, ? extends Request> request) {
        super.onStart(request);
        // 主要用于在所有请求之前添加公共的请求头或请求参数
        // 例如登录授权的 token
        // 使用的设备信息
        // 可以随意添加,也可以什么都不传
        // 还可以在这里对所有的参数进行加密,均在这里实现
        request.headers("header1", "HeaderValue1")//
                .params("params1", "ParamsValue1")//
                .params("token", "3215sdf13ad1f65asd4f3ads1f");
    }

    /**
     * 该方法是子线程处理,不能做ui相关的工作
     * 主要作用是解析网络返回的 response 对象,生产onSuccess回调中需要的数据对象
     * 这里的解析工作不同的业务逻辑基本都不一样,所以需要自己实现,以下给出的时模板代码,实际使用根据需要修改
     */
    @Override
    public T convertResponse(Response response) throws Throwable {

        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用
        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用
        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用

        //详细自定义的原理和文档,看这里: https://github.com/jeasonlzy/okhttp-OkGo/wiki/JsonCallback

        if (type == null) {
            if (clazz == null) {
                Type genType = getClass().getGenericSuperclass();
                type = ((ParameterizedType) genType).getActualTypeArguments()[0];
            } else {
                JsonConvert<T> convert = new JsonConvert<>(clazz);
                return convert.convertResponse(response);
            }
        }

        JsonConvert<T> convert = new JsonConvert<>(type);
        return convert.convertResponse(response);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/JsonConvert.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import com.google.gson.stream.JsonReader;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.SimpleResponse;
import com.lzy.demo.utils.Convert;
import com.lzy.okgo.convert.Converter;

import org.json.JSONArray;
import org.json.JSONObject;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

import okhttp3.Response;
import okhttp3.ResponseBody;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class JsonConvert<T> implements Converter<T> {

    private Type type;
    private Class<T> clazz;

    public JsonConvert() {
    }

    public JsonConvert(Type type) {
        this.type = type;
    }

    public JsonConvert(Class<T> clazz) {
        this.clazz = clazz;
    }

    /**
     * 该方法是子线程处理,不能做ui相关的工作
     * 主要作用是解析网络返回的 response 对象,生成onSuccess回调中需要的数据对象
     * 这里的解析工作不同的业务逻辑基本都不一样,所以需要自己实现,以下给出的时模板代码,实际使用根据需要修改
     */
    @Override
    public T convertResponse(Response response) throws Throwable {

        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用
        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用
        // 重要的事情说三遍,不同的业务,这里的代码逻辑都不一样,如果你不修改,那么基本不可用

        // 如果你对这里的代码原理不清楚,可以看这里的详细原理说明: https://github.com/jeasonlzy/okhttp-OkGo/wiki/JsonCallback
        // 如果你对这里的代码原理不清楚,可以看这里的详细原理说明: https://github.com/jeasonlzy/okhttp-OkGo/wiki/JsonCallback
        // 如果你对这里的代码原理不清楚,可以看这里的详细原理说明: https://github.com/jeasonlzy/okhttp-OkGo/wiki/JsonCallback

        if (type == null) {
            if (clazz == null) {
                // 如果没有通过构造函数传进来,就自动解析父类泛型的真实类型(有局限性,继承后就无法解析到)
                Type genType = getClass().getGenericSuperclass();
                type = ((ParameterizedType) genType).getActualTypeArguments()[0];
            } else {
                return parseClass(response, clazz);
            }
        }

        if (type instanceof ParameterizedType) {
            return parseParameterizedType(response, (ParameterizedType) type);
        } else if (type instanceof Class) {
            return parseClass(response, (Class<?>) type);
        } else {
            return parseType(response, type);
        }
    }

    private T parseClass(Response response, Class<?> rawType) throws Exception {
        if (rawType == null) return null;
        ResponseBody body = response.body();
        if (body == null) return null;
        JsonReader jsonReader = new JsonReader(body.charStream());

        if (rawType == String.class) {
            //noinspection unchecked
            return (T) body.string();
        } else if (rawType == JSONObject.class) {
            //noinspection unchecked
            return (T) new JSONObject(body.string());
        } else if (rawType == JSONArray.class) {
            //noinspection unchecked
            return (T) new JSONArray(body.string());
        } else {
            T t = Convert.fromJson(jsonReader, rawType);
            response.close();
            return t;
        }
    }

    private T parseType(Response response, Type type) throws Exception {
        if (type == null) return null;
        ResponseBody body = response.body();
        if (body == null) return null;
        JsonReader jsonReader = new JsonReader(body.charStream());

        // 泛型格式如下: new JsonCallback<任意JavaBean>(this)
        T t = Convert.fromJson(jsonReader, type);
        response.close();
        return t;
    }

    private T parseParameterizedType(Response response, ParameterizedType type) throws Exception {
        if (type == null) return null;
        ResponseBody body = response.body();
        if (body == null) return null;
        JsonReader jsonReader = new JsonReader(body.charStream());

        Type rawType = type.getRawType();                     // 泛型的实际类型
        Type typeArgument = type.getActualTypeArguments()[0]; // 泛型的参数
        if (rawType != LzyResponse.class) {
            // 泛型格式如下: new JsonCallback<外层BaseBean<内层JavaBean>>(this)
            T t = Convert.fromJson(jsonReader, type);
            response.close();
            return t;
        } else {
            if (typeArgument == Void.class) {
                // 泛型格式如下: new JsonCallback<LzyResponse<Void>>(this)
                SimpleResponse simpleResponse = Convert.fromJson(jsonReader, SimpleResponse.class);
                response.close();
                //noinspection unchecked
                return (T) simpleResponse.toLzyResponse();
            } else {
                // 泛型格式如下: new JsonCallback<LzyResponse<内层JavaBean>>(this)
                LzyResponse lzyResponse = Convert.fromJson(jsonReader, type);
                response.close();
                int code = lzyResponse.code;
                //这里的0是以下意思
                //一般来说服务器会和客户端约定一个数表示成功,其余的表示失败,这里根据实际情况修改
                if (code == 0) {
                    //noinspection unchecked
                    return (T) lzyResponse;
                } else if (code == 104) {
                    throw new IllegalStateException("用户授权信息无效");
                } else if (code == 105) {
                    throw new IllegalStateException("用户收取信息已过期");
                } else {
                    //直接将服务端的错误信息抛出,onError中可以获取
                    throw new IllegalStateException("错误代码:" + code + ",错误信息:" + lzyResponse.msg);
                }
            }
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/callback/StringDialogCallback.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.callback;

import android.app.Activity;
import android.app.ProgressDialog;
import android.view.Window;

import com.lzy.okgo.callback.StringCallback;
import com.lzy.okgo.request.base.Request;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)
 * 版    本:1.0
 * 创建日期:2016/4/8
 * 描    述:我的Github地址  https://github.com/jeasonlzy
 * 修订历史:
 * ================================================
 */
public abstract class StringDialogCallback extends StringCallback {

    private ProgressDialog dialog;

    public StringDialogCallback(Activity activity) {
        dialog = new ProgressDialog(activity);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setCanceledOnTouchOutside(false);
        dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        dialog.setMessage("请求网络中...");
    }

    @Override
    public void onStart(Request<String, ? extends Request> request) {
        if (dialog != null && !dialog.isShowing()) {
            dialog.show();
        }
    }

    @Override
    public void onFinish() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/ApkModel.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;
import java.util.Random;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class ApkModel implements Serializable {
    private static final long serialVersionUID = 2072893447591548402L;

    public String name;
    public String url;
    public String iconUrl;
    public int priority;

    public ApkModel() {
        Random random = new Random();
        priority = random.nextInt(100);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/GankModel.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/1
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class GankModel implements Serializable {
    private static final long serialVersionUID = 6753210234564872868L;

    public String _id;
    public Date createdAt;
    public String desc;
    public List<String> images;
    public Date publishedAt;
    public String source;
    public String type;
    public String url;
    public boolean used;
    public String who;
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/GankResponse.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/29
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class GankResponse<T> implements Serializable {
    private static final long serialVersionUID = -686453405647539973L;

    public boolean error;
    public T results;
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/ItemModel.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/9
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class ItemModel {
    public String title;
    public String des;
    public int type;

    public ItemModel() {
    }

    public ItemModel(String title, String des) {
        this.title = title;
        this.des = des;
    }

    public ItemModel(String title, String des, int type) {
        this.title = title;
        this.des = des;
        this.type = type;
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/LzyResponse.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/28
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class LzyResponse<T> implements Serializable {

    private static final long serialVersionUID = 5213230387175987834L;

    public int code;
    public String msg;
    public T data;

    @Override
    public String toString() {
        return "LzyResponse{\n" +//
               "\tcode=" + code + "\n" +//
               "\tmsg='" + msg + "\'\n" +//
               "\tdata=" + data + "\n" +//
               '}';
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/ServerModel.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)
 * 版    本:1.0
 * 创建日期:2016/4/7
 * 描    述:我的Github地址  https://github.com/jeasonlzy
 * 修订历史:
 * ================================================
 */
public class ServerModel implements Serializable {
    private static final long serialVersionUID = -828322761336296999L;

    public String method;
    public String ip;
    public String url;
    public String des;
    public String upload;
    public Author author;

    public class Author implements Serializable {
        private static final long serialVersionUID = 2701611773813762723L;

        public String name;
        public String fullname;
        public String github;
        public String address;
        public String qq;
        public String email;
        public String des;

        @Override
        public String toString() {
            return "Author{\n" +//
                   "\tname='" + name + "\'\n" +//
                   "\tfullname='" + fullname + "\'\n" +//
                   "\tgithub='" + github + "\'\n" +//
                   "\taddress='" + address + "\'\n" +//
                   "\tqq='" + qq + "\'\n" +//
                   "\temail='" + email + "\'\n" +//
                   "\tdes='" + des + "\'\n" +//
                   '}';
        }
    }

    @Override
    public String toString() {
        return "ServerModel{\n" +//
               "\tmethod='" + method + "\'\n" +//
               "\tip='" + ip + "\'\n" +//
               "\turl='" + url + "\'\n" +//
               "\tdes='" + des + "\'\n" +//
               "\tupload='" + upload + "\'\n" +//
               "\tauthor=" + author + "\n" +//
               '}';
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/model/SimpleResponse.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.model;

import java.io.Serializable;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/28
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class SimpleResponse implements Serializable {

    private static final long serialVersionUID = -1477609349345966116L;

    public int code;
    public String msg;

    public LzyResponse toLzyResponse() {
        LzyResponse lzyResponse = new LzyResponse();
        lzyResponse.code = code;
        lzyResponse.msg = msg;
        return lzyResponse;
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DesActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.text.format.Formatter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.demo.model.ApkModel;
import com.lzy.demo.utils.ApkUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okserver.OkDownload;
import com.lzy.okserver.download.DownloadListener;
import com.lzy.okserver.download.DownloadTask;

import java.io.File;
import java.text.NumberFormat;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DesActivity extends BaseActivity {

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.icon) ImageView icon;
    @Bind(R.id.name) TextView name;
    @Bind(R.id.downloadSize) TextView downloadSize;
    @Bind(R.id.tvProgress) TextView tvProgress;
    @Bind(R.id.netSpeed) TextView netSpeed;
    @Bind(R.id.pbProgress) ProgressBar pbProgress;
    @Bind(R.id.start) Button download;
    @Bind(R.id.remove) Button remove;
    @Bind(R.id.restart) Button restart;

    private NumberFormat numberFormat;
    private DownloadTask task;
    private ApkModel apk;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_details);
        initToolBar(toolbar, true, "下载管理");

        apk = (ApkModel) getIntent().getSerializableExtra("apk");
        numberFormat = NumberFormat.getPercentInstance();
        numberFormat.setMinimumFractionDigits(2);

        // 写法一:从内存中获取
        if (OkDownload.getInstance().hasTask(apk.url)) {
            task = OkDownload.getInstance().getTask(apk.url)//
                    .register(new DesListener("DesListener"))//
                    .register(new LogDownloadListener());
        }

        //写法二:从数据库中恢复
//        Progress progress = DownloadManager.getInstance().get(apk.getUrl());
//        if (progress != null) {
//            task = OkDownload.restore(progress)//
//                    .register(new DesListener("DesListener"))//
//                    .register(new LogDownloadListener());
//        }

        displayImage(apk.iconUrl, icon);
        name.setText(apk.name);
        if (task != null) refreshUi(task.progress);
    }

    private void refreshUi(Progress progress) {
        String currentSize = Formatter.formatFileSize(this, progress.currentSize);
        String totalSize = Formatter.formatFileSize(this, progress.totalSize);
        downloadSize.setText(currentSize + "/" + totalSize);
        String speed = Formatter.formatFileSize(this, progress.speed);
        netSpeed.setText(String.format("%s/s", speed));
        tvProgress.setText(numberFormat.format(progress.fraction));
        pbProgress.setMax(10000);
        pbProgress.setProgress((int) (progress.fraction * 10000));
        switch (progress.status) {
            case Progress.NONE:
                download.setText("下载");
                break;
            case Progress.LOADING:
                download.setText("暂停");
                break;
            case Progress.PAUSE:
                download.setText("继续");
                break;
            case Progress.WAITING:
                download.setText("等待");
                break;
            case Progress.ERROR:
                download.setText("出错");
                break;
            case Progress.FINISH:
                if (ApkUtils.isAvailable(this, new File(progress.filePath))) {
                    download.setText("卸载");
                } else {
                    download.setText("安装");
                }
                break;
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (task != null) {
            task.unRegister("DesListener");
        }
    }

    @OnClick(R.id.start)
    public void start() {
        if (task == null) {

            //这里只是演示,表示请求可以传参,怎么传都行,和okgo使用方法一样
            GetRequest<File> request = OkGo.<File>get(apk.url)//
                    .headers("aaa", "111")//
                    .params("bbb", "222");

            task = OkDownload.request(apk.url, request)//
                    .priority(apk.priority)//
                    .extra1(apk)//
                    .save()//
                    .register(new DesListener("DesListener"))//
                    .register(new LogDownloadListener());
        }
        switch (task.progress.status) {
            case Progress.PAUSE:
            case Progress.NONE:
            case Progress.ERROR:
                task.start();
                break;
            case Progress.LOADING:
                task.pause();
                break;
            case Progress.FINISH:
                File file = new File(task.progress.filePath);
                if (ApkUtils.isAvailable(this, file)) {
                    ApkUtils.uninstall(this, ApkUtils.getPackageName(this, file.getAbsolutePath()));
                } else {
                    ApkUtils.install(this, file);
                }
                break;
        }
    }

    @OnClick(R.id.remove)
    public void remove() {
        if (task != null) {
            task.remove();
            task = null;
        }
        downloadSize.setText("--M/--M");
        netSpeed.setText("---/s");
        tvProgress.setText("--.--%");
        pbProgress.setProgress(0);
        download.setText("下载");
    }

    @OnClick(R.id.restart)
    public void restart() {
        if (task != null) task.restart();
    }

    private class DesListener extends DownloadListener {

        DesListener(String tag) {
            super(tag);
        }

        @Override
        public void onStart(Progress progress) {
        }

        @Override
        public void onProgress(Progress progress) {
            refreshUi(progress);
        }

        @Override
        public void onFinish(File file, Progress progress) {
        }

        @Override
        public void onRemove(Progress progress) {
        }

        @Override
        public void onError(Progress progress) {
            Throwable throwable = progress.exception;
            if (throwable != null) throwable.printStackTrace();
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadAdapter.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.format.Formatter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.lzy.demo.R;
import com.lzy.demo.model.ApkModel;
import com.lzy.demo.ui.NumberProgressBar;
import com.lzy.demo.utils.ApkUtils;
import com.lzy.okgo.db.DownloadManager;
import com.lzy.okgo.model.Progress;
import com.lzy.okserver.OkDownload;
import com.lzy.okserver.download.DownloadListener;
import com.lzy.okserver.download.DownloadTask;

import java.io.File;
import java.text.NumberFormat;
import java.util.List;
import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/5
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DownloadAdapter extends RecyclerView.Adapter<DownloadAdapter.ViewHolder> {

    public static final int TYPE_ALL = 0;
    public static final int TYPE_FINISH = 1;
    public static final int TYPE_ING = 2;

    private List<DownloadTask> values;
    private NumberFormat numberFormat;
    private LayoutInflater inflater;
    private Context context;
    private int type;

    public DownloadAdapter(Context context) {
        this.context = context;
        numberFormat = NumberFormat.getPercentInstance();
        numberFormat.setMinimumFractionDigits(2);
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    public void updateData(int type) {
        //这里是将数据库的数据恢复
        this.type = type;
        if (type == TYPE_ALL) values = OkDownload.restore(DownloadManager.getInstance().getAll());
        if (type == TYPE_FINISH) values = OkDownload.restore(DownloadManager.getInstance().getFinished());
        if (type == TYPE_ING) values = OkDownload.restore(DownloadManager.getInstance().getDownloading());
        notifyDataSetChanged();
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.item_download_manager, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        DownloadTask task = values.get(position);
        String tag = createTag(task);
        task.register(new ListDownloadListener(tag, holder))//
                .register(new LogDownloadListener());
        holder.setTag(tag);
        holder.setTask(task);
        holder.bind();
        holder.refresh(task.progress);
    }

    public void unRegister() {
        Map<String, DownloadTask> taskMap = OkDownload.getInstance().getTaskMap();
        for (DownloadTask task : taskMap.values()) {
            task.unRegister(createTag(task));
        }
    }

    private String createTag(DownloadTask task) {
        return type + "_" + task.progress.tag;
    }

    @Override
    public int getItemCount() {
        return values == null ? 0 : values.size();
    }

    public class ViewHolder extends RecyclerView.ViewHolder {

        @Bind(R.id.icon) ImageView icon;
        @Bind(R.id.name) TextView name;
        @Bind(R.id.priority) TextView priority;
        @Bind(R.id.downloadSize) TextView downloadSize;
        @Bind(R.id.tvProgress) TextView tvProgress;
        @Bind(R.id.netSpeed) TextView netSpeed;
        @Bind(R.id.pbProgress) NumberProgressBar pbProgress;
        @Bind(R.id.start) Button download;
        private DownloadTask task;
        private String tag;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }

        public void setTask(DownloadTask task) {
            this.task = task;
        }

        public void bind() {
            Progress progress = task.progress;
            ApkModel apk = (ApkModel) progress.extra1;
            if (apk != null) {
                Glide.with(context).load(apk.iconUrl).error(R.mipmap.ic_launcher).into(icon);
                name.setText(apk.name);
                priority.setText(String.format("优先级:%s", progress.priority));
            } else {
                name.setText(progress.fileName);
            }
        }

        public void refresh(Progress progress) {
            String currentSize = Formatter.formatFileSize(context, progress.currentSize);
            String totalSize = Formatter.formatFileSize(context, progress.totalSize);
            downloadSize.setText(currentSize + "/" + totalSize);
            priority.setText(String.format("优先级:%s", progress.priority));
            switch (progress.status) {
                case Progress.NONE:
                    netSpeed.setText("停止");
                    download.setText("下载");
                    break;
                case Progress.PAUSE:
                    netSpeed.setText("暂停中");
                    download.setText("继续");
                    break;
                case Progress.ERROR:
                    netSpeed.setText("下载出错");
                    download.setText("出错");
                    break;
                case Progress.WAITING:
                    netSpeed.setText("等待中");
                    download.setText("等待");
                    break;
                case Progress.FINISH:
                    netSpeed.setText("下载完成");
                    download.setText("完成");
                    break;
                case Progress.LOADING:
                    String speed = Formatter.formatFileSize(context, progress.speed);
                    netSpeed.setText(String.format("%s/s", speed));
                    download.setText("暂停");
                    break;
            }
            tvProgress.setText(numberFormat.format(progress.fraction));
            pbProgress.setMax(10000);
            pbProgress.setProgress((int) (progress.fraction * 10000));
        }

        @OnClick(R.id.start)
        public void start() {
            Progress progress = task.progress;
            switch (progress.status) {
                case Progress.PAUSE:
                case Progress.NONE:
                case Progress.ERROR:
                    task.start();
                    break;
                case Progress.LOADING:
                    task.pause();
                    break;
                case Progress.FINISH:
                    if (ApkUtils.isAvailable(context, new File(progress.filePath))) {
                        ApkUtils.uninstall(context, ApkUtils.getPackageName(context, progress.filePath));
                    } else {
                        ApkUtils.install(context, new File(progress.filePath));
                    }
                    break;
            }
            refresh(progress);
        }

        @OnClick(R.id.remove)
        public void remove() {
            task.remove(true);
            updateData(type);
        }

        @OnClick(R.id.restart)
        public void restart() {
            task.restart();
        }

        public void setTag(String tag) {
            this.tag = tag;
        }

        public String getTag() {
            return tag;
        }
    }

    private class ListDownloadListener extends DownloadListener {

        private ViewHolder holder;

        ListDownloadListener(Object tag, ViewHolder holder) {
            super(tag);
            this.holder = holder;
        }

        @Override
        public void onStart(Progress progress) {
        }

        @Override
        public void onProgress(Progress progress) {
            if (tag == holder.getTag()) {
                holder.refresh(progress);
            }
        }

        @Override
        public void onError(Progress progress) {
            Throwable throwable = progress.exception;
            if (throwable != null) throwable.printStackTrace();
        }

        @Override
        public void onFinish(File file, Progress progress) {
            Toast.makeText(context, "下载完成:" + progress.filePath, Toast.LENGTH_SHORT).show();
            updateData(type);
        }

        @Override
        public void onRemove(Progress progress) {
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadAllActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.okserver.OkDownload;
import com.lzy.okserver.task.XExecutor;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DownloadAllActivity extends BaseActivity implements XExecutor.OnAllTaskEndListener {

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;

    private DownloadAdapter adapter;
    private OkDownload okDownload;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_all);
        initToolBar(toolbar, true, "所有任务");

        okDownload = OkDownload.getInstance();
        adapter = new DownloadAdapter(this);
        adapter.updateData(DownloadAdapter.TYPE_ALL);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);

        okDownload.addOnAllTaskEndListener(this);
    }

    @Override
    public void onAllTaskEnd() {
        showToast("所有下载任务已结束");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        okDownload.removeOnAllTaskEndListener(this);
        adapter.unRegister();
    }

    @Override
    protected void onResume() {
        super.onResume();
        adapter.notifyDataSetChanged();
    }

    @OnClick(R.id.removeAll)
    public void removeAll(View view) {
        okDownload.removeAll();
        adapter.updateData(DownloadAdapter.TYPE_ALL);
        adapter.notifyDataSetChanged();
    }

    @OnClick(R.id.pauseAll)
    public void pauseAll(View view) {
        okDownload.pauseAll();
    }

    @OnClick(R.id.startAll)
    public void startAll(View view) {
        okDownload.startAll();
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadFinishActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.okserver.OkDownload;
import com.lzy.okserver.task.XExecutor;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DownloadFinishActivity extends BaseActivity implements XExecutor.OnAllTaskEndListener {

    private DownloadAdapter adapter;
    private OkDownload okDownload;

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;
    @Bind(R.id.pauseAll) Button pauseAll;
    @Bind(R.id.startAll) Button startAll;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_all);
        initToolBar(toolbar, true, "已完成任务");

        pauseAll.setVisibility(View.GONE);
        startAll.setVisibility(View.GONE);

        okDownload = OkDownload.getInstance();
        adapter = new DownloadAdapter(this);
        adapter.updateData(DownloadAdapter.TYPE_FINISH);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);

        okDownload.addOnAllTaskEndListener(this);
    }

    @Override
    public void onAllTaskEnd() {
        showToast("所有下载任务已结束");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        okDownload.removeOnAllTaskEndListener(this);
        adapter.unRegister();
    }

    @Override
    protected void onResume() {
        super.onResume();
        adapter.notifyDataSetChanged();
    }

    @OnClick(R.id.removeAll)
    public void removeAll(View view) {
        OkDownload.getInstance().removeAll();
        adapter.updateData(DownloadAdapter.TYPE_FINISH);
        adapter.notifyDataSetChanged();
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadListActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.demo.base.BaseRecyclerAdapter;
import com.lzy.demo.base.DividerItemDecoration;
import com.lzy.demo.model.ApkModel;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.db.DownloadManager;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okserver.OkDownload;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DownloadListActivity extends BaseActivity {

    private static final int REQUEST_PERMISSION_STORAGE = 0x01;

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.targetFolder) TextView folder;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;

    private List<ApkModel> apks;
    private DownloadListAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_list);
        initToolBar(toolbar, true, "开始下载");

        initData();
        OkDownload.getInstance().setFolder(Environment.getExternalStorageDirectory().getAbsolutePath() + "/aaa/");
        OkDownload.getInstance().getThreadPool().setCorePoolSize(3);

        folder.setText(String.format("下载路径: %s", OkDownload.getInstance().getFolder()));
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));

        //从数据库中恢复数据
        List<Progress> progressList = DownloadManager.getInstance().getAll();
        OkDownload.restore(progressList);
        adapter = new DownloadListAdapter(this);
        recyclerView.setAdapter(adapter);

        checkSDCardPermission();
    }

    /** 检查SD卡权限 */
    protected void checkSDCardPermission() {
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_PERMISSION_STORAGE);
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        if (requestCode == REQUEST_PERMISSION_STORAGE) {
            if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                //获取权限
            } else {
                showToast("权限被禁止,无法下载文件!");
            }
        }
    }

    @OnClick(R.id.startAll)
    public void startAll(View view) {
        for (ApkModel apk : apks) {

            //这里只是演示,表示请求可以传参,怎么传都行,和okgo使用方法一样
            GetRequest<File> request = OkGo.<File>get(apk.url)//
                    .headers("aaa", "111")//
                    .params("bbb", "222");

            //这里第一个参数是tag,代表下载任务的唯一标识,传任意字符串都行,需要保证唯一,我这里用url作为了tag
            OkDownload.request(apk.url, request)//
                    .priority(apk.priority)//
                    .extra1(apk)//
                    .save()//
                    .register(new LogDownloadListener())//
                    .start();
            adapter.notifyDataSetChanged();
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        adapter.notifyDataSetChanged();
    }

    private class DownloadListAdapter extends BaseRecyclerAdapter<ApkModel, ViewHolder> {

        DownloadListAdapter(Context context) {
            super(context, apks);
        }

        @Override
        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = inflater.inflate(R.layout.item_download_list, parent, false);
            return new ViewHolder(view);
        }

        @Override
        public void onBindViewHolder(ViewHolder holder, int position) {
            ApkModel apkModel = mDatas.get(position);
            holder.bind(apkModel);
        }
    }

    public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

        @Bind(R.id.name) TextView name;
        @Bind(R.id.priority) TextView priority;
        @Bind(R.id.icon) ImageView icon;
        @Bind(R.id.download) Button download;

        private ApkModel apk;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }

        public void bind(ApkModel apk) {
            this.apk = apk;
            if (OkDownload.getInstance().getTask(apk.url) != null) {
                download.setText("已在队列");
                download.setEnabled(false);
            } else {
                download.setText("下载");
                download.setEnabled(true);
            }
            priority.setText(String.format("优先级:%s", apk.priority));
            name.setText(apk.name);
            displayImage(apk.iconUrl, icon);
            itemView.setOnClickListener(this);
        }

        @OnClick(R.id.download)
        public void download() {

            //这里只是演示,表示请求可以传参,怎么传都行,和okgo使用方法一样
            GetRequest<File> request = OkGo.<File>get(apk.url)//
                    .headers("aaa", "111")//
                    .params("bbb", "222");

            //这里第一个参数是tag,代表下载任务的唯一标识,传任意字符串都行,需要保证唯一,我这里用url作为了tag
            OkDownload.request(apk.url, request)//
                    .priority(apk.priority)//
                    .extra1(apk)//
                    .save()//
                    .register(new LogDownloadListener())//
                    .start();
            adapter.notifyDataSetChanged();
        }

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getApplicationContext(), DesActivity.class);
            intent.putExtra("apk", apk);
            startActivity(intent);
        }
    }

    private void initData() {
        apks = new ArrayList<>();
        ApkModel apk1 = new ApkModel();
        apk1.name = "爱奇艺";
        apk1.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0c10c4c0155c9adf1282af008ed329378d54112ac";
        apk1.url = "http://121.29.10.1/f5.market.mi-img.com/download/AppStore/0b8b552a1df0a8bc417a5afae3a26b2fb1342a909/com.qiyi.video.apk";
        apks.add(apk1);
        ApkModel apk2 = new ApkModel();
        apk2.name = "微信";
        apk2.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/00814b5dad9b54cc804466369c8cb18f23e23823f";
        apk2.url = "http://116.117.158.129/f2.market.xiaomi.com/download/AppStore/04275951df2d94fee0a8210a3b51ae624cc34483a/com.tencent.mm.apk";
        apks.add(apk2);
        ApkModel apk3 = new ApkModel();
        apk3.name = "新浪微博";
        apk3.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/01db44d7f809430661da4fff4d42e703007430f38";
        apk3.url = "http://60.28.125.129/f1.market.xiaomi.com/download/AppStore/0ff41344f280f40c83a1bbf7f14279fb6542ebd2a/com.sina.weibo.apk";
        apks.add(apk3);
        ApkModel apk4 = new ApkModel();
        apk4.name = "QQ";
        apk4.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/072725ca573700292b92e636ec126f51ba4429a50";
        apk4.url = "http://121.29.10.1/f3.market.xiaomi.com/download/AppStore/0ff0604fd770f481927d1edfad35675a3568ba656/com.tencent.mobileqq.apk";
        apks.add(apk4);
        ApkModel apk5 = new ApkModel();
        apk5.name = "陌陌";
        apk5.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/06006948e655c4dd11862d060bd055b4fd2b5c41b";
        apk5.url = "http://121.18.239.1/f4.market.xiaomi.com/download/AppStore/096f34dec955dbde0597f4e701d1406000d432064/com.immomo.momo.apk";
        apks.add(apk5);
        ApkModel apk6 = new ApkModel();
        apk6.name = "手机淘宝";
        apk6.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/017a859792d09d7394108e0a618411675ec43f220";
        apk6.url = "http://121.29.10.1/f3.market.xiaomi.com/download/AppStore/0afc00452eb1a4dc42b20c9351eacacab4692a953/com.taobao.taobao.apk";
        apks.add(apk6);
        ApkModel apk7 = new ApkModel();
        apk7.name = "酷狗音乐";
        apk7.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0f2f050e21e42f75c7ecca55d01ac4e5e4e40ca8d";
        apk7.url = "http://121.18.239.1/f5.market.xiaomi.com/download/AppStore/053ed49c1545c6eec3e3e23b31568c731f940934f/com.kugou.android.apk";
        apks.add(apk7);
        ApkModel apk8 = new ApkModel();
        apk8.name = "网易云音乐";
        apk8.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/02374548ac39f3b7cdbf5bea4b0535b5d1f432f23";
        apk8.url = "http://121.18.239.1/f4.market.xiaomi.com/download/AppStore/0f458c5661acb492e30b808a2e3e4c8672e6b55e2/com.netease.cloudmusic.apk";
        apks.add(apk8);
        ApkModel apk9 = new ApkModel();
        apk9.name = "ofo共享单车";
        apk9.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0fe1a5c6092f3d9fa5c4c1e3158e6ff33f6418152";
        apk9.url = "http://60.28.125.1/f4.market.mi-img.com/download/AppStore/06954949fcd48414c16f726620cf2d52200550f56/so.ofo.labofo.apk";
        apks.add(apk9);
        ApkModel apk10 = new ApkModel();
        apk10.name = "摩拜单车";
        apk10.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0863a058a811148a5174d9784b7be2f1114191f83";
        apk10.url = "http://60.28.125.1/f4.market.xiaomi.com/download/AppStore/00cdeb4865c5a4a7d350fe30b9f812908a569cc8a/com.mobike.mobikeapp.apk";
        apks.add(apk10);
        ApkModel apk11 = new ApkModel();
        apk11.name = "贪吃蛇大作战";
        apk11.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/09f7f5756d9d63bb149b7149b8bdde0769941f09b";
        apk11.url = "http://60.22.46.1/f3.market.xiaomi.com/download/AppStore/0b02f24ffa8334bd21b16bd70ecacdb42374eb9cb/com.wepie.snake.new.mi.apk";
        apks.add(apk11);
        ApkModel apk12 = new ApkModel();
        apk12.name = "蘑菇街";
        apk12.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0ab53044735e842c421a57954d86a77aea30cc1da";
        apk12.url = "http://121.29.10.1/f5.market.xiaomi.com/download/AppStore/07a6ee4955e364c3f013b14055c37b8e4f6668161/com.mogujie.apk";
        apks.add(apk12);
        ApkModel apk13 = new ApkModel();
        apk13.name = "聚美优品";
        apk13.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/080ed520b76d943e5533017a19bc76d9f554342d0";
        apk13.url = "http://121.29.10.1/f5.market.mi-img.com/download/AppStore/0e70a572cd5fd6a3718941328238d78d71942aee0/com.jm.android.jumei.apk";
        apks.add(apk13);
        ApkModel apk14 = new ApkModel();
        apk14.name = "全民K歌";
        apk14.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0f1f653261ff8b3a64324097224e40eface432b99";
        apk14.url = "http://60.28.123.129/f4.market.xiaomi.com/download/AppStore/04f515e21146022934085454a1121e11ae34396ae/com.tencent.karaoke.apk";
        apks.add(apk14);
        ApkModel apk15 = new ApkModel();
        apk15.name = "书旗小说";
        apk15.iconUrl = "http://file.market.xiaomi.com/thumbnail/PNG/l114/AppStore/0c9ce345aa2734b1202ddf32b6545d9407b18ba0b";
        apk15.url = "http://60.28.125.129/f5.market.mi-img.com/download/AppStore/02d9c4035b248753314f46600cf7347a306426dc1/com.shuqi.controller.apk";
        apks.add(apk15);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadingActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.okserver.OkDownload;
import com.lzy.okserver.task.XExecutor;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class DownloadingActivity extends BaseActivity implements XExecutor.OnAllTaskEndListener {

    private DownloadAdapter adapter;
    private OkDownload okDownload;

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_download_all);
        initToolBar(toolbar, true, "下载中任务");

        okDownload = OkDownload.getInstance();
        adapter = new DownloadAdapter(this);
        adapter.updateData(DownloadAdapter.TYPE_ING);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapter);

        okDownload.addOnAllTaskEndListener(this);
    }

    @Override
    public void onAllTaskEnd() {
        showToast("所有下载任务已结束");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        okDownload.removeOnAllTaskEndListener(this);
        adapter.unRegister();
    }

    @Override
    protected void onResume() {
        super.onResume();
        adapter.notifyDataSetChanged();
    }

    @OnClick(R.id.removeAll)
    public void removeAll(View view) {
        okDownload.removeAll();
        adapter.updateData(DownloadAdapter.TYPE_ING);
        adapter.notifyDataSetChanged();
    }

    @OnClick(R.id.pauseAll)
    public void pauseAll(View view) {
        okDownload.pauseAll();
    }

    @OnClick(R.id.startAll)
    public void startAll(View view) {
        okDownload.startAll();
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/LogDownloadListener.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import com.lzy.okgo.model.Progress;
import com.lzy.okserver.download.DownloadListener;

import java.io.File;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/7
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class LogDownloadListener extends DownloadListener {

    public LogDownloadListener() {
        super("LogDownloadListener");
    }

    @Override
    public void onStart(Progress progress) {
        System.out.println("onStart: " + progress);
    }

    @Override
    public void onProgress(Progress progress) {
        System.out.println("onProgress: " + progress);
    }

    @Override
    public void onError(Progress progress) {
        System.out.println("onError: " + progress);
        progress.exception.printStackTrace();
    }

    @Override
    public void onFinish(File file, Progress progress) {
        System.out.println("onFinish: " + progress);
    }

    @Override
    public void onRemove(Progress progress) {
        System.out.println("onRemove: " + progress);
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okdownload/OkDownloadFragment.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okdownload;

import android.content.Intent;

import com.lzy.demo.base.MainFragment;
import com.lzy.demo.model.ItemModel;

import java.util.List;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:2017/6/9
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class OkDownloadFragment extends MainFragment {

    @Override
    public void fillData(List<ItemModel> items) {
        items.add(new ItemModel("开始下载",//
                                "1. 这个属于OkServer依赖中的功能,并不属于OkGo\n" +//
                                "2. 支持断点下载和状态管理\n" +//
                                "3. 支持自定义下载任务优先级\n" +//
                                "4. 支持链试调用\n" +//
                                "5. 最多支持扩展3个额外数据\n" +//
                                "6. 支持同时指定多个下载目录"));

        items.add(new ItemModel("所有任务",//
                                "1. 每个任务支持暂停,继续,重新下载,删除等操作\n" +//
                                "2. 支持全部暂停,全部开始,全部删除\n" +//
                                "3. 支持全局下载任务监听\n" +//
                                "4. 支持一个任务多个监听\n" +//
                                "5. 支持按下载中列表和下载完成列表筛选"));

        items.add(new ItemModel("下载中任务",//
                                "1. 每个任务支持暂停,继续,重新下载,删除等操作\n" +//
                                "2. 支持全部暂停,全部开始,全部删除\n" +//
                                "3. 支持全局下载任务监听\n" +//
                                "4. 支持一个任务多个监听\n" +//
                                "5. 支持按下载中列表和下载完成列表筛选"));

        items.add(new ItemModel("已完成任务",//
                                "1. 每个任务支持暂停,继续,重新下载,删除等操作\n" +//
                                "2. 支持全部暂停,全部开始,全部删除\n" +//
                                "3. 支持全局下载任务监听\n" +//
                                "4. 支持一个任务多个监听\n" +//
                                "5. 支持按下载中列表和下载完成列表筛选"));

    }

    @Override
    public void onItemClick(int position) {
        if (position == 0) startActivity(new Intent(context, DownloadListActivity.class));
        if (position == 1) startActivity(new Intent(context, DownloadAllActivity.class));
        if (position == 2) startActivity(new Intent(context, DownloadingActivity.class));
        if (position == 3) startActivity(new Intent(context, DownloadFinishActivity.class));
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/BitmapRequestActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.BitmapDialogCallback;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class BitmapRequestActivity extends BaseDetailActivity {

    @Bind(R.id.imageView) ImageView imageView;

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_bitmap_request);
        ButterKnife.bind(this);
        setTitle("请求图片");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @OnClick(R.id.requestImage)
    public void requestJson(View view) {
        OkGo.<Bitmap>get(Urls.URL_IMAGE)//
                .tag(this)//
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new BitmapDialogCallback(this) {
                    @Override
                    public void onSuccess(Response<Bitmap> response) {
                        handleResponse(response);
                        imageView.setImageBitmap(response.body());
                    }

                    @Override
                    public void onError(Response<Bitmap> response) {
                        handleError(response);
                    }
                });
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/CacheActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.DialogCallback;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.ServerModel;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.db.CacheManager;
import com.lzy.okgo.model.Response;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.Call;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class CacheActivity extends BaseDetailActivity {

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_cache);
        ButterKnife.bind(this);
        setTitle("网络缓存基本用法");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @SuppressWarnings("unchecked")
    @OnClick(R.id.getAll)
    public void getAll(View view) {
        // 获取所有的缓存,但是一般每个缓存的泛型都不一样,所以缓存的泛型使用 ?
        List<CacheEntity<?>> all = CacheManager.getInstance().getAll();
        StringBuilder sb = new StringBuilder();
        sb.append("共" + all.size() + "条缓存:").append("\n\n");
        for (int i = 0; i < all.size(); i++) {
            CacheEntity<?> cacheEntity = all.get(i);
            sb.append("第" + (i + 1) + "条缓存:").append("\n").append(cacheEntity).append("\n\n");
        }
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("所有缓存显示").setMessage(sb.toString()).show();
    }

    @OnClick(R.id.clear)
    public void clear(View view) {
        boolean clear = CacheManager.getInstance().clear();
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("清除缓存").setMessage("是否清除成功:" + clear).show();
    }

    @OnClick(R.id.no_cache)
    public void no_cache(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_CACHE)//
                .tag(this)//
                .cacheMode(CacheMode.NO_CACHE)//
                .cacheKey("no_cache")   //对于无缓存模式,该参数无效
                .cacheTime(5000)        //对于无缓存模式,该时间无效
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new CacheCallBack(this));
    }

    @OnClick(R.id.cache_default)
    public void cache_default(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_CACHE)//
                .tag(this)//
                .cacheMode(CacheMode.DEFAULT)//
                .cacheKey("cache_default")//
                .cacheTime(5000)//对于默认的缓存模式,该时间无效,依靠的是服务端对304缓存的控制
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new CacheCallBack(this));
    }

    @OnClick(R.id.request_failed_read_cache)
    public void request_failed_read_cache(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_CACHE)//
                .tag(this)//
                .cacheMode(CacheMode.REQUEST_FAILED_READ_CACHE)//
                .cacheKey("request_failed_read_cache")//
                .cacheTime(5000)            // 单位毫秒.5秒后过期
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new CacheCallBack(this));
    }

    @OnClick(R.id.if_none_cache_request)
    public void if_none_cache_request(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_CACHE)//
                .tag(this)//
                .cacheMode(CacheMode.IF_NONE_CACHE_REQUEST)//
                .cacheKey("if_none_cache_request")//
                .cacheTime(5000)            // 单位毫秒.5秒后过期
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new CacheCallBack(this));
    }

    @OnClick(R.id.first_cache_then_request)
    public void first_cache_then_request(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_CACHE)//
                .tag(this)//
                .cacheMode(CacheMode.FIRST_CACHE_THEN_REQUEST)//
                .cacheKey("first_cache_then_request")//
                .cacheTime(5000)            // 单位毫秒.5秒后过期
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new CacheCallBack(this));
    }

    private class CacheCallBack extends DialogCallback<LzyResponse<ServerModel>> {

        CacheCallBack(Activity activity) {
            super(activity);
        }

        @Override
        public void onSuccess(Response<LzyResponse<ServerModel>> response) {
            handleResponse(response);
            Call call = response.getRawCall();
            requestState.setText("请求成功  是否来自缓存:false  请求方式:" + call.request().method() + "\n" + "url:" + call.request().url());
        }

        @Override
        public void onCacheSuccess(Response<LzyResponse<ServerModel>> response) {
            handleResponse(response);
            Call call = response.getRawCall();
            requestState.setText("请求成功  是否来自缓存:true  请求方式:" + call.request().method() + "\n" + "url:" + call.request().url());
        }

        @Override
        public void onError(Response<LzyResponse<ServerModel>> response) {
            handleError(response);
            Call call = response.getRawCall();
            requestState.setText("请求失败  是否来自缓存:false  请求方式:" + call.request().method() + "\n" + "url:" + call.request().url());
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/CommonActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lzy.demo.R;
import com.lzy.demo.base.BaseActivity;
import com.lzy.demo.base.DividerItemDecoration;
import com.lzy.demo.model.ItemModel;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class CommonActivity extends BaseActivity {

    @Bind(R.id.toolbar) Toolbar toolbar;
    @Bind(R.id.recyclerView) RecyclerView recyclerView;
    private List<ItemModel> data;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_recycler);
        initToolBar(toolbar, true, "OkGo功能介绍");

        initData();

        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setItemAnimator(new DefaultItemAnimator());
        recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
        recyclerView.setAdapter(new MainAdapter(data));
    }

    private void initData() {
        data = new ArrayList<>();
        data.add(new ItemModel("请求方法演示", "目前支持 GET,HEAD,OPTIONS,POST,PUT,DELETE, PATCH, TRACE"));
        data.add(new ItemModel("请求图片", "请求服务器返回bitmap对象"));
        data.add(new ItemModel("普通上传数据", "可以向服务器上传任意类型的文本数据,包括 String,JSONObject,JSONArray,byte[],文件等"));
        data.add(new ItemModel("网络缓存基本用法", "默认提供了四种缓存模式,根据需要选择使用"));
        data.add(new ItemModel("支持https请求", "支持 cer,bks 证书,支持双向认证"));
        data.add(new ItemModel("cookie管理与session保持", "支持cookie的自动管理,也支持自己手动管理cookie,自动session保持"));
        data.add(new ItemModel("同步请求", "允许直接返回Response对象,会阻塞主线程,需要自行开启子线程"));
        data.add(new ItemModel("301重定向", "支持301重定向请求"));
        data.add(new ItemModel("测试页面", "用于测试特殊情况下的网络连接,可忽略"));
    }

    private class MainAdapter extends BaseQuickAdapter<ItemModel> {

        MainAdapter(List<ItemModel> data) {
            super(R.layout.item_main_list, data);
        }

        @Override
        protected void convert(final BaseViewHolder baseViewHolder, ItemModel itemModel) {
            baseViewHolder.setText(R.id.title, itemModel.title);
            baseViewHolder.setText(R.id.des, itemModel.des);
            baseViewHolder.getConvertView().setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    int position = baseViewHolder.getAdapterPosition();
                    if (position == 0) startActivity(new Intent(CommonActivity.this, MethodActivity.class));
                    if (position == 1) startActivity(new Intent(CommonActivity.this, BitmapRequestActivity.class));
                    if (position == 2) startActivity(new Intent(CommonActivity.this, UpActivity.class));
                    if (position == 3) startActivity(new Intent(CommonActivity.this, CacheActivity.class));
                    if (position == 4) startActivity(new Intent(CommonActivity.this, HttpsActivity.class));
                    if (position == 5) startActivity(new Intent(CommonActivity.this, CookieActivity.class));
                    if (position == 6) startActivity(new Intent(CommonActivity.this, SyncActivity.class));
                    if (position == 7) startActivity(new Intent(CommonActivity.this, RedirectActivity.class));
                    if (position == 8) startActivity(new Intent(CommonActivity.this, TestActivity.class));
                }
            });
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/CookieActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.os.Bundle;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.StringDialogCallback;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.cookie.store.CookieStore;
import com.lzy.okgo.model.Response;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.OnClick;
import okhttp3.Cookie;
import okhttp3.HttpUrl;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class CookieActivity extends BaseDetailActivity {

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_cookie);
        ButterKnife.bind(this);
        setTitle("cookie管理与session保持");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @OnClick(R.id.getCookie)
    public void getCookie(View view) {
        //一般手动取出cookie的目的只是交给 webview 等等,非必要情况不要自己操作
        CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
        HttpUrl httpUrl = HttpUrl.parse(Urls.URL_METHOD);
        List<Cookie> cookies = cookieStore.getCookie(httpUrl);
        showToast(httpUrl.host() + "对应的cookie如下:" + cookies.toString());
    }

    @OnClick(R.id.getAllCookie)
    public void getAllCookie(View view) {
        //一般手动取出cookie的目的只是交给 webview 等等,非必要情况不要自己操作
        CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
        List<Cookie> allCookie = cookieStore.getAllCookie();
        showToast("所有cookie如下:" + allCookie.toString());
    }

    @OnClick(R.id.addCookie)
    public void addCookie(View view) {

        HttpUrl httpUrl = HttpUrl.parse(Urls.URL_METHOD);
        Cookie.Builder builder = new Cookie.Builder();
        Cookie cookie = builder.name("myCookieKey1").value("myCookieValue1").domain(httpUrl.host()).build();
        CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
        cookieStore.saveCookie(httpUrl, cookie);

        showToast("详细添加cookie的代码,请看demo的代码");

        OkGo.<String>post(Urls.URL_TEXT_UPLOAD)//
                .tag(this)//
                .execute(new StringDialogCallback(this) {
                    @Override
                    public void onSuccess(Response<String> response) {
                        handleResponse(response);
                    }

                    @Override
                    public void onError(Response<String> response) {
                        handleError(response);
                    }
                });
    }

    @OnClick(R.id.removeCookie)
    public void removeCookie(View view) {
        HttpUrl httpUrl = HttpUrl.parse(Urls.URL_METHOD);
        CookieStore cookieStore = OkGo.getInstance().getCookieJar().getCookieStore();
        cookieStore.removeCookie(httpUrl);

        showToast("详细移除cookie的代码,请看demo的代码");
    }

    @OnClick(R.id.updateCookie)
    public void updateCookie(View view) {
        showToast("暂时未实现,可以先移除再添加,效果一样");
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/FormUploadActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.content.Intent;
import android.os.Bundle;
import android.text.format.Formatter;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.JsonCallback;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.ServerModel;
import com.lzy.demo.ui.NumberProgressBar;
import com.lzy.demo.utils.GlideImageLoader;
import com.lzy.demo.utils.Urls;
import com.lzy.imagepicker.ImagePicker;
import com.lzy.imagepicker.bean.ImageItem;
import com.lzy.imagepicker.ui.ImageGridActivity;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Progress;
import com.lzy.okgo.model.Response;
import com.lzy.okgo.request.base.Request;

import java.io.File;
import java.text.NumberFormat;
import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class FormUploadActivity extends BaseDetailActivity {

    @Bind(R.id.formUpload) Button btnFormUpload;
    @Bind(R.id.downloadSize) TextView tvDownloadSize;
    @Bind(R.id.tvProgress) TextView tvProgress;
    @Bind(R.id.netSpeed) TextView tvNetSpeed;
    @Bind(R.id.pbProgress) NumberProgressBar pbProgress;
    @Bind(R.id.images) TextView tvImages;

    private ArrayList<ImageItem> imageItems;
    private NumberFormat numberFormat;

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_form_upload);
        ButterKnife.bind(this);
        setTitle("文件上传");

        numberFormat = NumberFormat.getPercentInstance();
        numberFormat.setMinimumFractionDigits(2);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @OnClick(R.id.selectImage)
    public void selectImage(View view) {
        ImagePicker imagePicker = ImagePicker.getInstance();
        imagePicker.setImageLoader(new GlideImageLoader());
        imagePicker.setMultiMode(true);   //多选
        imagePicker.setShowCamera(true);  //显示拍照按钮
        imagePicker.setSelectLimit(9);    //最多选择9张
        imagePicker.setCrop(false);       //不进行裁剪
        Intent intent = new Intent(this, ImageGridActivity.class);
        startActivityForResult(intent, 100);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
            if (data != null && requestCode == 100) {
                imageItems = (ArrayList<ImageItem>) data.getSerializableExtra(ImagePicker.EXTRA_RESULT_ITEMS);
                if (imageItems != null && imageItems.size() > 0) {
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < imageItems.size(); i++) {
                        if (i == imageItems.size() - 1) sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path);
                        else sb.append("图片").append(i + 1).append(" : ").append(imageItems.get(i).path).append("\n");
                    }
                    tvImages.setText(sb.toString());
                } else {
                    tvImages.setText("--");
                }
            } else {
                Toast.makeText(this, "没有选择图片", Toast.LENGTH_SHORT).show();
                tvImages.setText("--");
            }
        }
    }

    @OnClick(R.id.formUpload)
    public void formUpload(View view) {
        ArrayList<File> files = new ArrayList<>();
        if (imageItems != null && imageItems.size() > 0) {
            for (int i = 0; i < imageItems.size(); i++) {
                files.add(new File(imageItems.get(i).path));
            }
        }
        //拼接参数
        OkGo.<LzyResponse<ServerModel>>post(Urls.URL_FORM_UPLOAD)//
                .tag(this)//
                .headers("header1", "headerValue1")//
                .headers("header2", "headerValue2")//
                .params("param1", "paramValue1")//
                .params("param2", "paramValue2")//
//                .params("file1",new File("文件路径"))   //这种方式为一个key,对应一个文件
//                .params("file2",new File("文件路径"))
//                .params("file3",new File("文件路径"))
                .addFileParams("file", files)           // 这种方式为同一个key,上传多个文件
                .execute(new JsonCallback<LzyResponse<ServerModel>>() {
                    @Override
                    public void onStart(Request<LzyResponse<ServerModel>, ? extends Request> request) {
                        btnFormUpload.setText("正在上传中...");
                    }

                    @Override
                    public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                        handleResponse(response);
                        btnFormUpload.setText("上传完成");
                    }

                    @Override
                    public void onError(Response<LzyResponse<ServerModel>> response) {
                        handleError(response);
                        btnFormUpload.setText("上传出错");
                    }

                    @Override
                    public void uploadProgress(Progress progress) {
                        System.out.println("uploadProgress: " + progress);

                        String downloadLength = Formatter.formatFileSize(getApplicationContext(), progress.currentSize);
                        String totalLength = Formatter.formatFileSize(getApplicationContext(), progress.totalSize);
                        tvDownloadSize.setText(downloadLength + "/" + totalLength);
                        String speed = Formatter.formatFileSize(getApplicationContext(), progress.speed);
                        tvNetSpeed.setText(String.format("%s/s", speed));
                        tvProgress.setText(numberFormat.format(progress.fraction));
                        pbProgress.setMax(10000);
                        pbProgress.setProgress((int) (progress.fraction * 10000));
                    }
                });
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/HttpsActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.os.Bundle;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.StringDialogCallback;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class HttpsActivity extends BaseDetailActivity {

    private static final String CER_12306 = "-----BEGIN CERTIFICATE-----\n" +                                                  //
                                            "MIICmjCCAgOgAwIBAgIIbyZr5/jKH6QwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ04xKTAn\n" + //
                                            "BgNVBAoTIFNpbm9yYWlsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRTUkNBMB4X\n" + //
                                            "DTA5MDUyNTA2NTYwMFoXDTI5MDUyMDA2NTYwMFowRzELMAkGA1UEBhMCQ04xKTAnBgNVBAoTIFNp\n" + //
                                            "bm9yYWlsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRTUkNBMIGfMA0GCSqGSIb3\n" + //
                                            "DQEBAQUAA4GNADCBiQKBgQDMpbNeb34p0GvLkZ6t72/OOba4mX2K/eZRWFfnuk8e5jKDH+9BgCb2\n" + //
                                            "9bSotqPqTbxXWPxIOz8EjyUO3bfR5pQ8ovNTOlks2rS5BdMhoi4sUjCKi5ELiqtyww/XgY5iFqv6\n" + //
                                            "D4Pw9QvOUcdRVSbPWo1DwMmH75It6pk/rARIFHEjWwIDAQABo4GOMIGLMB8GA1UdIwQYMBaAFHle\n" + //
                                            "tne34lKDQ+3HUYhMY4UsAENYMAwGA1UdEwQFMAMBAf8wLgYDVR0fBCcwJTAjoCGgH4YdaHR0cDov\n" + //
                                            "LzE5Mi4xNjguOS4xNDkvY3JsMS5jcmwwCwYDVR0PBAQDAgH+MB0GA1UdDgQWBBR5XrZ3t+JSg0Pt\n" + //
                                            "x1GITGOFLABDWDANBgkqhkiG9w0BAQUFAAOBgQDGrAm2U/of1LbOnG2bnnQtgcVaBXiVJF8LKPaV\n" + //
                                            "23XQ96HU8xfgSZMJS6U00WHAI7zp0q208RSUft9wDq9ee///VOhzR6Tebg9QfyPSohkBrhXQenvQ\n" + //
                                            "og555S+C3eJAAVeNCTeMS3N/M5hzBRJAoffn3qoYdAO1Q8bTguOi+2849A==\n" +                 //
                                            "-----END CERTIFICATE-----";

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_https);
        ButterKnife.bind(this);
        setTitle("支持https请求");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @OnClick(R.id.btn_none_https_request)
    public void btn_none_https_request(View view) {
        //CA 认证的证书不需要任何设置,和http请求一样
        OkGo.<String>get("https://github.com/jeasonlzy")//
                .tag(this)//
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new StringDialogCallback(this) {

                    @Override
                    public void onError(Response<String> response) {
                        handleError(response);
                    }

                    @Override
                    public void onSuccess(Response<String> response) {
                        handleResponse(response);
                    }
                });
    }

    @OnClick(R.id.btn_https_request)
    public void btn_https_request(View view) {
        //自签名的证书需要在全局初始化的时候设置,详细看初始化的代码
        OkGo.<String>get("https://kyfw.12306.cn/otn")//
                .tag(this)//
                .headers("Connection", "close")           //如果对于部分自签名的https访问不成功,需要加上该控制头
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new StringDialogCallback(this) {
                    @Override
                    public void onError(Response<String> response) {
                        handleError(response);
                    }

                    @Override
                    public void onSuccess(Response<String> response) {
                        handleResponse(response);
                    }
                });
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/JsonActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.os.Bundle;
import android.view.View;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.DialogCallback;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.ServerModel;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import java.util.List;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class JsonActivity extends BaseDetailActivity {

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_custom_request);
        ButterKnife.bind(this);
        actionBar.setTitle("自动解析JSON对象");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    /**
     * 解析javabean对象
     */
    @OnClick(R.id.requestJson)
    public void requestJson(View view) {
        OkGo.<LzyResponse<ServerModel>>get(Urls.URL_JSONOBJECT)//
                .tag(this)//
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {

                    @Override
                    public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                        handleResponse(response);
                    }

                    @Override
                    public void onError(Response<LzyResponse<ServerModel>> response) {
                        handleError(response);
                    }
                });
    }

    /**
     * 解析集合对象
     */
    @OnClick(R.id.requestJsonArray)
    public void requestJsonArray(View view) {
        OkGo.<LzyResponse<List<ServerModel>>>get(Urls.URL_JSONARRAY)//
                .tag(this)//
                .headers("header1", "headerValue1")//
                .params("param1", "paramValue1")//
                .execute(new DialogCallback<LzyResponse<List<ServerModel>>>(this) {
                    @Override
                    public void onSuccess(Response<LzyResponse<List<ServerModel>>> response) {
                        handleResponse(response);
                    }

                    @Override
                    public void onError(Response<LzyResponse<List<ServerModel>>> response) {
                        handleError(response);
                    }
                });
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/MethodActivity.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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.
 */
package com.lzy.demo.okgo;

import android.graphics.Color;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;

import com.lzy.demo.R;
import com.lzy.demo.base.BaseDetailActivity;
import com.lzy.demo.callback.DialogCallback;
import com.lzy.demo.callback.StringDialogCallback;
import com.lzy.demo.model.LzyResponse;
import com.lzy.demo.model.ServerModel;
import com.lzy.demo.utils.ColorUtils;
import com.lzy.demo.utils.Urls;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/9/11
 * 描    述:
 * 修订历史:
 * ================================================
 */
public class MethodActivity extends BaseDetailActivity implements AdapterView.OnItemClickListener {

    @Bind(R.id.gridView) GridView gridView;

    private String[] methods = {"GET", "HEAD", "OPTIONS", "POST", "PUT", "DELETE", "PATCH", "TRACE"};

    @Override
    protected void onActivityCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_method);
        ButterKnife.bind(this);

        setTitle("请求方法演示");
        gridView.setAdapter(new MyAdapter());
        gridView.setOnItemClickListener(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        //Activity销毁时,取消网络请求
        OkGo.getInstance().cancelTag(this);
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        switch (position) {
            case 0:
                OkGo.<LzyResponse<ServerModel>>get(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 1:
                OkGo.<String>head(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new StringDialogCallback(this) {
                            @Override
                            public void onSuccess(Response<String> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<String> response) {
                                handleError(response);
                            }
                        });
                break;
            case 2:
                OkGo.<LzyResponse<ServerModel>>options(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 3:
                OkGo.<LzyResponse<ServerModel>>post(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .params("param2", "paramValue2")//
                        .params("param3", "paramValue3")//
                        .isMultipart(true)         //强制使用 multipart/form-data 表单上传(只是演示,不需要的话不要设置。默认就是false)
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 4:
                OkGo.<LzyResponse<ServerModel>>put(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 5:
                OkGo.<LzyResponse<ServerModel>>delete(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .upString("这是要上传的数据")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 6:
                OkGo.<LzyResponse<ServerModel>>patch(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .upString("这是要上传的数据")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
            case 7:
                OkGo.<LzyResponse<ServerModel>>trace(Urls.URL_METHOD)//
                        .tag(this)//
                        .headers("header1", "headerValue1")//
                        .params("param1", "paramValue1")//
                        .execute(new DialogCallback<LzyResponse<ServerModel>>(this) {
                            @Override
                            public void onSuccess(Response<LzyResponse<ServerModel>> response) {
                                handleResponse(response);
                            }

                            @Override
                            public void onError(Response<LzyResponse<ServerModel>> response) {
                                handleError(response);
                            }
                        });
                break;
        }
    }

    private class MyAdapter extends BaseAdapter {
        @Override
        public int getCount() {
            return methods.length;
        }

        @Override
        public String getItem(int position) {
            return methods[position];
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = new TextView(getApplicationContext());
            }
            TextView textView = (TextView) convertView;
            textView.setGravity(Gravity.CENTER);
            textView.setHeight(200);
            textView.setText(getItem(position));
            textView.setTextColor(Color.WHITE);
            textView.setTextSize(16);
            textView.setBackgroundColor(ColorUtils.randomColor());
            return textView;
        }
    }
}


================================================
FILE: demo/src/main/java/com/lzy/demo/okgo/OkGoFragment.java
================================================
/*
 * Copyright 2016 jeasonlzy(廖子尧)
 *
 * 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/li
Download .txt
gitextract_01imco5q/

├── .gitignore
├── LICENSE
├── README.md
├── appkey.jks
├── build.gradle
├── demo/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── srca.cer
│           ├── java/
│           │   └── com/
│           │       └── lzy/
│           │           └── demo/
│           │               ├── GApp.java
│           │               ├── MainActivity.java
│           │               ├── PayFragment.java
│           │               ├── WebActivity.java
│           │               ├── base/
│           │               │   ├── BaseActivity.java
│           │               │   ├── BaseDetailActivity.java
│           │               │   ├── BaseFragment.java
│           │               │   ├── BaseRecyclerAdapter.java
│           │               │   ├── BaseRxDetailActivity.java
│           │               │   ├── DividerItemDecoration.java
│           │               │   └── MainFragment.java
│           │               ├── callback/
│           │               │   ├── BitmapDialogCallback.java
│           │               │   ├── DialogCallback.java
│           │               │   ├── EncryptCallback.java
│           │               │   ├── JsonCallback.java
│           │               │   ├── JsonConvert.java
│           │               │   └── StringDialogCallback.java
│           │               ├── model/
│           │               │   ├── ApkModel.java
│           │               │   ├── GankModel.java
│           │               │   ├── GankResponse.java
│           │               │   ├── ItemModel.java
│           │               │   ├── LzyResponse.java
│           │               │   ├── ServerModel.java
│           │               │   └── SimpleResponse.java
│           │               ├── okdownload/
│           │               │   ├── DesActivity.java
│           │               │   ├── DownloadAdapter.java
│           │               │   ├── DownloadAllActivity.java
│           │               │   ├── DownloadFinishActivity.java
│           │               │   ├── DownloadListActivity.java
│           │               │   ├── DownloadingActivity.java
│           │               │   ├── LogDownloadListener.java
│           │               │   └── OkDownloadFragment.java
│           │               ├── okgo/
│           │               │   ├── BitmapRequestActivity.java
│           │               │   ├── CacheActivity.java
│           │               │   ├── CommonActivity.java
│           │               │   ├── CookieActivity.java
│           │               │   ├── FormUploadActivity.java
│           │               │   ├── HttpsActivity.java
│           │               │   ├── JsonActivity.java
│           │               │   ├── MethodActivity.java
│           │               │   ├── OkGoFragment.java
│           │               │   ├── RedirectActivity.java
│           │               │   ├── SimpleDownloadActivity.java
│           │               │   ├── SyncActivity.java
│           │               │   ├── TestActivity.java
│           │               │   └── UpActivity.java
│           │               ├── okrx2/
│           │               │   ├── OkRx2Fragment.java
│           │               │   ├── OkRxFragment.java
│           │               │   ├── RxBitmapActivity.java
│           │               │   ├── RxCacheActivity.java
│           │               │   ├── RxCommonActivity.java
│           │               │   ├── RxFileDownloadActivity.java
│           │               │   ├── RxFormUploadActivity.java
│           │               │   ├── RxRetrofitActivity.java
│           │               │   ├── RxUtils.java
│           │               │   └── ServerApi.java
│           │               ├── okupload/
│           │               │   ├── LogUploadListener.java
│           │               │   ├── OkUploadFragment.java
│           │               │   ├── UploadAdapter.java
│           │               │   ├── UploadAllActivity.java
│           │               │   ├── UploadFinishActivity.java
│           │               │   ├── UploadListActivity.java
│           │               │   └── UploadingActivity.java
│           │               ├── supercache/
│           │               │   ├── NewsAdapter.java
│           │               │   ├── NewsCallback.java
│           │               │   ├── NewsTabFragment.java
│           │               │   └── SuperCacheActivity.java
│           │               ├── ui/
│           │               │   ├── NumberProgressBar.java
│           │               │   ├── ProgressPieView.java
│           │               │   ├── SimpleViewBehavior.java
│           │               │   └── TranslateUpDownBehavior.java
│           │               └── utils/
│           │                   ├── AnimHelper.java
│           │                   ├── ApkUtils.java
│           │                   ├── ColorUtils.java
│           │                   ├── Convert.java
│           │                   ├── GlideImageLoader.java
│           │                   ├── MD5Utils.java
│           │                   ├── PicassoImageLoader.java
│           │                   └── Urls.java
│           └── res/
│               ├── drawable/
│               │   └── progress_bar_states.xml
│               ├── layout/
│               │   ├── activity_base.xml
│               │   ├── activity_bitmap_request.xml
│               │   ├── activity_cache.xml
│               │   ├── activity_cookie.xml
│               │   ├── activity_custom_request.xml
│               │   ├── activity_download_all.xml
│               │   ├── activity_download_details.xml
│               │   ├── activity_download_list.xml
│               │   ├── activity_file_download.xml
│               │   ├── activity_form_upload.xml
│               │   ├── activity_https.xml
│               │   ├── activity_main.xml
│               │   ├── activity_method.xml
│               │   ├── activity_recycler.xml
│               │   ├── activity_redirect.xml
│               │   ├── activity_rx_cache.xml
│               │   ├── activity_rx_common.xml
│               │   ├── activity_rx_file_download.xml
│               │   ├── activity_rx_form_upload.xml
│               │   ├── activity_rx_retrofit.xml
│               │   ├── activity_super_cache.xml
│               │   ├── activity_sync.xml
│               │   ├── activity_test.xml
│               │   ├── activity_up_text.xml
│               │   ├── activity_upload_list.xml
│               │   ├── activity_web.xml
│               │   ├── fragment_pay.xml
│               │   ├── include_data.xml
│               │   ├── item_download_list.xml
│               │   ├── item_download_manager.xml
│               │   ├── item_main_list.xml
│               │   ├── item_main_type.xml
│               │   ├── item_news.xml
│               │   ├── item_no_data.xml
│               │   ├── item_refresh.xml
│               │   └── item_upload_manager.xml
│               └── values/
│                   ├── attrs.xml
│                   ├── colors.xml
│                   ├── dimens.xml
│                   ├── strings.xml
│                   └── styles.xml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── jar/
│   ├── okgo-3.0.4.jar
│   ├── okhttp-3.8.1.jar
│   ├── okio-1.13.0.jar
│   ├── okrx-1.0.2.jar
│   ├── okrx2-2.0.2.jar
│   └── okserver-2.0.5.jar
├── okgo/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okgo/
│                           ├── OkGo.java
│                           ├── adapter/
│                           │   ├── AdapterParam.java
│                           │   ├── CacheCall.java
│                           │   ├── Call.java
│                           │   ├── CallAdapter.java
│                           │   └── DefaultCallAdapter.java
│                           ├── cache/
│                           │   ├── CacheEntity.java
│                           │   ├── CacheMode.java
│                           │   └── policy/
│                           │       ├── BaseCachePolicy.java
│                           │       ├── CachePolicy.java
│                           │       ├── DefaultCachePolicy.java
│                           │       ├── FirstCacheRequestPolicy.java
│                           │       ├── NoCachePolicy.java
│                           │       ├── NoneCacheRequestPolicy.java
│                           │       └── RequestFailedCachePolicy.java
│                           ├── callback/
│                           │   ├── AbsCallback.java
│                           │   ├── BitmapCallback.java
│                           │   ├── Callback.java
│                           │   ├── FileCallback.java
│                           │   └── StringCallback.java
│                           ├── convert/
│                           │   ├── BitmapConvert.java
│                           │   ├── Converter.java
│                           │   ├── FileConvert.java
│                           │   └── StringConvert.java
│                           ├── cookie/
│                           │   ├── CookieJarImpl.java
│                           │   ├── SerializableCookie.java
│                           │   └── store/
│                           │       ├── CookieStore.java
│                           │       ├── DBCookieStore.java
│                           │       ├── MemoryCookieStore.java
│                           │       └── SPCookieStore.java
│                           ├── db/
│                           │   ├── BaseDao.java
│                           │   ├── CacheManager.java
│                           │   ├── ColumnEntity.java
│                           │   ├── CookieManager.java
│                           │   ├── DBHelper.java
│                           │   ├── DBUtils.java
│                           │   ├── DownloadManager.java
│                           │   ├── TableEntity.java
│                           │   └── UploadManager.java
│                           ├── exception/
│                           │   ├── CacheException.java
│                           │   ├── HttpException.java
│                           │   ├── OkGoException.java
│                           │   └── StorageException.java
│                           ├── https/
│                           │   └── HttpsUtils.java
│                           ├── interceptor/
│                           │   └── HttpLoggingInterceptor.java
│                           ├── model/
│                           │   ├── HttpHeaders.java
│                           │   ├── HttpMethod.java
│                           │   ├── HttpParams.java
│                           │   ├── Priority.java
│                           │   ├── Progress.java
│                           │   ├── Response.java
│                           │   └── Result.java
│                           ├── request/
│                           │   ├── DeleteRequest.java
│                           │   ├── GetRequest.java
│                           │   ├── HeadRequest.java
│                           │   ├── OptionsRequest.java
│                           │   ├── PatchRequest.java
│                           │   ├── PostRequest.java
│                           │   ├── PutRequest.java
│                           │   ├── TraceRequest.java
│                           │   └── base/
│                           │       ├── BodyRequest.java
│                           │       ├── HasBody.java
│                           │       ├── NoBodyRequest.java
│                           │       ├── ProgressRequestBody.java
│                           │       └── Request.java
│                           └── utils/
│                               ├── HeaderParser.java
│                               ├── HttpUtils.java
│                               ├── IOUtils.java
│                               └── OkLogger.java
├── okrx/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okrx/
│                           ├── adapter/
│                           │   ├── AnalysisParams.java
│                           │   ├── CompletableResponse.java
│                           │   ├── ObservableBody.java
│                           │   ├── ObservableResponse.java
│                           │   ├── ObservableResult.java
│                           │   ├── SingleBody.java
│                           │   ├── SingleResponse.java
│                           │   └── SingleResult.java
│                           └── subscribe/
│                               ├── BodyOnSubscribe.java
│                               ├── CallArbiter.java
│                               ├── CallEnqueueOnSubscribe.java
│                               ├── CallExecuteOnSubscribe.java
│                               └── ResultOnSubscribe.java
├── okrx2/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okrx2/
│                           ├── adapter/
│                           │   ├── AnalysisParams.java
│                           │   ├── CompletableResponse.java
│                           │   ├── FlowableBody.java
│                           │   ├── FlowableResponse.java
│                           │   ├── FlowableResult.java
│                           │   ├── MaybeBody.java
│                           │   ├── MaybeResponse.java
│                           │   ├── MaybeResult.java
│                           │   ├── ObservableBody.java
│                           │   ├── ObservableResponse.java
│                           │   ├── ObservableResult.java
│                           │   ├── SingleBody.java
│                           │   ├── SingleResponse.java
│                           │   └── SingleResult.java
│                           └── observable/
│                               ├── BodyObservable.java
│                               ├── CallEnqueueObservable.java
│                               ├── CallExecuteObservable.java
│                               └── ResultObservable.java
├── okserver/
│   ├── .gitignore
│   ├── bintray.gradle
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           └── java/
│               └── com/
│                   └── lzy/
│                       └── okserver/
│                           ├── OkDownload.java
│                           ├── OkUpload.java
│                           ├── ProgressListener.java
│                           ├── download/
│                           │   ├── DownloadListener.java
│                           │   ├── DownloadTask.java
│                           │   └── DownloadThreadPool.java
│                           ├── task/
│                           │   ├── PriorityBlockingQueue.java
│                           │   ├── PriorityObject.java
│                           │   ├── PriorityRunnable.java
│                           │   └── XExecutor.java
│                           └── upload/
│                               ├── UploadListener.java
│                               ├── UploadTask.java
│                               └── UploadThreadPool.java
└── settings.gradle
Download .txt
SYMBOL INDEX (1654 symbols across 192 files)

FILE: demo/src/main/java/com/lzy/demo/GApp.java
  class GApp (line 50) | public class GApp extends Application {
    method onCreate (line 52) | @Override
    method initOkGo (line 62) | private void initOkGo() {
    class SafeTrustManager (line 121) | private class SafeTrustManager implements X509TrustManager {
      method checkClientTrusted (line 122) | @Override
      method checkServerTrusted (line 126) | @Override
      method getAcceptedIssuers (line 137) | @Override
    class SafeHostnameVerifier (line 149) | private class SafeHostnameVerifier implements HostnameVerifier {
      method verify (line 150) | @Override

FILE: demo/src/main/java/com/lzy/demo/MainActivity.java
  class MainActivity (line 50) | public class MainActivity extends BaseActivity {
    method onCreate (line 58) | @Override
    method fab (line 76) | @OnClick(R.id.fab)
    method translucentStatusBar (line 81) | @Override
    class MainAdapter (line 86) | private class MainAdapter extends FragmentPagerAdapter {
      method MainAdapter (line 88) | MainAdapter(FragmentManager fm) {
      method getItem (line 92) | @Override
      method getCount (line 97) | @Override
      method getPageTitle (line 102) | @Override

FILE: demo/src/main/java/com/lzy/demo/PayFragment.java
  class PayFragment (line 34) | public class PayFragment extends BaseFragment {
    method initView (line 36) | @Override
    method initData (line 41) | @Override

FILE: demo/src/main/java/com/lzy/demo/WebActivity.java
  class WebActivity (line 41) | public class WebActivity extends BaseActivity {
    method runActivity (line 50) | public static void runActivity(Context context, String title, String u...
    method onCreate (line 57) | @Override

FILE: demo/src/main/java/com/lzy/demo/base/BaseActivity.java
  class BaseActivity (line 49) | public abstract class BaseActivity extends AppCompatActivity {
    method findView (line 51) | @SuppressWarnings("unchecked")
    method onCreate (line 56) | @Override
    method setContentView (line 62) | @Override
    method setContentView (line 68) | @Override
    method setContentView (line 74) | @Override
    method onOptionsItemSelected (line 80) | @Override
    method setStatusBarColor (line 91) | protected int setStatusBarColor() {
    method translucentStatusBar (line 96) | protected boolean translucentStatusBar() {
    method initSystemBarTint (line 101) | protected void initSystemBarTint() {
    method getColorPrimary (line 131) | public int getColorPrimary() {
    method getDarkColorPrimary (line 138) | public int getDarkColorPrimary() {
    method initToolBar (line 145) | public void initToolBar(Toolbar toolbar, boolean homeAsUpEnabled, Stri...
    method initToolBar (line 151) | public void initToolBar(Toolbar toolbar, boolean homeAsUpEnabled, int ...
    method showToast (line 155) | public void showToast(String msg) {
    method showLoading (line 161) | public void showLoading() {
    method dismissLoading (line 171) | public void dismissLoading() {
    method displayImage (line 177) | public void displayImage(String url, ImageView imageView) {

FILE: demo/src/main/java/com/lzy/demo/base/BaseDetailActivity.java
  class BaseDetailActivity (line 48) | public abstract class BaseDetailActivity extends BaseActivity {
    method onCreate (line 57) | @Override
    method onActivityCreate (line 76) | protected abstract void onActivityCreate(Bundle savedInstanceState);
    method setTitle (line 78) | @Override
    method setTitle (line 83) | @Override
    method findViewById (line 88) | @Override
    method clearContentView (line 93) | private void clearContentView() {
    method setContentView (line 97) | @Override
    method setContentView (line 103) | @Override
    method setContentView (line 109) | @Override
    method handleResponse (line 115) | protected <T> void handleResponse(T data) {
    method handleResponse (line 121) | protected <T> void handleResponse(Response<T> response) {
    method handleError (line 192) | protected <T> void handleError() {
    method handleError (line 197) | protected <T> void handleError(Response<T> response) {

FILE: demo/src/main/java/com/lzy/demo/base/BaseFragment.java
  class BaseFragment (line 43) | public abstract class BaseFragment extends Fragment {
    method onCreateView (line 51) | @Override
    method setUserVisibleHint (line 62) | @Override
    method onHiddenChanged (line 78) | @Override
    method onVisible (line 90) | protected void onVisible() {
    method onInvisible (line 94) | protected void onInvisible() {
    method lazyLoad (line 97) | protected void lazyLoad() {
    method initView (line 105) | protected abstract View initView(LayoutInflater inflater, ViewGroup co...
    method initData (line 107) | protected abstract void initData();
    method getTitle (line 109) | public String getTitle() {
    method setTitle (line 113) | public void setTitle(String title) {

FILE: demo/src/main/java/com/lzy/demo/base/BaseRecyclerAdapter.java
  class BaseRecyclerAdapter (line 36) | public abstract class BaseRecyclerAdapter<T, VH extends RecyclerView.Vie...
    method BaseRecyclerAdapter (line 42) | public BaseRecyclerAdapter(Context context) {
    method BaseRecyclerAdapter (line 48) | public BaseRecyclerAdapter(Context context, List<T> datas) {
    method BaseRecyclerAdapter (line 55) | public BaseRecyclerAdapter(Context context, T[] datas) {
    method getItemCount (line 62) | @Override
    method updateItems (line 68) | public void updateItems(List<T> items) {
    method addItem (line 74) | public void addItem(T item) {
    method addItem (line 80) | public void addItem(T item, int position) {
    method addItems (line 87) | public void addItems(List<T> items) {
    method removeItem (line 94) | public void removeItem(int position) {
    method removeItem (line 103) | public void removeItem(T item) {
    method removeAllItems (line 117) | public void removeAllItems() {

FILE: demo/src/main/java/com/lzy/demo/base/BaseRxDetailActivity.java
  class BaseRxDetailActivity (line 30) | public abstract class BaseRxDetailActivity extends BaseDetailActivity {
    method addDisposable (line 34) | public void addDisposable(Disposable disposable) {
    method dispose (line 41) | public void dispose() {

FILE: demo/src/main/java/com/lzy/demo/base/DividerItemDecoration.java
  class DividerItemDecoration (line 36) | public class DividerItemDecoration extends RecyclerView.ItemDecoration {
    method DividerItemDecoration (line 45) | public DividerItemDecoration(Context context, int orientation) {
    method setOrientation (line 52) | public void setOrientation(int orientation) {
    method onDraw (line 59) | @Override
    method drawVertical (line 69) | public void drawVertical(Canvas c, RecyclerView parent) {
    method drawHorizontal (line 84) | public void drawHorizontal(Canvas c, RecyclerView parent) {
    method getItemOffsets (line 99) | @Override

FILE: demo/src/main/java/com/lzy/demo/base/MainFragment.java
  class MainFragment (line 49) | public abstract class MainFragment extends BaseFragment implements Swipe...
    method onAttach (line 57) | @Override
    method initView (line 63) | @Override
    method onRefresh (line 70) | @Override
    method onLoadMoreRequested (line 75) | @Override
    method initData (line 85) | @Override
    method fillData (line 105) | public abstract void fillData(List<ItemModel> items);
    method onItemClick (line 107) | public abstract void onItemClick(int position);
    class MainAdapter (line 109) | private class MainAdapter extends BaseQuickAdapter<ItemModel> {
      method MainAdapter (line 111) | MainAdapter(List<ItemModel> data) {
      method convert (line 115) | @Override
    method setRefreshing (line 128) | public void setRefreshing(final boolean refreshing) {

FILE: demo/src/main/java/com/lzy/demo/callback/BitmapDialogCallback.java
  class BitmapDialogCallback (line 35) | public abstract class BitmapDialogCallback extends BitmapCallback {
    method BitmapDialogCallback (line 39) | public BitmapDialogCallback(Activity activity) {
    method onStart (line 48) | @Override
    method onFinish (line 55) | @Override

FILE: demo/src/main/java/com/lzy/demo/callback/DialogCallback.java
  class DialogCallback (line 33) | public abstract class DialogCallback<T> extends JsonCallback<T> {
    method initDialog (line 37) | private void initDialog(Activity activity) {
    method DialogCallback (line 45) | public DialogCallback(Activity activity) {
    method onStart (line 50) | @Override
    method onFinish (line 57) | @Override

FILE: demo/src/main/java/com/lzy/demo/callback/EncryptCallback.java
  class EncryptCallback (line 38) | public abstract class EncryptCallback<T> extends JsonCallback<T> {
    method onStart (line 43) | @Override
    method sign (line 54) | private void sign(HttpParams params) {
    method getRndStr (line 71) | private String getRndStr(int length) {
    method getSortedMapByKey (line 82) | private Map<String, String> getSortedMapByKey(Map<String, String> map) {

FILE: demo/src/main/java/com/lzy/demo/callback/JsonCallback.java
  class JsonCallback (line 35) | public abstract class JsonCallback<T> extends AbsCallback<T> {
    method JsonCallback (line 40) | public JsonCallback() {
    method JsonCallback (line 43) | public JsonCallback(Type type) {
    method JsonCallback (line 47) | public JsonCallback(Class<T> clazz) {
    method onStart (line 51) | @Override
    method convertResponse (line 69) | @Override

FILE: demo/src/main/java/com/lzy/demo/callback/JsonConvert.java
  class JsonConvert (line 42) | public class JsonConvert<T> implements Converter<T> {
    method JsonConvert (line 47) | public JsonConvert() {
    method JsonConvert (line 50) | public JsonConvert(Type type) {
    method JsonConvert (line 54) | public JsonConvert(Class<T> clazz) {
    method convertResponse (line 63) | @Override
    method parseClass (line 93) | private T parseClass(Response response, Class<?> rawType) throws Excep...
    method parseType (line 115) | private T parseType(Response response, Type type) throws Exception {
    method parseParameterizedType (line 127) | private T parseParameterizedType(Response response, ParameterizedType ...

FILE: demo/src/main/java/com/lzy/demo/callback/StringDialogCallback.java
  class StringDialogCallback (line 34) | public abstract class StringDialogCallback extends StringCallback {
    method StringDialogCallback (line 38) | public StringDialogCallback(Activity activity) {
    method onStart (line 46) | @Override
    method onFinish (line 53) | @Override

FILE: demo/src/main/java/com/lzy/demo/model/ApkModel.java
  class ApkModel (line 30) | public class ApkModel implements Serializable {
    method ApkModel (line 38) | public ApkModel() {

FILE: demo/src/main/java/com/lzy/demo/model/GankModel.java
  class GankModel (line 31) | public class GankModel implements Serializable {

FILE: demo/src/main/java/com/lzy/demo/model/GankResponse.java
  class GankResponse (line 29) | public class GankResponse<T> implements Serializable {

FILE: demo/src/main/java/com/lzy/demo/model/ItemModel.java
  class ItemModel (line 27) | public class ItemModel {
    method ItemModel (line 32) | public ItemModel() {
    method ItemModel (line 35) | public ItemModel(String title, String des) {
    method ItemModel (line 40) | public ItemModel(String title, String des, int type) {

FILE: demo/src/main/java/com/lzy/demo/model/LzyResponse.java
  class LzyResponse (line 29) | public class LzyResponse<T> implements Serializable {
    method toString (line 37) | @Override

FILE: demo/src/main/java/com/lzy/demo/model/ServerModel.java
  class ServerModel (line 29) | public class ServerModel implements Serializable {
    class Author (line 39) | public class Author implements Serializable {
      method toString (line 50) | @Override
    method toString (line 64) | @Override

FILE: demo/src/main/java/com/lzy/demo/model/SimpleResponse.java
  class SimpleResponse (line 29) | public class SimpleResponse implements Serializable {
    method toLzyResponse (line 36) | public LzyResponse toLzyResponse() {

FILE: demo/src/main/java/com/lzy/demo/okdownload/DesActivity.java
  class DesActivity (line 52) | public class DesActivity extends BaseActivity {
    method onCreate (line 69) | @Override
    method refreshUi (line 99) | private void refreshUi(Progress progress) {
    method onDestroy (line 134) | @Override
    method start (line 142) | @OnClick(R.id.start)
    method remove (line 178) | @OnClick(R.id.remove)
    method restart (line 191) | @OnClick(R.id.restart)
    class DesListener (line 196) | private class DesListener extends DownloadListener {
      method DesListener (line 198) | DesListener(String tag) {
      method onStart (line 202) | @Override
      method onProgress (line 206) | @Override
      method onFinish (line 211) | @Override
      method onRemove (line 215) | @Override
      method onError (line 219) | @Override

FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadAdapter.java
  class DownloadAdapter (line 58) | public class DownloadAdapter extends RecyclerView.Adapter<DownloadAdapte...
    method DownloadAdapter (line 70) | public DownloadAdapter(Context context) {
    method updateData (line 77) | public void updateData(int type) {
    method onCreateViewHolder (line 86) | @Override
    method onBindViewHolder (line 92) | @Override
    method unRegister (line 104) | public void unRegister() {
    method createTag (line 111) | private String createTag(DownloadTask task) {
    method getItemCount (line 115) | @Override
    class ViewHolder (line 120) | public class ViewHolder extends RecyclerView.ViewHolder {
      method ViewHolder (line 133) | public ViewHolder(View itemView) {
      method setTask (line 138) | public void setTask(DownloadTask task) {
      method bind (line 142) | public void bind() {
      method refresh (line 154) | public void refresh(Progress progress) {
      method start (line 191) | @OnClick(R.id.start)
      method remove (line 214) | @OnClick(R.id.remove)
      method restart (line 220) | @OnClick(R.id.restart)
      method setTag (line 225) | public void setTag(String tag) {
      method getTag (line 229) | public String getTag() {
    class ListDownloadListener (line 234) | private class ListDownloadListener extends DownloadListener {
      method ListDownloadListener (line 238) | ListDownloadListener(Object tag, ViewHolder holder) {
      method onStart (line 243) | @Override
      method onProgress (line 247) | @Override
      method onError (line 254) | @Override
      method onFinish (line 260) | @Override
      method onRemove (line 266) | @Override

FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadAllActivity.java
  class DownloadAllActivity (line 41) | public class DownloadAllActivity extends BaseActivity implements XExecut...
    method onCreate (line 49) | @Override
    method onAllTaskEnd (line 64) | @Override
    method onDestroy (line 69) | @Override
    method onResume (line 76) | @Override
    method removeAll (line 82) | @OnClick(R.id.removeAll)
    method pauseAll (line 89) | @OnClick(R.id.pauseAll)
    method startAll (line 94) | @OnClick(R.id.startAll)

FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadFinishActivity.java
  class DownloadFinishActivity (line 42) | public class DownloadFinishActivity extends BaseActivity implements XExe...
    method onCreate (line 52) | @Override
    method onAllTaskEnd (line 70) | @Override
    method onDestroy (line 75) | @Override
    method onResume (line 82) | @Override
    method removeAll (line 88) | @OnClick(R.id.removeAll)

FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadListActivity.java
  class DownloadListActivity (line 64) | public class DownloadListActivity extends BaseActivity {
    method onCreate (line 75) | @Override
    method checkSDCardPermission (line 100) | protected void checkSDCardPermission() {
    method onRequestPermissionsResult (line 106) | @Override
    method startAll (line 118) | @OnClick(R.id.startAll)
    method onResume (line 138) | @Override
    class DownloadListAdapter (line 144) | private class DownloadListAdapter extends BaseRecyclerAdapter<ApkModel...
      method DownloadListAdapter (line 146) | DownloadListAdapter(Context context) {
      method onCreateViewHolder (line 150) | @Override
      method onBindViewHolder (line 156) | @Override
    class ViewHolder (line 163) | public class ViewHolder extends RecyclerView.ViewHolder implements Vie...
      method ViewHolder (line 172) | public ViewHolder(View itemView) {
      method bind (line 177) | public void bind(ApkModel apk) {
      method download (line 192) | @OnClick(R.id.download)
      method onClick (line 210) | @Override
    method initData (line 218) | private void initData() {

FILE: demo/src/main/java/com/lzy/demo/okdownload/DownloadingActivity.java
  class DownloadingActivity (line 41) | public class DownloadingActivity extends BaseActivity implements XExecut...
    method onCreate (line 49) | @Override
    method onAllTaskEnd (line 64) | @Override
    method onDestroy (line 69) | @Override
    method onResume (line 76) | @Override
    method removeAll (line 82) | @OnClick(R.id.removeAll)
    method pauseAll (line 89) | @OnClick(R.id.pauseAll)
    method startAll (line 94) | @OnClick(R.id.startAll)

FILE: demo/src/main/java/com/lzy/demo/okdownload/LogDownloadListener.java
  class LogDownloadListener (line 32) | public class LogDownloadListener extends DownloadListener {
    method LogDownloadListener (line 34) | public LogDownloadListener() {
    method onStart (line 38) | @Override
    method onProgress (line 43) | @Override
    method onError (line 48) | @Override
    method onFinish (line 54) | @Override
    method onRemove (line 59) | @Override

FILE: demo/src/main/java/com/lzy/demo/okdownload/OkDownloadFragment.java
  class OkDownloadFragment (line 34) | public class OkDownloadFragment extends MainFragment {
    method fillData (line 36) | @Override
    method onItemClick (line 69) | @Override

FILE: demo/src/main/java/com/lzy/demo/okgo/BitmapRequestActivity.java
  class BitmapRequestActivity (line 43) | public class BitmapRequestActivity extends BaseDetailActivity {
    method onActivityCreate (line 47) | @Override
    method onDestroy (line 54) | @Override
    method requestJson (line 61) | @OnClick(R.id.requestImage)

FILE: demo/src/main/java/com/lzy/demo/okgo/CacheActivity.java
  class CacheActivity (line 50) | public class CacheActivity extends BaseDetailActivity {
    method onActivityCreate (line 52) | @Override
    method onDestroy (line 59) | @Override
    method getAll (line 66) | @SuppressWarnings("unchecked")
    method clear (line 81) | @OnClick(R.id.clear)
    method no_cache (line 88) | @OnClick(R.id.no_cache)
    method cache_default (line 100) | @OnClick(R.id.cache_default)
    method request_failed_read_cache (line 112) | @OnClick(R.id.request_failed_read_cache)
    method if_none_cache_request (line 124) | @OnClick(R.id.if_none_cache_request)
    method first_cache_then_request (line 136) | @OnClick(R.id.first_cache_then_request)
    class CacheCallBack (line 148) | private class CacheCallBack extends DialogCallback<LzyResponse<ServerM...
      method CacheCallBack (line 150) | CacheCallBack(Activity activity) {
      method onSuccess (line 154) | @Override
      method onCacheSuccess (line 161) | @Override
      method onError (line 168) | @Override

FILE: demo/src/main/java/com/lzy/demo/okgo/CommonActivity.java
  class CommonActivity (line 47) | public class CommonActivity extends BaseActivity {
    method onCreate (line 53) | @Override
    method initData (line 67) | private void initData() {
    class MainAdapter (line 80) | private class MainAdapter extends BaseQuickAdapter<ItemModel> {
      method MainAdapter (line 82) | MainAdapter(List<ItemModel> data) {
      method convert (line 86) | @Override

FILE: demo/src/main/java/com/lzy/demo/okgo/CookieActivity.java
  class CookieActivity (line 45) | public class CookieActivity extends BaseDetailActivity {
    method onActivityCreate (line 47) | @Override
    method onDestroy (line 54) | @Override
    method getCookie (line 61) | @OnClick(R.id.getCookie)
    method getAllCookie (line 70) | @OnClick(R.id.getAllCookie)
    method addCookie (line 78) | @OnClick(R.id.addCookie)
    method removeCookie (line 104) | @OnClick(R.id.removeCookie)
    method updateCookie (line 113) | @OnClick(R.id.updateCookie)

FILE: demo/src/main/java/com/lzy/demo/okgo/FormUploadActivity.java
  class FormUploadActivity (line 59) | public class FormUploadActivity extends BaseDetailActivity {
    method onActivityCreate (line 71) | @Override
    method onDestroy (line 81) | @Override
    method selectImage (line 88) | @OnClick(R.id.selectImage)
    method onActivityResult (line 100) | @Override
    method formUpload (line 123) | @OnClick(R.id.formUpload)

FILE: demo/src/main/java/com/lzy/demo/okgo/HttpsActivity.java
  class HttpsActivity (line 39) | public class HttpsActivity extends BaseDetailActivity {
    method onActivityCreate (line 56) | @Override
    method onDestroy (line 63) | @Override
    method btn_none_https_request (line 70) | @OnClick(R.id.btn_none_https_request)
    method btn_https_request (line 91) | @OnClick(R.id.btn_https_request)

FILE: demo/src/main/java/com/lzy/demo/okgo/JsonActivity.java
  class JsonActivity (line 44) | public class JsonActivity extends BaseDetailActivity {
    method onActivityCreate (line 46) | @Override
    method onDestroy (line 53) | @Override
    method requestJson (line 63) | @OnClick(R.id.requestJson)
    method requestJsonArray (line 86) | @OnClick(R.id.requestJsonArray)

FILE: demo/src/main/java/com/lzy/demo/okgo/MethodActivity.java
  class MethodActivity (line 51) | public class MethodActivity extends BaseDetailActivity implements Adapte...
    method onActivityCreate (line 57) | @Override
    method onDestroy (line 67) | @Override
    method onItemClick (line 74) | @Override
    class MyAdapter (line 219) | private class MyAdapter extends BaseAdapter {
      method getCount (line 220) | @Override
      method getItem (line 225) | @Override
      method getItemId (line 230) | @Override
      method getView (line 235) | @Override

FILE: demo/src/main/java/com/lzy/demo/okgo/OkGoFragment.java
  class OkGoFragment (line 35) | public class OkGoFragment extends MainFragment {
    method fillData (line 37) | @Override
    method onItemClick (line 70) | @Override

FILE: demo/src/main/java/com/lzy/demo/okgo/RedirectActivity.java
  class RedirectActivity (line 40) | public class RedirectActivity extends BaseDetailActivity {
    method onActivityCreate (line 42) | @Override
    method onDestroy (line 49) | @Override
    method redirect (line 56) | @OnClick(R.id.redirect)

FILE: demo/src/main/java/com/lzy/demo/okgo/SimpleDownloadActivity.java
  class SimpleDownloadActivity (line 54) | public class SimpleDownloadActivity extends BaseDetailActivity {
    method onActivityCreate (line 65) | @Override
    method checkSDCardPermission (line 78) | protected void checkSDCardPermission() {
    method onRequestPermissionsResult (line 84) | @Override
    method onDestroy (line 96) | @Override
    method fileDownload (line 103) | @OnClick(R.id.fileDownload)

FILE: demo/src/main/java/com/lzy/demo/okgo/SyncActivity.java
  class SyncActivity (line 44) | public class SyncActivity extends BaseDetailActivity {
    class InnerHandler (line 48) | private class InnerHandler extends Handler {
      method handleMessage (line 49) | @Override
    method onActivityCreate (line 57) | @Override
    method onDestroy (line 64) | @Override
    method sync (line 71) | @OnClick(R.id.sync)

FILE: demo/src/main/java/com/lzy/demo/okgo/TestActivity.java
  class TestActivity (line 47) | public class TestActivity extends BaseActivity {
    method onCreate (line 52) | @Override
    method onDestroy (line 59) | @Override
    method btn1 (line 66) | @OnClick(R.id.btn1)
    method btn2 (line 82) | @OnClick(R.id.btn2)
    method btn3 (line 100) | @OnClick(R.id.btn3)

FILE: demo/src/main/java/com/lzy/demo/okgo/UpActivity.java
  class UpActivity (line 57) | public class UpActivity extends BaseDetailActivity {
    method onActivityCreate (line 63) | @Override
    method onDestroy (line 70) | @Override
    method selectImage (line 77) | @OnClick(R.id.selectImage)
    method onActivityResult (line 89) | @Override
    method upJson (line 109) | @OnClick(R.id.upJson)
    method upString (line 137) | @OnClick(R.id.upString)
    method upBytes (line 158) | @OnClick(R.id.upBytes)
    method upFile (line 178) | @OnClick(R.id.upFile)

FILE: demo/src/main/java/com/lzy/demo/okrx2/OkRx2Fragment.java
  class OkRx2Fragment (line 34) | public class OkRx2Fragment extends MainFragment {
    method fillData (line 36) | @Override
    method onItemClick (line 51) | @Override

FILE: demo/src/main/java/com/lzy/demo/okrx2/OkRxFragment.java
  class OkRxFragment (line 32) | public class OkRxFragment extends MainFragment {
    method fillData (line 34) | @Override
    method onItemClick (line 45) | @Override

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxBitmapActivity.java
  class RxBitmapActivity (line 46) | public class RxBitmapActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 50) | @Override
    method onDestroy (line 57) | @Override
    method requestImage (line 64) | @OnClick(R.id.requestImage)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxCacheActivity.java
  class RxCacheActivity (line 48) | public class RxCacheActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 50) | @Override
    method onDestroy (line 57) | @Override
    method cache (line 64) | @OnClick(R.id.cache)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxCommonActivity.java
  class RxCommonActivity (line 57) | public class RxCommonActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 59) | @Override
    method onDestroy (line 66) | @Override
    method commonRequest (line 73) | @OnClick(R.id.commonRequest)
    method jsonRequest (line 113) | @OnClick(R.id.jsonRequest)
    method jsonArrayRequest (line 159) | @OnClick(R.id.jsonArrayRequest)
    method upString (line 204) | @OnClick(R.id.upString)
    method upJson (line 244) | @OnClick(R.id.upJson)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxFileDownloadActivity.java
  class RxFileDownloadActivity (line 65) | public class RxFileDownloadActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 78) | @Override
    method checkSDCardPermission (line 91) | protected void checkSDCardPermission() {
    method onRequestPermissionsResult (line 97) | @Override
    method onDestroy (line 109) | @Override
    method fileDownload1 (line 116) | @OnClick(R.id.fileDownload1)
    method fileDownload2 (line 160) | @OnClick(R.id.fileDownload2)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxFormUploadActivity.java
  class RxFormUploadActivity (line 67) | public class RxFormUploadActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 80) | @Override
    method onDestroy (line 90) | @Override
    method selectImage (line 97) | @OnClick(R.id.selectImage)
    method onActivityResult (line 109) | @Override
    method formUpload1 (line 133) | @OnClick(R.id.formUpload1)
    method formUpload2 (line 188) | @OnClick(R.id.formUpload2)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxRetrofitActivity.java
  class RxRetrofitActivity (line 50) | public class RxRetrofitActivity extends BaseRxDetailActivity {
    method onActivityCreate (line 52) | @Override
    method onDestroy (line 59) | @Override
    method retrofitRequest (line 66) | @OnClick(R.id.retrofitRequest)
    method jsonRequest (line 102) | @OnClick(R.id.jsonRequest)
    method jsonArrayRequest (line 145) | @OnClick(R.id.jsonArrayRequest)

FILE: demo/src/main/java/com/lzy/demo/okrx2/RxUtils.java
  class RxUtils (line 39) | public class RxUtils {
    method request (line 41) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 45) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 49) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 53) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 57) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 61) | public static <T> Observable<T> request(HttpMethod method, String url,...
    method request (line 70) | public static <T> Observable<T> request(HttpMethod method, String url,...

FILE: demo/src/main/java/com/lzy/demo/okrx2/ServerApi.java
  class ServerApi (line 44) | public class ServerApi {
    method getString (line 46) | public static Observable<String> getString(String header, String param) {
    method getData (line 57) | public static <T> Observable<T> getData(Type type, String url, String ...
    method getBitmap (line 68) | public static Observable<Response<Bitmap>> getBitmap(String header, St...
    method getFile (line 76) | public static Observable<Response<File>> getFile(String header, String...

FILE: demo/src/main/java/com/lzy/demo/okupload/LogUploadListener.java
  class LogUploadListener (line 30) | public class LogUploadListener<T> extends UploadListener<T> {
    method LogUploadListener (line 32) | public LogUploadListener() {
    method onStart (line 36) | @Override
    method onProgress (line 41) | @Override
    method onError (line 46) | @Override
    method onFinish (line 52) | @Override
    method onRemove (line 57) | @Override

FILE: demo/src/main/java/com/lzy/demo/okupload/OkUploadFragment.java
  class OkUploadFragment (line 34) | public class OkUploadFragment extends MainFragment {
    method fillData (line 36) | @Override
    method onItemClick (line 68) | @Override

FILE: demo/src/main/java/com/lzy/demo/okupload/UploadAdapter.java
  class UploadAdapter (line 64) | public class UploadAdapter extends RecyclerView.Adapter<UploadAdapter.Vi...
    method UploadAdapter (line 77) | public UploadAdapter(Context context) {
    method updateData (line 84) | public void updateData(int type) {
    method updateData (line 102) | public List<UploadTask<?>> updateData(List<ImageItem> images) {
    method onCreateViewHolder (line 128) | @Override
    method onBindViewHolder (line 134) | @Override
    method unRegister (line 147) | public void unRegister() {
    method createTag (line 154) | private String createTag(UploadTask task) {
    method getItemCount (line 158) | @Override
    class ViewHolder (line 163) | public class ViewHolder extends RecyclerView.ViewHolder {
      method ViewHolder (line 176) | public ViewHolder(View itemView) {
      method setTask (line 181) | public void setTask(UploadTask<?> task) {
      method bind (line 185) | public void bind() {
      method refresh (line 193) | public void refresh(Progress progress) {
      method upload (line 230) | @OnClick(R.id.upload)
      method remove (line 248) | @OnClick(R.id.remove)
      method restart (line 268) | @OnClick(R.id.restart)
      method setTag (line 273) | public void setTag(String tag) {
      method getTag (line 277) | public String getTag() {
    class ListUploadListener (line 282) | private class ListUploadListener extends UploadListener<String> {
      method ListUploadListener (line 286) | ListUploadListener(Object tag, ViewHolder holder) {
      method onStart (line 291) | @Override
      method onProgress (line 295) | @Override
      method onError (line 302) | @Override
      method onFinish (line 308) | @Override
      method onRemove (line 314) | @Override

FILE: demo/src/main/java/com/lzy/demo/okupload/UploadAllActivity.java
  class UploadAllActivity (line 42) | public class UploadAllActivity extends BaseActivity implements XExecutor...
    method onCreate (line 53) | @Override
    method onDestroy (line 74) | @Override
    method onAllTaskEnd (line 81) | @Override
    method deleteAll (line 86) | @OnClick(R.id.deleteAll)

FILE: demo/src/main/java/com/lzy/demo/okupload/UploadFinishActivity.java
  class UploadFinishActivity (line 41) | public class UploadFinishActivity extends BaseActivity implements XExecu...
    method onCreate (line 51) | @Override
    method onDestroy (line 71) | @Override
    method onAllTaskEnd (line 78) | @Override

FILE: demo/src/main/java/com/lzy/demo/okupload/UploadListActivity.java
  class UploadListActivity (line 49) | public class UploadListActivity extends BaseActivity implements XExecuto...
    method onCreate (line 58) | @Override
    method onDestroy (line 74) | @Override
    method onAllTaskEnd (line 81) | @Override
    method select (line 86) | @OnClick(R.id.select)
    method upload (line 97) | @OnClick(R.id.upload)
    method onActivityResult (line 108) | @Override

FILE: demo/src/main/java/com/lzy/demo/okupload/UploadingActivity.java
  class UploadingActivity (line 41) | public class UploadingActivity extends BaseActivity implements XExecutor...
    method onCreate (line 51) | @Override
    method onDestroy (line 71) | @Override
    method onAllTaskEnd (line 78) | @Override

FILE: demo/src/main/java/com/lzy/demo/supercache/NewsAdapter.java
  class NewsAdapter (line 41) | public class NewsAdapter extends BaseQuickAdapter<GankModel> {
    method NewsAdapter (line 43) | public NewsAdapter(List<GankModel> data) {
    method convert (line 47) | @Override

FILE: demo/src/main/java/com/lzy/demo/supercache/NewsCallback.java
  class NewsCallback (line 37) | public abstract class NewsCallback<T> extends AbsCallback<T> {
    method convertResponse (line 43) | @Override

FILE: demo/src/main/java/com/lzy/demo/supercache/NewsTabFragment.java
  class NewsTabFragment (line 54) | public class NewsTabFragment extends BaseFragment implements SwipeRefres...
    method newInstance (line 67) | public static NewsTabFragment newInstance() {
    method onAttach (line 71) | @Override
    method initView (line 77) | @Override
    method initData (line 84) | @Override
    method onRefresh (line 104) | @Override
    method onLoadMoreRequested (line 146) | @Override
    method showToast (line 175) | public void showToast(String msg) {
    method setRefreshing (line 179) | public void setRefreshing(final boolean refreshing) {

FILE: demo/src/main/java/com/lzy/demo/supercache/SuperCacheActivity.java
  class SuperCacheActivity (line 48) | public class SuperCacheActivity extends BaseActivity {
    method onCreate (line 54) | @Override
    method fab (line 78) | @OnClick(R.id.fab)
    class MyPagerAdapter (line 83) | public class MyPagerAdapter extends FragmentPagerAdapter {
      method MyPagerAdapter (line 87) | public MyPagerAdapter(FragmentManager fm, List<NewsTabFragment> frag...
      method getPageTitle (line 92) | @Override
      method getItem (line 97) | @Override
      method getCount (line 102) | @Override

FILE: demo/src/main/java/com/lzy/demo/ui/NumberProgressBar.java
  class NumberProgressBar (line 40) | public class NumberProgressBar extends View {
    type OnProgressBarListener (line 42) | public interface OnProgressBarListener {
      method onProgressChange (line 44) | void onProgressChange(int current, int max);
    type ProgressTextVisibility (line 181) | public enum ProgressTextVisibility {
    method NumberProgressBar (line 185) | public NumberProgressBar(Context context) {
    method NumberProgressBar (line 189) | public NumberProgressBar(Context context, AttributeSet attrs) {
    method NumberProgressBar (line 193) | public NumberProgressBar(Context context, AttributeSet attrs, int defS...
    method getSuggestedMinimumWidth (line 225) | @Override
    method getSuggestedMinimumHeight (line 230) | @Override
    method onMeasure (line 235) | @Override
    method measure (line 240) | private int measure(int measureSpec, boolean isWidth) {
    method onDraw (line 261) | @Override
    method initializePainters (line 280) | private void initializePainters() {
    method calculateDrawRectFWithoutProgressText (line 292) | private void calculateDrawRectFWithoutProgressText() {
    method calculateDrawRectF (line 304) | private void calculateDrawRectF() {
    method getTextColor (line 346) | public int getTextColor() {
    method getProgressTextSize (line 355) | public float getProgressTextSize() {
    method getUnreachedBarColor (line 359) | public int getUnreachedBarColor() {
    method getReachedBarColor (line 363) | public int getReachedBarColor() {
    method getProgress (line 367) | public int getProgress() {
    method getMax (line 371) | public int getMax() {
    method getReachedBarHeight (line 375) | public float getReachedBarHeight() {
    method getUnreachedBarHeight (line 379) | public float getUnreachedBarHeight() {
    method setProgressTextSize (line 383) | public void setProgressTextSize(float textSize) {
    method setProgressTextColor (line 389) | public void setProgressTextColor(int textColor) {
    method setUnreachedBarColor (line 395) | public void setUnreachedBarColor(int barColor) {
    method setReachedBarColor (line 401) | public void setReachedBarColor(int progressColor) {
    method setReachedBarHeight (line 407) | public void setReachedBarHeight(float height) {
    method setUnreachedBarHeight (line 411) | public void setUnreachedBarHeight(float height) {
    method setMax (line 415) | public void setMax(int maxProgress) {
    method setSuffix (line 422) | public void setSuffix(String suffix) {
    method getSuffix (line 430) | public String getSuffix() {
    method setPrefix (line 434) | public void setPrefix(String prefix) {
    method getPrefix (line 441) | public String getPrefix() {
    method incrementProgressBy (line 445) | public void incrementProgressBy(int by) {
    method setProgress (line 455) | public void setProgress(int progress) {
    method onSaveInstanceState (line 462) | @Override
    method onRestoreInstanceState (line 480) | @Override
    method dp2px (line 502) | public float dp2px(float dp) {
    method sp2px (line 507) | public float sp2px(float sp) {
    method setProgressTextVisibility (line 512) | public void setProgressTextVisibility(ProgressTextVisibility visibilit...
    method getProgressTextVisibility (line 517) | public boolean getProgressTextVisibility() {
    method setOnProgressBarListener (line 521) | public void setOnProgressBarListener(OnProgressBarListener listener) {

FILE: demo/src/main/java/com/lzy/demo/ui/ProgressPieView.java
  class ProgressPieView (line 48) | public class ProgressPieView extends View {
    type OnProgressListener (line 50) | public interface OnProgressListener {
      method onProgressChanged (line 51) | public void onProgressChanged(int progress, int max);
      method onProgressCompleted (line 53) | public void onProgressCompleted();
    method ProgressPieView (line 106) | public ProgressPieView(Context context) {
    method ProgressPieView (line 110) | public ProgressPieView(Context context, AttributeSet attrs) {
    method ProgressPieView (line 114) | public ProgressPieView(Context context, AttributeSet attrs, int defSty...
    method init (line 119) | private void init(Context context, AttributeSet attrs) {
    method onMeasure (line 177) | @Override
    method onDraw (line 188) | @Override
    method getMax (line 258) | public int getMax() {
    method setMax (line 265) | public void setMax(int max) {
    method setAnimationSpeed (line 276) | public void setAnimationSpeed(int animationSpeed) {
    method getAnimationSpeed (line 283) | public int getAnimationSpeed() {
    method animateProgressFill (line 290) | public void animateProgressFill() {
    method animateProgressFill (line 302) | public void animateProgressFill(int animateTo) {
    method stopAnimating (line 315) | public void stopAnimating() {
    method getProgress (line 324) | public int getProgress() {
    method setProgress (line 331) | public void setProgress(int progress) {
    method getStartAngle (line 349) | public int getStartAngle() {
    method setStartAngle (line 358) | public void setStartAngle(int startAngle) {
    method isInverted (line 365) | public boolean isInverted() {
    method setInverted (line 374) | public void setInverted(boolean inverted) {
    method isCounterclockwise (line 381) | public boolean isCounterclockwise() {
    method setCounterclockwise (line 390) | public void setCounterclockwise(boolean counterclockwise) {
    method getProgressColor (line 397) | public int getProgressColor() {
    method setProgressColor (line 406) | public void setProgressColor(int color) {
    method getBackgroundColor (line 414) | public int getBackgroundColor() {
    method setBackgroundColor (line 423) | public void setBackgroundColor(int color) {
    method getTextColor (line 431) | public int getTextColor() {
    method setTextColor (line 440) | public void setTextColor(int color) {
    method getTextSize (line 448) | public float getTextSize() {
    method setTextSize (line 457) | public void setTextSize(int sizeSp) {
    method getText (line 466) | public String getText() {
    method setText (line 475) | public void setText(String text) {
    method getTypeface (line 483) | public String getTypeface() {
    method setTypeface (line 493) | public void setTypeface(String typeface) {
    method isTextShowing (line 501) | public boolean isTextShowing() {
    method setShowText (line 510) | public void setShowText(boolean showText) {
    method getStrokeColor (line 518) | public int getStrokeColor() {
    method setStrokeColor (line 527) | public void setStrokeColor(int color) {
    method getStrokeWidth (line 535) | public float getStrokeWidth() {
    method setStrokeWidth (line 544) | public void setStrokeWidth(int widthDp) {
    method isStrokeShowing (line 553) | public boolean isStrokeShowing() {
    method setShowStroke (line 562) | public void setShowStroke(boolean showStroke) {
    method getImageDrawable (line 570) | public Drawable getImageDrawable() {
    method setImageDrawable (line 579) | public void setImageDrawable(Drawable image) {
    method setImageResource (line 589) | public void setImageResource(int resId) {
    method isImageShowing (line 599) | public boolean isImageShowing() {
    method setShowImage (line 608) | public void setShowImage(boolean showImage) {
    method getProgressFillType (line 616) | public int getProgressFillType() {
    method setProgressFillType (line 625) | public void setProgressFillType(int fillType) {
    method setOnProgressListener (line 634) | public void setOnProgressListener(OnProgressListener listener) {
    class AnimationHandler (line 641) | private class AnimationHandler extends Handler {
      method setAnimateTo (line 645) | public void setAnimateTo(int animateTo) {
      method handleMessage (line 649) | @Override

FILE: demo/src/main/java/com/lzy/demo/ui/SimpleViewBehavior.java
  class SimpleViewBehavior (line 41) | @SuppressWarnings("unused")
    method SimpleViewBehavior (line 84) | public SimpleViewBehavior(Context context, AttributeSet attrs) {
    method prepare (line 106) | private void prepare(CoordinatorLayout parent, View child, View depend...
    method layoutDependsOn (line 142) | @Override
    method onDependentViewChanged (line 147) | @Override
    method onMeasureChild (line 159) | @Override
    method onLayoutChild (line 169) | @Override
    method updateView (line 176) | public void updateView(View child, View dependency) {
    method updateViewWithPercent (line 210) | public void updateViewWithPercent(View child, float percent) {
    class BehaviorAnimation (line 247) | private static class BehaviorAnimation extends Animation {
      method BehaviorAnimation (line 251) | public BehaviorAnimation(Transformation transformation) {
      method applyTransformation (line 257) | @Override
    method floatEvaluator (line 264) | public static float floatEvaluator(float originalSize, float finalSize...
    method scaleEvaluator (line 268) | public static float scaleEvaluator(float originalSize, float finalSize...
    method argbEvaluator (line 273) | public static int argbEvaluator(int startColor, int endColor, float pe...
    method getStatusBarHeight (line 291) | private static int getStatusBarHeight(Context context) {

FILE: demo/src/main/java/com/lzy/demo/ui/TranslateUpDownBehavior.java
  class TranslateUpDownBehavior (line 38) | @SuppressWarnings("unused")
    method TranslateUpDownBehavior (line 44) | public TranslateUpDownBehavior(Context context, AttributeSet attrs) {
    method form (line 48) | public static TranslateUpDownBehavior form(View view) {
    method onStartNestedScroll (line 60) | @Override
    method onNestedScroll (line 65) | @Override
    class MyViewPropertyAnimatorListener (line 83) | private class MyViewPropertyAnimatorListener implements ViewPropertyAn...
      method onAnimationStart (line 85) | @Override
      method onAnimationEnd (line 90) | @Override
      method onAnimationCancel (line 95) | @Override
    method setOnStateChangeListener (line 101) | public void setOnStateChangeListener(OnStateChangeListener listener) {
    type OnStateChangeListener (line 105) | public interface OnStateChangeListener {
      method onChange (line 106) | void onChange(boolean isUp);

FILE: demo/src/main/java/com/lzy/demo/utils/AnimHelper.java
  class AnimHelper (line 35) | public class AnimHelper {
    method AnimHelper (line 37) | private AnimHelper() {
    method scaleShow (line 44) | public static void scaleShow(View view, ViewPropertyAnimatorListener l...
    method scaleHide (line 48) | public static void scaleHide(View view, ViewPropertyAnimatorListener l...
    method alphaShow (line 52) | public static void alphaShow(View view, ViewPropertyAnimatorListener l...
    method alphaHide (line 56) | public static void alphaHide(View view, ViewPropertyAnimatorListener l...
    method translateUp (line 60) | public static void translateUp(View view, ViewPropertyAnimatorListener...
    method translateDown (line 64) | public static void translateDown(View view, ViewPropertyAnimatorListen...
    method floatEvaluator (line 72) | public static float floatEvaluator(float originalSize, float finalSize...
    method argbEvaluator (line 76) | public static int argbEvaluator(int startColor, int endColor, float pe...
    method scaleEvaluator (line 93) | public static float scaleEvaluator(float originalSize, float finalSize...
    method getStatusBarHeight (line 99) | public static int getStatusBarHeight(Context context) {

FILE: demo/src/main/java/com/lzy/demo/utils/ApkUtils.java
  class ApkUtils (line 42) | public class ApkUtils {
    method install (line 45) | public static void install(Context context, File uriFile) {
    method uninstall (line 53) | public static void uninstall(Context context, String packageName) {
    method isAvailable (line 63) | public static boolean isAvailable(Context context, String packageName) {
    method isAvailable (line 82) | public static boolean isAvailable(Context context, File file) {
    method getPackageName (line 87) | public static String getPackageName(Context context, String filePath) {
    method getChannelFromApk (line 98) | public static String getChannelFromApk(Context context, String channel...

FILE: demo/src/main/java/com/lzy/demo/utils/ColorUtils.java
  class ColorUtils (line 30) | public class ColorUtils {
    method randomColor (line 32) | public static int randomColor() {

FILE: demo/src/main/java/com/lzy/demo/utils/Convert.java
  class Convert (line 38) | public class Convert {
    method create (line 40) | private static Gson create() {
    class GsonHolder (line 44) | private static class GsonHolder {
    method fromJson (line 48) | public static <T> T fromJson(String json, Class<T> type) throws JsonIO...
    method fromJson (line 52) | public static <T> T fromJson(String json, Type type) {
    method fromJson (line 56) | public static <T> T fromJson(JsonReader reader, Type typeOfT) throws J...
    method fromJson (line 60) | public static <T> T fromJson(Reader json, Class<T> classOfT) throws Js...
    method fromJson (line 64) | public static <T> T fromJson(Reader json, Type typeOfT) throws JsonIOE...
    method toJson (line 68) | public static String toJson(Object src) {
    method toJson (line 72) | public static String toJson(Object src, Type typeOfSrc) {
    method formatJson (line 76) | public static String formatJson(String json) {
    method formatJson (line 86) | public static String formatJson(Object src) {

FILE: demo/src/main/java/com/lzy/demo/utils/GlideImageLoader.java
  class GlideImageLoader (line 40) | public class GlideImageLoader implements ImageLoader, NineGridView.Image...
    method onDisplayImage (line 41) | @Override
    method getCacheImage (line 50) | @Override
    method displayImage (line 55) | @Override
    method clearMemoryCache (line 64) | @Override

FILE: demo/src/main/java/com/lzy/demo/utils/MD5Utils.java
  class MD5Utils (line 32) | public class MD5Utils {
    method MD5Utils (line 34) | private MD5Utils() {
    method encode (line 40) | public static String encode(String str) {
    method encode (line 59) | public static String encode(File file) {

FILE: demo/src/main/java/com/lzy/demo/utils/PicassoImageLoader.java
  class PicassoImageLoader (line 40) | public class PicassoImageLoader implements ImageLoader, NineGridView.Ima...
    method displayImage (line 42) | @Override
    method clearMemoryCache (line 51) | @Override
    method onDisplayImage (line 55) | @Override
    method getCacheImage (line 63) | @Override

FILE: demo/src/main/java/com/lzy/demo/utils/Urls.java
  class Urls (line 27) | public class Urls {

FILE: okgo/src/main/java/com/lzy/okgo/OkGo.java
  class OkGo (line 55) | public class OkGo {
    method OkGo (line 68) | private OkGo() {
    method getInstance (line 90) | public static OkGo getInstance() {
    class OkGoHolder (line 94) | private static class OkGoHolder {
    method get (line 99) | public static <T> GetRequest<T> get(String url) {
    method post (line 104) | public static <T> PostRequest<T> post(String url) {
    method put (line 109) | public static <T> PutRequest<T> put(String url) {
    method head (line 114) | public static <T> HeadRequest<T> head(String url) {
    method delete (line 119) | public static <T> DeleteRequest<T> delete(String url) {
    method options (line 124) | public static <T> OptionsRequest<T> options(String url) {
    method patch (line 129) | public static <T> PatchRequest<T> patch(String url) {
    method trace (line 134) | public static <T> TraceRequest<T> trace(String url) {
    method init (line 139) | public OkGo init(Application app) {
    method getContext (line 145) | public Context getContext() {
    method getDelivery (line 150) | public Handler getDelivery() {
    method getOkHttpClient (line 154) | public OkHttpClient getOkHttpClient() {
    method setOkHttpClient (line 160) | public OkGo setOkHttpClient(OkHttpClient okHttpClient) {
    method getCookieJar (line 167) | public CookieJarImpl getCookieJar() {
    method setRetryCount (line 172) | public OkGo setRetryCount(int retryCount) {
    method getRetryCount (line 179) | public int getRetryCount() {
    method setCacheMode (line 184) | public OkGo setCacheMode(CacheMode cacheMode) {
    method getCacheMode (line 190) | public CacheMode getCacheMode() {
    method setCacheTime (line 195) | public OkGo setCacheTime(long cacheTime) {
    method getCacheTime (line 202) | public long getCacheTime() {
    method getCommonParams (line 207) | public HttpParams getCommonParams() {
    method addCommonParams (line 212) | public OkGo addCommonParams(HttpParams commonParams) {
    method getCommonHeaders (line 219) | public HttpHeaders getCommonHeaders() {
    method addCommonHeaders (line 224) | public OkGo addCommonHeaders(HttpHeaders commonHeaders) {
    method cancelTag (line 231) | public void cancelTag(Object tag) {
    method cancelTag (line 246) | public static void cancelTag(OkHttpClient client, Object tag) {
    method cancelAll (line 261) | public void cancelAll() {
    method cancelAll (line 271) | public static void cancelAll(OkHttpClient client) {

FILE: okgo/src/main/java/com/lzy/okgo/adapter/AdapterParam.java
  class AdapterParam (line 27) | public class AdapterParam {
    method AdapterParam (line 30) | public AdapterParam() {

FILE: okgo/src/main/java/com/lzy/okgo/adapter/CacheCall.java
  class CacheCall (line 39) | public class CacheCall<T> implements Call<T> {
    method CacheCall (line 44) | public CacheCall(Request<T, ? extends Request> request) {
    method execute (line 49) | @Override
    method execute (line 55) | @Override
    method preparePolicy (line 63) | private CachePolicy<T> preparePolicy() {
    method isExecuted (line 88) | @Override
    method cancel (line 93) | @Override
    method isCanceled (line 98) | @Override
    method clone (line 103) | @SuppressWarnings("CloneDoesntCallSuperClone")
    method getRequest (line 109) | public Request getRequest() {

FILE: okgo/src/main/java/com/lzy/okgo/adapter/Call.java
  type Call (line 31) | public interface Call<T> {
    method execute (line 33) | Response<T> execute() throws Exception;
    method execute (line 36) | void execute(Callback<T> callback);
    method isExecuted (line 39) | boolean isExecuted();
    method cancel (line 42) | void cancel();
    method isCanceled (line 45) | boolean isCanceled();
    method clone (line 47) | Call<T> clone();
    method getRequest (line 49) | Request getRequest();

FILE: okgo/src/main/java/com/lzy/okgo/adapter/CallAdapter.java
  type CallAdapter (line 27) | public interface CallAdapter<T, R> {
    method adapt (line 30) | R adapt(Call<T> call, AdapterParam param);

FILE: okgo/src/main/java/com/lzy/okgo/adapter/DefaultCallAdapter.java
  class DefaultCallAdapter (line 27) | public class DefaultCallAdapter<T> implements CallAdapter<T, Call<T>> {
    method adapt (line 29) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/CacheEntity.java
  class CacheEntity (line 35) | public class CacheEntity<T> implements Serializable {
    method getKey (line 52) | public String getKey() {
    method setKey (line 56) | public void setKey(String key) {
    method getResponseHeaders (line 60) | public HttpHeaders getResponseHeaders() {
    method setResponseHeaders (line 64) | public void setResponseHeaders(HttpHeaders responseHeaders) {
    method getData (line 68) | public T getData() {
    method setData (line 72) | public void setData(T data) {
    method getLocalExpire (line 76) | public long getLocalExpire() {
    method setLocalExpire (line 80) | public void setLocalExpire(long localExpire) {
    method isExpire (line 84) | public boolean isExpire() {
    method setExpire (line 88) | public void setExpire(boolean expire) {
    method checkExpire (line 97) | public boolean checkExpire(CacheMode cacheMode, long cacheTime, long b...
    method getContentValues (line 104) | public static <T> ContentValues getContentValues(CacheEntity<T> cacheE...
    method parseCursorToBean (line 113) | public static <T> CacheEntity<T> parseCursorToBean(Cursor cursor) {
    method toString (line 123) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/CacheMode.java
  type CacheMode (line 27) | public enum CacheMode {

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/BaseCachePolicy.java
  class BaseCachePolicy (line 46) | public abstract class BaseCachePolicy<T> implements CachePolicy<T> {
    method BaseCachePolicy (line 56) | public BaseCachePolicy(Request<T, ? extends Request> request) {
    method onAnalysisResponse (line 60) | @Override
    method prepareCache (line 65) | @Override
    method prepareRawCall (line 91) | @Override
    method requestNetworkSync (line 100) | protected Response<T> requestNetworkSync() {
    method requestNetworkAsync (line 128) | protected void requestNetworkAsync() {
    method saveCache (line 182) | private void saveCache(Headers headers, T data) {
    method runOnUiThread (line 196) | protected void runOnUiThread(Runnable run) {
    method isExecuted (line 200) | @Override
    method cancel (line 205) | @Override
    method isCanceled (line 213) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/CachePolicy.java
  type CachePolicy (line 31) | public interface CachePolicy<T> {
    method onSuccess (line 38) | void onSuccess(Response<T> success);
    method onError (line 45) | void onError(Response<T> error);
    method onAnalysisResponse (line 54) | boolean onAnalysisResponse(okhttp3.Call call, okhttp3.Response response);
    method prepareCache (line 61) | CacheEntity<T> prepareCache();
    method prepareRawCall (line 68) | okhttp3.Call prepareRawCall() throws Throwable;
    method requestSync (line 76) | Response<T> requestSync(CacheEntity<T> cacheEntity);
    method requestAsync (line 84) | void requestAsync(CacheEntity<T> cacheEntity, Callback<T> callback);
    method isExecuted (line 91) | boolean isExecuted();
    method cancel (line 96) | void cancel();
    method isCanceled (line 103) | boolean isCanceled();

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/DefaultCachePolicy.java
  class DefaultCachePolicy (line 35) | public class DefaultCachePolicy<T> extends BaseCachePolicy<T> {
    method DefaultCachePolicy (line 37) | public DefaultCachePolicy(Request<T, ? extends Request> request) {
    method onSuccess (line 41) | @Override
    method onError (line 52) | @Override
    method onAnalysisResponse (line 63) | @Override
    method requestSync (line 89) | @Override
    method requestAsync (line 108) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/FirstCacheRequestPolicy.java
  class FirstCacheRequestPolicy (line 32) | public class FirstCacheRequestPolicy<T> extends BaseCachePolicy<T> {
    method FirstCacheRequestPolicy (line 33) | public FirstCacheRequestPolicy(Request<T, ? extends Request> request) {
    method onSuccess (line 37) | @Override
    method onError (line 48) | @Override
    method requestSync (line 59) | @Override
    method requestAsync (line 78) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/NoCachePolicy.java
  class NoCachePolicy (line 32) | public class NoCachePolicy<T> extends BaseCachePolicy<T> {
    method NoCachePolicy (line 34) | public NoCachePolicy(Request<T, ? extends Request> request) {
    method onSuccess (line 38) | @Override
    method onError (line 49) | @Override
    method requestSync (line 60) | @Override
    method requestAsync (line 70) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/NoneCacheRequestPolicy.java
  class NoneCacheRequestPolicy (line 32) | public class NoneCacheRequestPolicy<T> extends BaseCachePolicy<T> {
    method NoneCacheRequestPolicy (line 34) | public NoneCacheRequestPolicy(Request<T, ? extends Request> request) {
    method onSuccess (line 38) | @Override
    method onError (line 49) | @Override
    method requestSync (line 60) | @Override
    method requestAsync (line 77) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cache/policy/RequestFailedCachePolicy.java
  class RequestFailedCachePolicy (line 32) | public class RequestFailedCachePolicy<T> extends BaseCachePolicy<T> {
    method RequestFailedCachePolicy (line 34) | public RequestFailedCachePolicy(Request<T, ? extends Request> request) {
    method onSuccess (line 38) | @Override
    method onError (line 49) | @Override
    method requestSync (line 72) | @Override
    method requestAsync (line 86) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/callback/AbsCallback.java
  class AbsCallback (line 32) | public abstract class AbsCallback<T> implements Callback<T> {
    method onStart (line 34) | @Override
    method onCacheSuccess (line 38) | @Override
    method onError (line 42) | @Override
    method onFinish (line 47) | @Override
    method uploadProgress (line 51) | @Override
    method downloadProgress (line 55) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/callback/BitmapCallback.java
  class BitmapCallback (line 34) | public abstract class BitmapCallback extends AbsCallback<Bitmap> {
    method BitmapCallback (line 38) | public BitmapCallback() {
    method BitmapCallback (line 42) | public BitmapCallback(int maxWidth, int maxHeight) {
    method BitmapCallback (line 46) | public BitmapCallback(int maxWidth, int maxHeight, Bitmap.Config decod...
    method convertResponse (line 50) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/callback/Callback.java
  type Callback (line 54) | public interface Callback<T> extends Converter<T> {
    method onStart (line 57) | void onStart(Request<T, ? extends Request> request);
    method onSuccess (line 60) | void onSuccess(Response<T> response);
    method onCacheSuccess (line 63) | void onCacheSuccess(Response<T> response);
    method onError (line 66) | void onError(Response<T> response);
    method onFinish (line 69) | void onFinish();
    method uploadProgress (line 72) | void uploadProgress(Progress progress);
    method downloadProgress (line 75) | void downloadProgress(Progress progress);

FILE: okgo/src/main/java/com/lzy/okgo/callback/FileCallback.java
  class FileCallback (line 33) | public abstract class FileCallback extends AbsCallback<File> {
    method FileCallback (line 37) | public FileCallback() {
    method FileCallback (line 41) | public FileCallback(String destFileName) {
    method FileCallback (line 45) | public FileCallback(String destFileDir, String destFileName) {
    method convertResponse (line 50) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/callback/StringCallback.java
  class StringCallback (line 31) | public abstract class StringCallback extends AbsCallback<String> {
    method StringCallback (line 35) | public StringCallback() {
    method convertResponse (line 39) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/convert/BitmapConvert.java
  class BitmapConvert (line 34) | public class BitmapConvert implements Converter<Bitmap> {
    method BitmapConvert (line 41) | public BitmapConvert() {
    method BitmapConvert (line 45) | public BitmapConvert(int maxWidth, int maxHeight) {
    method BitmapConvert (line 49) | public BitmapConvert(int maxWidth, int maxHeight, Bitmap.Config decode...
    method convertResponse (line 56) | @Override
    method parse (line 63) | private Bitmap parse(byte[] byteArray) throws OutOfMemoryError {
    method getResizedDimension (line 92) | private static int getResizedDimension(int maxPrimary, int maxSecondar...
    method findBestSampleSize (line 135) | private static int findBestSampleSize(int actualWidth, int actualHeigh...

FILE: okgo/src/main/java/com/lzy/okgo/convert/Converter.java
  type Converter (line 29) | public interface Converter<T> {
    method convertResponse (line 38) | T convertResponse(Response response) throws Throwable;

FILE: okgo/src/main/java/com/lzy/okgo/convert/FileConvert.java
  class FileConvert (line 42) | public class FileConvert implements Converter<File> {
    method FileConvert (line 50) | public FileConvert() {
    method FileConvert (line 54) | public FileConvert(String fileName) {
    method FileConvert (line 58) | public FileConvert(String folder, String fileName) {
    method setCallback (line 63) | public void setCallback(Callback<File> callback) {
    method convertResponse (line 67) | @Override
    method onProgress (line 115) | private void onProgress(final Progress progress) {

FILE: okgo/src/main/java/com/lzy/okgo/convert/StringConvert.java
  class StringConvert (line 30) | public class StringConvert implements Converter<String> {
    method convertResponse (line 32) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cookie/CookieJarImpl.java
  class CookieJarImpl (line 35) | public class CookieJarImpl implements CookieJar {
    method CookieJarImpl (line 39) | public CookieJarImpl(CookieStore cookieStore) {
    method saveFromResponse (line 46) | @Override
    method loadForRequest (line 51) | @Override
    method getCookieStore (line 56) | public CookieStore getCookieStore() {

FILE: okgo/src/main/java/com/lzy/okgo/cookie/SerializableCookie.java
  class SerializableCookie (line 42) | public class SerializableCookie implements Serializable {
    method SerializableCookie (line 56) | public SerializableCookie(String host, Cookie cookie) {
    method getCookie (line 63) | public Cookie getCookie() {
    method writeObject (line 71) | private void writeObject(ObjectOutputStream out) throws IOException {
    method readObject (line 84) | private void readObject(ObjectInputStream in) throws IOException, Clas...
    method parseCursorToBean (line 106) | public static SerializableCookie parseCursorToBean(Cursor cursor) {
    method getContentValues (line 113) | public static ContentValues getContentValues(SerializableCookie serial...
    method encodeCookie (line 128) | public static String encodeCookie(String host, Cookie cookie) {
    method cookieToBytes (line 134) | public static byte[] cookieToBytes(String host, Cookie cookie) {
    method decodeCookie (line 153) | public static Cookie decodeCookie(String cookieString) {
    method bytesToCookie (line 158) | public static Cookie bytesToCookie(byte[] bytes) {
    method byteArrayToHexString (line 176) | private static String byteArrayToHexString(byte[] bytes) {
    method hexStringToByteArray (line 194) | private static byte[] hexStringToByteArray(String hexString) {
    method equals (line 204) | @Override
    method hashCode (line 216) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cookie/store/CookieStore.java
  type CookieStore (line 32) | public interface CookieStore {
    method saveCookie (line 35) | void saveCookie(HttpUrl url, List<Cookie> cookie);
    method saveCookie (line 38) | void saveCookie(HttpUrl url, Cookie cookie);
    method loadCookie (line 41) | List<Cookie> loadCookie(HttpUrl url);
    method getAllCookie (line 44) | List<Cookie> getAllCookie();
    method getCookie (line 47) | List<Cookie> getCookie(HttpUrl url);
    method removeCookie (line 50) | boolean removeCookie(HttpUrl url, Cookie cookie);
    method removeCookie (line 53) | boolean removeCookie(HttpUrl url);
    method removeAllCookie (line 56) | boolean removeAllCookie();

FILE: okgo/src/main/java/com/lzy/okgo/cookie/store/DBCookieStore.java
  class DBCookieStore (line 41) | public class DBCookieStore implements CookieStore {
    method DBCookieStore (line 51) | public DBCookieStore(Context context) {
    method getCookieToken (line 64) | private String getCookieToken(Cookie cookie) {
    method isCookieExpired (line 69) | private static boolean isCookieExpired(Cookie cookie) {
    method saveCookie (line 74) | @Override
    method saveCookie (line 81) | @Override
    method loadCookie (line 99) | @Override
    method removeCookie (line 117) | @Override
    method removeCookie (line 132) | @Override
    method removeAllCookie (line 145) | @Override
    method getAllCookie (line 155) | @Override
    method getCookie (line 164) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cookie/store/MemoryCookieStore.java
  class MemoryCookieStore (line 36) | public class MemoryCookieStore implements CookieStore {
    method saveCookie (line 40) | @Override
    method saveCookie (line 55) | @Override
    method loadCookie (line 68) | @Override
    method getAllCookie (line 78) | @Override
    method getCookie (line 88) | @Override
    method removeCookie (line 96) | @Override
    method removeCookie (line 102) | @Override
    method removeAllCookie (line 107) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/cookie/store/SPCookieStore.java
  class SPCookieStore (line 44) | public class SPCookieStore implements CookieStore {
    method SPCookieStore (line 59) | public SPCookieStore(Context context) {
    method getCookieToken (line 86) | private String getCookieToken(Cookie cookie) {
    method isCookieExpired (line 91) | private static boolean isCookieExpired(Cookie cookie) {
    method saveCookie (line 96) | @Override
    method saveCookie (line 103) | @Override
    method saveCookie (line 117) | private void saveCookie(HttpUrl url, Cookie cookie, String cookieToken) {
    method loadCookie (line 128) | @Override
    method removeCookie (line 145) | @Override
    method removeCookie (line 163) | @Override
    method removeAllCookie (line 183) | @Override
    method getAllCookie (line 195) | @Override
    method getCookie (line 204) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/db/BaseDao.java
  class BaseDao (line 39) | public abstract class BaseDao<T> {
    method BaseDao (line 46) | public BaseDao(SQLiteOpenHelper helper) {
    method openReader (line 53) | public SQLiteDatabase openReader() {
    method openWriter (line 57) | public SQLiteDatabase openWriter() {
    method closeDatabase (line 61) | protected final void closeDatabase(SQLiteDatabase database, Cursor cur...
    method insert (line 67) | public boolean insert(T t) {
    method insert (line 87) | public long insert(SQLiteDatabase database, T t) {
    method insert (line 92) | public boolean insert(List<T> ts) {
    method insert (line 113) | public boolean insert(SQLiteDatabase database, List<T> ts) {
    method deleteAll (line 126) | public boolean deleteAll() {
    method deleteAll (line 131) | public long deleteAll(SQLiteDatabase database) {
    method delete (line 136) | public boolean delete(String whereClause, String[] whereArgs) {
    method delete (line 155) | public long delete(SQLiteDatabase database, String whereClause, String...
    method deleteList (line 159) | public boolean deleteList(List<Pair<String, String[]>> where) {
    method replace (line 188) | public boolean replace(T t) {
    method replace (line 207) | public long replace(SQLiteDatabase database, T t) {
    method replace (line 211) | public boolean replace(ContentValues contentValues) {
    method replace (line 229) | public long replace(SQLiteDatabase database, ContentValues contentValu...
    method replace (line 233) | public boolean replace(List<T> ts) {
    method replace (line 254) | public boolean replace(SQLiteDatabase database, List<T> ts) {
    method update (line 267) | public boolean update(T t, String whereClause, String[] whereArgs) {
    method update (line 287) | public long update(SQLiteDatabase database, T t, String whereClause, S...
    method update (line 292) | public boolean update(ContentValues contentValues, String whereClause,...
    method update (line 311) | public long update(SQLiteDatabase database, ContentValues contentValue...
    method queryAll (line 316) | public List<T> queryAll(SQLiteDatabase database) {
    method query (line 321) | public List<T> query(SQLiteDatabase database, String selection, String...
    method queryOne (line 326) | public T queryOne(SQLiteDatabase database, String selection, String[] ...
    method query (line 333) | public List<T> query(SQLiteDatabase database, String[] columns, String...
    method queryAll (line 350) | public List<T> queryAll() {
    method query (line 355) | public List<T> query(String selection, String[] selectionArgs) {
    method queryOne (line 360) | public T queryOne(String selection, String[] selectionArgs) {
    method query (line 368) | public List<T> query(String[] columns, String selection, String[] sele...
    type Action (line 391) | public interface Action {
      method call (line 392) | void call(SQLiteDatabase database);
    method startTransaction (line 396) | public void startTransaction(Action action) {
    method getTableName (line 411) | public abstract String getTableName();
    method unInit (line 413) | public abstract void unInit();
    method parseCursorToBean (line 416) | public abstract T parseCursorToBean(Cursor cursor);
    method getContentValues (line 419) | public abstract ContentValues getContentValues(T t);

FILE: okgo/src/main/java/com/lzy/okgo/db/CacheManager.java
  class CacheManager (line 34) | public class CacheManager extends BaseDao<CacheEntity<?>> {
    method getInstance (line 36) | public static CacheManager getInstance() {
    class CacheManagerHolder (line 40) | private static class CacheManagerHolder {
    method CacheManager (line 44) | private CacheManager() {
    method parseCursorToBean (line 48) | @Override
    method getContentValues (line 53) | @Override
    method getTableName (line 58) | @Override
    method unInit (line 63) | @Override
    method get (line 68) | public CacheEntity<?> get(String key) {
    method remove (line 75) | public boolean remove(String key) {
    method get (line 81) | @SuppressWarnings("unchecked")
    method getAll (line 87) | public List<CacheEntity<?>> getAll() {
    method replace (line 98) | public <T> CacheEntity<T> replace(String key, CacheEntity<T> entity) {
    method clear (line 105) | public boolean clear() {

FILE: okgo/src/main/java/com/lzy/okgo/db/ColumnEntity.java
  class ColumnEntity (line 27) | public class ColumnEntity {
    method ColumnEntity (line 39) | public ColumnEntity(String... compositePrimaryKey) {
    method ColumnEntity (line 47) | public ColumnEntity(String columnName, String columnType) {
    method ColumnEntity (line 57) | public ColumnEntity(String columnName, String columnType, boolean isPr...
    method ColumnEntity (line 68) | public ColumnEntity(String columnName, String columnType, boolean isPr...

FILE: okgo/src/main/java/com/lzy/okgo/db/CookieManager.java
  class CookieManager (line 33) | public class CookieManager extends BaseDao<SerializableCookie> {
    method getInstance (line 38) | public static CookieManager getInstance() {
    method CookieManager (line 49) | private CookieManager() {
    method init (line 53) | public static void init(Context ctx) {
    method parseCursorToBean (line 57) | @Override
    method getContentValues (line 62) | @Override
    method getTableName (line 67) | @Override
    method unInit (line 72) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/db/DBHelper.java
  class DBHelper (line 39) | class DBHelper extends SQLiteOpenHelper {
    method DBHelper (line 55) | DBHelper() {
    method DBHelper (line 59) | DBHelper(Context context) {
    method onCreate (line 106) | @Override
    method onUpgrade (line 114) | @Override
    method onDowngrade (line 123) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/db/DBUtils.java
  class DBUtils (line 32) | public class DBUtils {
    method isNeedUpgradeTable (line 35) | public static boolean isNeedUpgradeTable(SQLiteDatabase db, TableEntit...
    method isTableExists (line 69) | public static boolean isTableExists(SQLiteDatabase db, String tableNam...
    method isFieldExists (line 88) | public static boolean isFieldExists(SQLiteDatabase db, String tableNam...

FILE: okgo/src/main/java/com/lzy/okgo/db/DownloadManager.java
  class DownloadManager (line 34) | public class DownloadManager extends BaseDao<Progress> {
    method DownloadManager (line 36) | private DownloadManager() {
    method getInstance (line 40) | public static DownloadManager getInstance() {
    class DownloadManagerHolder (line 44) | private static class DownloadManagerHolder {
    method parseCursorToBean (line 48) | @Override
    method getContentValues (line 53) | @Override
    method getTableName (line 58) | @Override
    method unInit (line 63) | @Override
    method get (line 68) | public Progress get(String tag) {
    method delete (line 73) | public void delete(String taskKey) {
    method update (line 78) | public boolean update(Progress progress) {
    method update (line 83) | public boolean update(ContentValues contentValues, String tag) {
    method getAll (line 88) | public List<Progress> getAll() {
    method getFinished (line 93) | public List<Progress> getFinished() {
    method getDownloading (line 98) | public List<Progress> getDownloading() {
    method clear (line 103) | public boolean clear() {

FILE: okgo/src/main/java/com/lzy/okgo/db/TableEntity.java
  class TableEntity (line 30) | public class TableEntity {
    method TableEntity (line 35) | public TableEntity(String tableName) {
    method addColumn (line 40) | public TableEntity addColumn(ColumnEntity columnEntity) {
    method buildTableString (line 46) | public String buildTableString() {
    method getColumnName (line 84) | public String getColumnName(int columnIndex) {
    method getColumnCount (line 89) | public int getColumnCount() {
    method getColumnIndex (line 93) | public int getColumnIndex(String columnName) {

FILE: okgo/src/main/java/com/lzy/okgo/db/UploadManager.java
  class UploadManager (line 34) | public class UploadManager extends BaseDao<Progress> {
    method UploadManager (line 36) | private UploadManager() {
    method getInstance (line 40) | public static UploadManager getInstance() {
    class UploadManagerHolder (line 44) | private static class UploadManagerHolder {
    method parseCursorToBean (line 48) | @Override
    method getContentValues (line 53) | @Override
    method getTableName (line 58) | @Override
    method unInit (line 63) | @Override
    method get (line 68) | public Progress get(String tag) {
    method delete (line 73) | public void delete(String taskKey) {
    method update (line 78) | public boolean update(Progress progress) {
    method update (line 83) | public boolean update(ContentValues contentValues, String tag) {
    method getAll (line 88) | public List<Progress> getAll() {
    method getFinished (line 93) | public List<Progress> getFinished() {
    method getUploading (line 98) | public List<Progress> getUploading() {
    method clear (line 103) | public boolean clear() {

FILE: okgo/src/main/java/com/lzy/okgo/exception/CacheException.java
  class CacheException (line 27) | public class CacheException extends Exception {
    method NON_OR_EXPIRE (line 30) | public static CacheException NON_OR_EXPIRE(String cacheKey) {
    method NON_AND_304 (line 34) | public static CacheException NON_AND_304(String cacheKey) {
    method CacheException (line 38) | public CacheException(String detailMessage) {

FILE: okgo/src/main/java/com/lzy/okgo/exception/HttpException.java
  class HttpException (line 30) | public class HttpException extends RuntimeException {
    method HttpException (line 37) | public HttpException(String message) {
    method HttpException (line 41) | public HttpException(Response<?> response) {
    method getMessage (line 48) | private static String getMessage(Response<?> response) {
    method code (line 53) | public int code() {
    method message (line 57) | public String message() {
    method response (line 61) | public Response<?> response() {
    method NET_ERROR (line 65) | public static HttpException NET_ERROR() {
    method COMMON (line 69) | public static HttpException COMMON(String message) {

FILE: okgo/src/main/java/com/lzy/okgo/exception/OkGoException.java
  class OkGoException (line 27) | public class OkGoException extends Exception {
    method OkGoException (line 30) | public OkGoException(String detailMessage) {
    method UNKNOWN (line 34) | public static OkGoException UNKNOWN() {
    method BREAKPOINT_NOT_EXIST (line 38) | public static OkGoException BREAKPOINT_NOT_EXIST() {
    method BREAKPOINT_EXPIRED (line 42) | public static OkGoException BREAKPOINT_EXPIRED() {

FILE: okgo/src/main/java/com/lzy/okgo/exception/StorageException.java
  class StorageException (line 27) | public class StorageException extends Exception {
    method StorageException (line 31) | public StorageException() {
    method StorageException (line 34) | public StorageException(String detailMessage) {
    method StorageException (line 38) | public StorageException(String detailMessage, Throwable throwable) {
    method StorageException (line 42) | public StorageException(Throwable throwable) {
    method NOT_AVAILABLE (line 46) | public static StorageException NOT_AVAILABLE() {

FILE: okgo/src/main/java/com/lzy/okgo/https/HttpsUtils.java
  class HttpsUtils (line 49) | public class HttpsUtils {
    class SSLParams (line 51) | public static class SSLParams {
    method getSslSocketFactory (line 56) | public static SSLParams getSslSocketFactory() {
    method getSslSocketFactory (line 64) | public static SSLParams getSslSocketFactory(X509TrustManager trustMana...
    method getSslSocketFactory (line 72) | public static SSLParams getSslSocketFactory(InputStream... certificate...
    method getSslSocketFactory (line 81) | public static SSLParams getSslSocketFactory(InputStream bksFile, Strin...
    method getSslSocketFactory (line 90) | public static SSLParams getSslSocketFactory(InputStream bksFile, Strin...
    method getSslSocketFactoryBase (line 94) | private static SSLParams getSslSocketFactoryBase(X509TrustManager trus...
    method prepareKeyManager (line 126) | private static KeyManager[] prepareKeyManager(InputStream bksFile, Str...
    method prepareTrustManager (line 140) | private static TrustManager[] prepareTrustManager(InputStream... certi...
    method chooseTrustManager (line 172) | private static X509TrustManager chooseTrustManager(TrustManager[] trus...
    method checkClientTrusted (line 186) | @Override
    method checkServerTrusted (line 190) | @Override
    method getAcceptedIssuers (line 194) | @Override
    method verify (line 206) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/interceptor/HttpLoggingInterceptor.java
  class HttpLoggingInterceptor (line 47) | public class HttpLoggingInterceptor implements Interceptor {
    type Level (line 55) | public enum Level {
    method HttpLoggingInterceptor (line 62) | public HttpLoggingInterceptor(String tag) {
    method setPrintLevel (line 66) | public void setPrintLevel(Level level) {
    method setColorLevel (line 71) | public void setColorLevel(java.util.logging.Level level) {
    method log (line 75) | private void log(String message) {
    method intercept (line 79) | @Override
    method logForRequest (line 104) | private void logForRequest(Request request, Connection connection) thr...
    method logForResponse (line 151) | private Response logForResponse(Response response, long tookMs) {
    method getCharset (line 189) | private static Charset getCharset(MediaType contentType) {
    method isPlaintext (line 199) | private static boolean isPlaintext(MediaType mediaType) {
    method bodyToString (line 213) | private void bodyToString(Request request) {

FILE: okgo/src/main/java/com/lzy/okgo/model/HttpHeaders.java
  class HttpHeaders (line 47) | public class HttpHeaders implements Serializable {
    method init (line 87) | private void init() {
    method HttpHeaders (line 91) | public HttpHeaders() {
    method HttpHeaders (line 95) | public HttpHeaders(String key, String value) {
    method put (line 100) | public void put(String key, String value) {
    method put (line 106) | public void put(HttpHeaders headers) {
    method get (line 112) | public String get(String key) {
    method remove (line 116) | public String remove(String key) {
    method clear (line 120) | public void clear() {
    method getNames (line 124) | public Set<String> getNames() {
    method toJSONString (line 128) | public final String toJSONString() {
    method getDate (line 140) | public static long getDate(String gmtTime) {
    method getDate (line 148) | public static String getDate(long milliseconds) {
    method getExpiration (line 152) | public static long getExpiration(String expiresTime) {
    method getLastModified (line 160) | public static long getLastModified(String lastModified) {
    method getCacheControl (line 168) | public static String getCacheControl(String cacheControl, String pragm...
    method setAcceptLanguage (line 175) | public static void setAcceptLanguage(String language) {
    method getAcceptLanguage (line 182) | public static String getAcceptLanguage() {
    method setUserAgent (line 195) | public static void setUserAgent(String agent) {
    method getUserAgent (line 202) | public static String getUserAgent() {
    method parseGMTToMillis (line 259) | public static long parseGMTToMillis(String gmtTime) throws ParseExcept...
    method formatMillisToGMT (line 267) | public static String formatMillisToGMT(long milliseconds) {
    method toString (line 274) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/model/HttpMethod.java
  type HttpMethod (line 27) | public enum HttpMethod {
    method HttpMethod (line 46) | HttpMethod(String value) {
    method toString (line 50) | @Override
    method hasBody (line 55) | public boolean hasBody() {

FILE: okgo/src/main/java/com/lzy/okgo/model/HttpParams.java
  class HttpParams (line 42) | public class HttpParams implements Serializable {
    method HttpParams (line 57) | public HttpParams() {
    method HttpParams (line 61) | public HttpParams(String key, String value) {
    method HttpParams (line 66) | public HttpParams(String key, File file) {
    method init (line 71) | private void init() {
    method put (line 76) | public void put(HttpParams params) {
    method put (line 83) | public void put(Map<String, String> params, boolean... isReplace) {
    method put (line 90) | public void put(String key, String value, boolean... isReplace) {
    method put (line 98) | public void put(String key, int value, boolean... isReplace) {
    method put (line 106) | public void put(String key, long value, boolean... isReplace) {
    method put (line 114) | public void put(String key, float value, boolean... isReplace) {
    method put (line 122) | public void put(String key, double value, boolean... isReplace) {
    method put (line 130) | public void put(String key, char value, boolean... isReplace) {
    method put (line 138) | public void put(String key, boolean value, boolean... isReplace) {
    method put (line 146) | private void put(String key, String value, boolean isReplace) {
    method putUrlParams (line 158) | public void putUrlParams(String key, List<String> values) {
    method put (line 166) | public void put(String key, File file) {
    method put (line 170) | public void put(String key, File file, String fileName) {
    method put (line 174) | public void put(String key, FileWrapper fileWrapper) {
    method put (line 180) | public void put(String key, File file, String fileName, MediaType cont...
    method putFileParams (line 191) | public void putFileParams(String key, List<File> files) {
    method putFileWrapperParams (line 199) | public void putFileWrapperParams(String key, List<FileWrapper> fileWra...
    method removeUrl (line 207) | public void removeUrl(String key) {
    method removeFile (line 211) | public void removeFile(String key) {
    method remove (line 215) | public void remove(String key) {
    method clear (line 220) | public void clear() {
    class FileWrapper (line 226) | public static class FileWrapper implements Serializable {
      method FileWrapper (line 234) | public FileWrapper(File file, String fileName, MediaType contentType) {
      method writeObject (line 241) | private void writeObject(ObjectOutputStream out) throws IOException {
      method readObject (line 246) | private void readObject(ObjectInputStream in) throws IOException, Cl...
      method toString (line 251) | @Override
    method toString (line 262) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/model/Priority.java
  type Priority (line 27) | public interface Priority {

FILE: okgo/src/main/java/com/lzy/okgo/model/Progress.java
  class Progress (line 39) | public class Progress implements Serializable {
    method Progress (line 87) | public Progress() {
    method changeProgress (line 95) | public static Progress changeProgress(Progress progress, long writeSiz...
    method changeProgress (line 99) | public static Progress changeProgress(final Progress progress, long wr...
    method bufferSpeed (line 121) | private long bufferSpeed(long speed) {
    method from (line 134) | public void from(Progress progress) {
    type Action (line 143) | public interface Action {
      method call (line 144) | void call(Progress progress);
    method buildContentValues (line 147) | public static ContentValues buildContentValues(Progress progress) {
    method buildUpdateContentValues (line 167) | public static ContentValues buildUpdateContentValues(Progress progress) {
    method parseCursorToBean (line 178) | public static Progress parseCursorToBean(Cursor cursor) {
    method equals (line 198) | @Override
    method hashCode (line 208) | @Override
    method toString (line 213) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/model/Response.java
  class Response (line 30) | public final class Response<T> {
    method success (line 38) | public static <T> Response<T> success(boolean isFromCache, T body, Cal...
    method error (line 47) | public static <T> Response<T> error(boolean isFromCache, Call rawCall,...
    method Response (line 56) | public Response() {
    method code (line 59) | public int code() {
    method message (line 64) | public String message() {
    method headers (line 69) | public Headers headers() {
    method isSuccessful (line 74) | public boolean isSuccessful() {
    method setBody (line 78) | public void setBody(T body) {
    method body (line 82) | public T body() {
    method getException (line 86) | public Throwable getException() {
    method setException (line 90) | public void setException(Throwable exception) {
    method getRawCall (line 94) | public Call getRawCall() {
    method setRawCall (line 98) | public void setRawCall(Call rawCall) {
    method getRawResponse (line 102) | public okhttp3.Response getRawResponse() {
    method setRawResponse (line 106) | public void setRawResponse(okhttp3.Response rawResponse) {
    method isFromCache (line 110) | public boolean isFromCache() {
    method setFromCache (line 114) | public void setFromCache(boolean fromCache) {

FILE: okgo/src/main/java/com/lzy/okgo/model/Result.java
  class Result (line 29) | public final class Result<T> {
    method error (line 30) | @SuppressWarnings("ConstantConditions") // Guarding public API nullabi...
    method response (line 36) | @SuppressWarnings("ConstantConditions") // Guarding public API nullabi...
    method Result (line 45) | private Result(Response<T> response, Throwable error) {
    method response (line 55) | public Response<T> response() {
    method error (line 67) | public Throwable error() {
    method isError (line 72) | public boolean isError() {
    method toString (line 76) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/DeleteRequest.java
  class DeleteRequest (line 33) | public class DeleteRequest<T> extends BodyRequest<T, DeleteRequest<T>> {
    method DeleteRequest (line 35) | public DeleteRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/GetRequest.java
  class GetRequest (line 33) | public class GetRequest<T> extends NoBodyRequest<T, GetRequest<T>> {
    method GetRequest (line 35) | public GetRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/HeadRequest.java
  class HeadRequest (line 33) | public class HeadRequest<T> extends NoBodyRequest<T, HeadRequest<T>> {
    method HeadRequest (line 35) | public HeadRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/OptionsRequest.java
  class OptionsRequest (line 33) | public class OptionsRequest<T> extends BodyRequest<T, OptionsRequest<T>> {
    method OptionsRequest (line 35) | public OptionsRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/PatchRequest.java
  class PatchRequest (line 33) | public class PatchRequest<T> extends BodyRequest<T, PatchRequest<T>> {
    method PatchRequest (line 35) | public PatchRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/PostRequest.java
  class PostRequest (line 33) | public class PostRequest<T> extends BodyRequest<T, PostRequest<T>> {
    method PostRequest (line 35) | public PostRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/PutRequest.java
  class PutRequest (line 33) | public class PutRequest<T> extends BodyRequest<T, PutRequest<T>> {
    method PutRequest (line 35) | public PutRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/TraceRequest.java
  class TraceRequest (line 33) | public class TraceRequest<T> extends NoBodyRequest<T, TraceRequest<T>> {
    method TraceRequest (line 35) | public TraceRequest(String url) {
    method getMethod (line 39) | @Override
    method generateRequest (line 44) | @Override

FILE: okgo/src/main/java/com/lzy/okgo/request/base/BodyRequest.java
  class BodyRequest (line 46) | public abstract class BodyRequest<T, R extends BodyRequest> extends Requ...
    method BodyRequest (line 58) | public BodyRequest(String url) {
    method isMultipart (line 62) | @SuppressWarnings("unchecked")
    method isSpliceUrl (line 69) | @SuppressWarnings("unchecked")
    method params (line 76) | @SuppressWarnings("unchecked")
    method addFileParams (line 83) | @SuppressWarnings("unchecked")
    method addFileWrapperParams (line 90) | @SuppressWarnings("unchecked")
    method params (line 97) | @SuppressWarnings("unchecked")
    method params (line 104) | @SuppressWarnings("unchecked")
    method upRequestBody (line 111) | @SuppressWarnings("unchecked")
    method upString (line 119) | @SuppressWarnings("unchecked")
    method upString (line 131) | @SuppressWarnings("unchecked")
    method upJson (line 140) | @SuppressWarnings("unchecked")
    method upJson (line 149) | @SuppressWarnings("unchecked")
    method upJson (line 158) | @SuppressWarnings("unchecked")
    method upBytes (line 167) | @SuppressWarnings("unchecked")
    method upBytes (line 176) | @SuppressWarnings("unchecked")
    method upFile (line 185) | @SuppressWarnings("unchecked")
    method upFile (line 194) | @SuppressWarnings("unchecked")
    method generateRequestBody (line 202) | @Override
    method generateRequestBuilder (line 213) | protected okhttp3.Request.Builder generateRequestBuilder(RequestBody r...
    method writeObject (line 223) | private void writeObject(ObjectOutputStream out) throws IOException {
    method readObject (line 228) | private void readObject(ObjectInputStream in) throws IOException, Clas...

FILE: okgo/src/main/java/com/lzy/okgo/request/base/HasBody.java
  type HasBody (line 38) | public interface HasBody<R> {
    method isMultipart (line 40) | R isMultipart(boolean isMultipart);
    method isSpliceUrl (line 42) | R isSpliceUrl(boolean isSpliceUrl);
    method upRequestBody (line 44) | R upRequestBody(RequestBody requestBody);
    method params (line 46) | R params(String key, File file);
    method addFileParams (line 48) | R addFileParams(String key, List<File> files);
    method addFileWrapperParams (line 50) | R addFileWrapperParams(String key, List<HttpParams.FileWrapper> fileWr...
    method params (line 52) | R params(String key, File file, String fileName);
    method params (line 54) | R params(String key, File file, String fileName, MediaType contentType);
    method upString (line 56) | R upString(String string);
    method upString (line 58) | R upString(String string, MediaType mediaType);
    method upJson (line 60) | R upJson(String json);
    method upJson (line 62) | R upJson(JSONObject jsonObject);
    method upJson (line 64) | R upJson(JSONArray jsonArray);
    method upBytes (line 66) | R upBytes(byte[] bs);
    method upBytes (line 68) | R upBytes(byte[] bs, MediaType mediaType);
    method upFile (line 70) | R upFile(File file);
    method upFile (line 72) | R upFile(File file, MediaType mediaType);

FILE: okgo/src/main/java/com/lzy/okgo/request/base/NoBodyRequest.java
  class NoBodyRequest (line 16) | public abstract class NoBodyRequest<T, R extends NoBodyRequest> extends ...
    method NoBodyRequest (line 19) | public NoBodyRequest(String url) {
    method generateRequestBody (line 23) | @Override
    method generateRequestBuilder (line 28) | protected okhttp3.Request.Builder generateRequestBuilder(RequestBody r...

FILE: okgo/src/main/java/com/lzy/okgo/request/base/ProgressRequestBody.java
  class ProgressRequestBody (line 42) | public class ProgressRequestBody<T> extends RequestBody {
    method ProgressRequestBody (line 48) | ProgressRequestBody(RequestBody requestBody, Callback<T> callback) {
    method contentType (line 54) | @Override
    method contentLength (line 60) | @Override
    method writeTo (line 71) | @Override
    class CountingSink (line 80) | private final class CountingSink extends ForwardingSink {
      method CountingSink (line 84) | CountingSink(Sink delegate) {
      method write (line 90) | @Override
    method onProgress (line 107) | private void onProgress(final Progress progress) {
    method setInterceptor (line 118) | public void setInterceptor(UploadInterceptor interceptor) {
    type UploadInterceptor (line 122) | public interface UploadInterceptor {
      method uploadProgress (line 123) | void uploadProgress(Progress progress);

FILE: okgo/src/main/java/com/lzy/okgo/request/base/Request.java
  class Request (line 53) | public abstract class Request<T, R extends Request> implements Serializa...
    method Request (line 74) | public Request(String url) {
    method tag (line 93) | @SuppressWarnings("unchecked")
    method retryCount (line 99) | @SuppressWarnings("unchecked")
    method client (line 106) | @SuppressWarnings("unchecked")
    method call (line 114) | @SuppressWarnings("unchecked")
    method converter (line 122) | @SuppressWarnings("unchecked")
    method cacheMode (line 130) | @SuppressWarnings("unchecked")
    method cachePolicy (line 136) | @SuppressWarnings("unchecked")
    method cacheKey (line 144) | @SuppressWarnings("unchecked")
    method cacheTime (line 153) | @SuppressWarnings("unchecked")
    method headers (line 160) | @SuppressWarnings("unchecked")
    method headers (line 166) | @SuppressWarnings("unchecked")
    method removeHeader (line 172) | @SuppressWarnings("unchecked")
    method removeAllHeaders (line 178) | @SuppressWarnings("unchecked")
    method params (line 184) | @SuppressWarnings("unchecked")
    method params (line 190) | @SuppressWarnings("unchecked")
    method params (line 196) | @SuppressWarnings("unchecked")
    method params (line 202) | @SuppressWarnings("unchecked")
    method params (line 208) | @SuppressWarnings("unchecked")
    method params (line 214) | @SuppressWarnings("unchecked")
    method params (line 220) | @SuppressWarnings("unchecked")
    method params (line 226) | @SuppressWarnings("unchecked")
    method params (line 232) | @SuppressWarnings("unchecked")
    method addUrlParams (line 238) | @SuppressWarnings("unchecked")
    method removeParam (line 244) | @SuppressWarnings("unchecked")
    method removeAllParams (line 250) | @SuppressWarnings("unchecked")
    method uploadInterceptor (line 256) | @SuppressWarnings("unchecked")
    method getUrlParam (line 263) | public String getUrlParam(String key) {
    method getFileParam (line 270) | public HttpParams.FileWrapper getFileParam(String key) {
    method getParams (line 276) | public HttpParams getParams() {
    method getHeaders (line 280) | public HttpHeaders getHeaders() {
    method getUrl (line 284) | public String getUrl() {
    method getBaseUrl (line 288) | public String getBaseUrl() {
    method getTag (line 292) | public Object getTag() {
    method getCacheMode (line 296) | public CacheMode getCacheMode() {
    method getCachePolicy (line 300) | public CachePolicy<T> getCachePolicy() {
    method getCacheKey (line 304) | public String getCacheKey() {
    method getCacheTime (line 308) | public long getCacheTime() {
    method getRetryCount (line 312) | public int getRetryCount() {
    method getRequest (line 316) | public okhttp3.Request getRequest() {
    method setCallback (line 320) | public void setCallback(Callback<T> callback) {
    method getConverter (line 324) | public Converter<T> getConverter() {
    method getMethod (line 331) | public abstract HttpMethod getMethod();
    method generateRequestBody (line 334) | protected abstract RequestBody generateRequestBody();
    method generateRequest (line 337) | public abstract okhttp3.Request generateRequest(RequestBody requestBody);
    method getRawCall (line 340) | public okhttp3.Call getRawCall() {
    method adapt (line 355) | public Call<T> adapt() {
    method adapt (line 364) | public <E> E adapt(CallAdapter<T, E> adapter) {
    method adapt (line 373) | public <E> E adapt(AdapterParam param, CallAdapter<T, E> adapter) {
    method execute (line 382) | public Response execute() throws IOException {
    method execute (line 387) | public void execute(Callback<T> callback) {

FILE: okgo/src/main/java/com/lzy/okgo/utils/HeaderParser.java
  class HeaderParser (line 39) | public class HeaderParser {
    method createCacheEntity (line 59) | public static <T> CacheEntity<T> createCacheEntity(Headers responseHea...
    method addCacheHeaders (line 137) | public static <T> void addCacheHeaders(Request request, CacheEntity<T>...

FILE: okgo/src/main/java/com/lzy/okgo/utils/HttpUtils.java
  class HttpUtils (line 50) | public class HttpUtils {
    method createUrlFromParams (line 52) | public static String createUrlFromParams(String url, Map<String, List<...
    method appendHeaders (line 75) | public static Request.Builder appendHeaders(Request.Builder builder, H...
    method generateMultipartRequestBody (line 92) | public static RequestBody generateMultipartRequestBody(HttpParams para...
    method getNetFileName (line 128) | public static String getNetFileName(Response response, String url) {
    method getHeaderFileName (line 145) | private static String getHeaderFileName(Response response) {
    method getUrlFileName (line 173) | private static String getUrlFileName(String url) {
    method deleteFile (line 192) | public static boolean deleteFile(String path) {
    method guessMimeType (line 205) | public static MediaType guessMimeType(String fileName) {
    method checkNotNull (line 215) | public static <T> T checkNotNull(T object, String message) {
    method runOnUiThread (line 222) | public static void runOnUiThread(Runnable runnable) {

FILE: okgo/src/main/java/com/lzy/okgo/utils/IOUtils.java
  class IOUtils (line 55) | public class IOUtils {
    method closeQuietly (line 57) | public static void closeQuietly(Closeable closeable) {
    method flushQuietly (line 66) | public static void flushQuietly(Flushable flushable) {
    method toInputStream (line 75) | public static InputStream toInputStream(CharSequence input) {
    method toInputStream (line 79) | public static InputStream toInputStream(CharSequence input, String enc...
    method toBufferedInputStream (line 84) | public static BufferedInputStream toBufferedInputStream(InputStream in...
    method toBufferedOutputStream (line 88) | public static BufferedOutputStream toBufferedOutputStream(OutputStream...
    method toBufferedReader (line 92) | public static BufferedReader toBufferedReader(Reader reader) {
    method toBufferedWriter (line 96) | public static BufferedWriter toBufferedWriter(Writer writer) {
    method toString (line 100) | public static String toString(InputStream input) throws IOException {
    method toString (line 104) | public static String toString(InputStream input, String encoding) thro...
    method toString (line 108) | public static String toString(Reader input) throws IOException {
    method toString (line 112) | public static String toString(Reader input, String encoding) throws IO...
    method toString (line 116) | public static String toString(byte[] byteArray) {
    method toString (line 120) | public static String toString(byte[] byteArray, String encoding) {
    method toByteArray (line 128) | public static byte[] toByteArray(Object input) {
    method toObject (line 146) | public static Object toObject(byte[] input) {
    method toByteArray (line 163) | public static byte[] toByteArray(CharSequence input) {
    method toByteArray (line 168) | public static byte[] toByteArray(CharSequence input, String encoding) ...
    method toByteArray (line 173) | public static byte[] toByteArray(InputStream input) throws IOException {
    method toByteArray (line 180) | public static byte[] toByteArray(Reader input) throws IOException {
    method toByteArray (line 187) | public static byte[] toByteArray(Reader input, String encoding) throws...
    method toCharArray (line 194) | public static char[] toCharArray(CharSequence input) throws IOException {
    method toCharArray (line 200) | public static char[] toCharArray(InputStream input) throws IOException {
    method toCharArray (line 206) | public static char[] toCharArray(InputStream input, String encoding) t...
    method toCharArray (line 212) | public static char[] toCharArray(Reader input) throws IOException {
    method readLines (line 218) | public static List<String> readLines(InputStream input, String encodin...
    method readLines (line 223) | public static List<String> readLines(InputStream input) throws IOExcep...
    method readLines (line 228) | public static List<String> readLines(Reader input) throws IOException {
    method write (line 239) | public static void write(byte[] data, OutputStream output) throws IOEx...
    method write (line 243) | public static void write(byte[] data, Writer output) throws IOException {
    method write (line 247) | public static void write(byte[] data, Writer output, String encoding) ...
    method write (line 251) | public static void write(char[] data, Writer output) throws IOException {
    method write (line 255) | public static void write(char[] data, OutputStream output) throws IOEx...
    method write (line 259) | public static void write(char[] data, OutputStream output, String enco...
    method write (line 263) | public static void write(CharSequence data, Writer output) throws IOEx...
    method write (line 267) | public static void write(CharSequence data, OutputStream output) throw...
    method write (line 271) | public static void write(CharSequence data, OutputStream output, Strin...
    method write (line 275) | public static void write(InputStream inputStream, OutputStream outputS...
    method write (line 281) | public static void write(Reader input, OutputStream output) throws IOE...
    method write (line 287) | public static void write(InputStream input, Writer output) throws IOEx...
    method write (line 292) | public static void write(Reader input, OutputStream output, String enc...
    method write (line 298) | public static void write(InputStream input, OutputStream output, Strin...
    method write (line 303) | public static void write(InputStream input, Writer output, String enco...
    method write (line 308) | public static void write(Reader input, Writer output) throws IOExcepti...
    method contentEquals (line 314) | public static boolean contentEquals(InputStream input1, InputStream in...
    method contentEquals (line 331) | public static boolean contentEquals(Reader input1, Reader input2) thro...
    method contentEqualsIgnoreEOL (line 348) | public static boolean contentEqualsIgnoreEOL(Reader input1, Reader inp...
    method getDirSize (line 367) | public static long getDirSize(String path) {
    method getStatFsSize (line 379) | private static long getStatFsSize(StatFs statFs, String blockSizeMetho...
    method canWrite (line 402) | public static boolean canWrite(String path) {
    method canRead (line 412) | public static boolean canRead(String path) {
    method createFolder (line 422) | public static boolean createFolder(String folderPath) {
    method createFolder (line 436) | public static boolean createFolder(File targetFolder) {
    method createNewFolder (line 451) | public static boolean createNewFolder(String folderPath) {
    method createNewFolder (line 461) | public static boolean createNewFolder(File targetFolder) {
    method createFile (line 471) | public static boolean createFile(String filePath) {
    method createFile (line 485) | public static boolean createFile(File targetFile) {
    method createNewFile (line 503) | public static boolean createNewFile(String filePath) {
    method createNewFile (line 517) | public static boolean createNewFile(File targetFile) {
    method delFileOrFolder (line 533) | public static boolean delFileOrFolder(String path) {
    method delFileOrFolder (line 545) | @SuppressWarnings("ResultOfMethodCallIgnored")

FILE: okgo/src/main/java/com/lzy/okgo/utils/OkLogger.java
  class OkLogger (line 29) | public class OkLogger {
    method debug (line 34) | public static void debug(boolean isEnable) {
    method debug (line 38) | public static void debug(String logTag, boolean isEnable) {
    method v (line 43) | public static void v(String msg) {
    method v (line 47) | public static void v(String tag, String msg) {
    method d (line 51) | public static void d(String msg) {
    method d (line 55) | public static void d(String tag, String msg) {
    method i (line 59) | public static void i(String msg) {
    method i (line 63) | public static void i(String tag, String msg) {
    method w (line 67) | public static void w(String msg) {
    method w (line 71) | public static void w(String tag, String msg) {
    method e (line 75) | public static void e(String msg) {
    method e (line 79) | public static void e(String tag, String msg) {
    method printStackTrace (line 83) | public static void printStackTrace(Throwable t) {

FILE: okrx/src/main/java/com/lzy/okrx/adapter/AnalysisParams.java
  class AnalysisParams (line 35) | class AnalysisParams {
    method analysis (line 37) | static <T> Observable.OnSubscribe<Response<T>> analysis(Call<T> call, ...

FILE: okrx/src/main/java/com/lzy/okrx/adapter/CompletableResponse.java
  class CompletableResponse (line 33) | public class CompletableResponse<T> implements CallAdapter<T, Completabl...
    method adapt (line 34) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/ObservableBody.java
  class ObservableBody (line 35) | public class ObservableBody<T> implements CallAdapter<T, Observable<T>> {
    method adapt (line 36) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/ObservableResponse.java
  class ObservableResponse (line 34) | public class ObservableResponse<T> implements CallAdapter<T, Observable<...
    method adapt (line 35) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/ObservableResult.java
  class ObservableResult (line 36) | public class ObservableResult<T> implements CallAdapter<T, Observable<Re...
    method adapt (line 37) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/SingleBody.java
  class SingleBody (line 33) | public class SingleBody<T> implements CallAdapter<T, Single<T>> {
    method adapt (line 34) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/SingleResponse.java
  class SingleResponse (line 34) | public class SingleResponse<T> implements CallAdapter<T, Single<Response...
    method adapt (line 35) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/adapter/SingleResult.java
  class SingleResult (line 34) | public class SingleResult<T> implements CallAdapter<T, Single<Result<T>>> {
    method adapt (line 35) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/subscribe/BodyOnSubscribe.java
  class BodyOnSubscribe (line 39) | public final class BodyOnSubscribe<T> implements OnSubscribe<T> {
    method BodyOnSubscribe (line 42) | public BodyOnSubscribe(OnSubscribe<Response<T>> upstream) {
    method call (line 46) | @Override
    class BodySubscriber (line 51) | private static class BodySubscriber<R> extends Subscriber<Response<R>> {
      method BodySubscriber (line 56) | BodySubscriber(Subscriber<? super R> subscriber) {
      method onNext (line 61) | @Override
      method onError (line 79) | @Override
      method onCompleted (line 91) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/subscribe/CallArbiter.java
  class CallArbiter (line 45) | final class CallArbiter<T> extends AtomicInteger implements Subscription...
    method CallArbiter (line 58) | CallArbiter(Call<T> call, Subscriber<? super Response<T>> subscriber) {
    method unsubscribe (line 66) | @Override
    method isUnsubscribed (line 71) | @Override
    method request (line 76) | @Override
    method emitNext (line 107) | void emitNext(Response<T> response) {
    method emitResponse (line 140) | private void emitResponse(List<Response<T>> responseList) {
    method emitComplete (line 169) | void emitComplete() {
    method emitError (line 183) | void emitError(Throwable t) {

FILE: okrx/src/main/java/com/lzy/okrx/subscribe/CallEnqueueOnSubscribe.java
  class CallEnqueueOnSubscribe (line 37) | public final class CallEnqueueOnSubscribe<T> implements OnSubscribe<Resp...
    method CallEnqueueOnSubscribe (line 40) | public CallEnqueueOnSubscribe(Call<T> originalCall) {
    method call (line 44) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/subscribe/CallExecuteOnSubscribe.java
  class CallExecuteOnSubscribe (line 34) | public final class CallExecuteOnSubscribe<T> implements OnSubscribe<Resp...
    method CallExecuteOnSubscribe (line 37) | public CallExecuteOnSubscribe(Call<T> originalCall) {
    method call (line 41) | @Override

FILE: okrx/src/main/java/com/lzy/okrx/subscribe/ResultOnSubscribe.java
  class ResultOnSubscribe (line 39) | public final class ResultOnSubscribe<T> implements OnSubscribe<Result<T>> {
    method ResultOnSubscribe (line 42) | public ResultOnSubscribe(OnSubscribe<Response<T>> upstream) {
    method call (line 46) | @Override
    class ResultSubscriber (line 51) | private static class ResultSubscriber<R> extends Subscriber<Response<R...
      method ResultSubscriber (line 55) | ResultSubscriber(Subscriber<? super Result<R>> subscriber) {
      method onNext (line 60) | @Override
      method onError (line 65) | @Override
      method onCompleted (line 83) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/AnalysisParams.java
  class AnalysisParams (line 35) | class AnalysisParams {
    method analysis (line 37) | static <T> Observable<Response<T>> analysis(Call<T> call, AdapterParam...

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/CompletableResponse.java
  class CompletableResponse (line 33) | public class CompletableResponse<T> implements CallAdapter<T, Completabl...
    method adapt (line 34) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/FlowableBody.java
  class FlowableBody (line 34) | public class FlowableBody<T> implements CallAdapter<T, Flowable<T>> {
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/FlowableResponse.java
  class FlowableResponse (line 35) | public class FlowableResponse<T> implements CallAdapter<T, Flowable<Resp...
    method adapt (line 36) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/FlowableResult.java
  class FlowableResult (line 35) | public class FlowableResult<T> implements CallAdapter<T, Flowable<Result...
    method adapt (line 36) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/MaybeBody.java
  class MaybeBody (line 33) | public class MaybeBody<T> implements CallAdapter<T, Maybe<T>> {
    method adapt (line 34) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/MaybeResponse.java
  class MaybeResponse (line 34) | public class MaybeResponse<T> implements CallAdapter<T, Maybe<Response<T...
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/MaybeResult.java
  class MaybeResult (line 34) | public class MaybeResult<T> implements CallAdapter<T, Maybe<Result<T>>> {
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/ObservableBody.java
  class ObservableBody (line 35) | public class ObservableBody<T> implements CallAdapter<T, Observable<T>> {
    method adapt (line 36) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/ObservableResponse.java
  class ObservableResponse (line 34) | public class ObservableResponse<T> implements CallAdapter<T, Observable<...
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/ObservableResult.java
  class ObservableResult (line 36) | public class ObservableResult<T> implements CallAdapter<T, Observable<Re...
    method adapt (line 37) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/SingleBody.java
  class SingleBody (line 33) | public class SingleBody<T> implements CallAdapter<T, Single<T>> {
    method adapt (line 34) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/SingleResponse.java
  class SingleResponse (line 34) | public class SingleResponse<T> implements CallAdapter<T, Single<Response...
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/adapter/SingleResult.java
  class SingleResult (line 34) | public class SingleResult<T> implements CallAdapter<T, Single<Result<T>>> {
    method adapt (line 35) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/observable/BodyObservable.java
  class BodyObservable (line 37) | public final class BodyObservable<T> extends Observable<T> {
    method BodyObservable (line 40) | public BodyObservable(Observable<Response<T>> upstream) {
    method subscribeActual (line 44) | @Override
    class BodyObserver (line 49) | private static class BodyObserver<R> implements Observer<Response<R>> {
      method BodyObserver (line 53) | BodyObserver(Observer<? super R> observer) {
      method onSubscribe (line 57) | @Override
      method onNext (line 62) | @Override
      method onComplete (line 78) | @Override
      method onError (line 89) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/observable/CallEnqueueObservable.java
  class CallEnqueueObservable (line 40) | public class CallEnqueueObservable<T> extends Observable<Response<T>> {
    method CallEnqueueObservable (line 43) | public CallEnqueueObservable(Call<T> originalCall) {
    method subscribeActual (line 47) | @Override
    class CallCallback (line 56) | private static final class CallCallback<T> implements Disposable, Call...
      method CallCallback (line 61) | CallCallback(Call<T> call, Observer<? super Response<T>> observer) {
      method dispose (line 66) | @Override
      method isDisposed (line 71) | @Override
      method convertResponse (line 76) | @Override
      method onStart (line 82) | @Override
      method onSuccess (line 86) | @Override
      method onCacheSuccess (line 101) | @Override
      method onError (line 106) | @Override
      method onFinish (line 120) | @Override
      method uploadProgress (line 134) | @Override
      method downloadProgress (line 138) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/observable/CallExecuteObservable.java
  class CallExecuteObservable (line 37) | public class CallExecuteObservable<T> extends Observable<Response<T>> {
    method CallExecuteObservable (line 40) | public CallExecuteObservable(Call<T> originalCall) {
    method subscribeActual (line 44) | @Override
    class CallDisposable (line 75) | private static final class CallDisposable implements Disposable {
      method CallDisposable (line 78) | CallDisposable(Call<?> call) {
      method dispose (line 82) | @Override
      method isDisposed (line 87) | @Override

FILE: okrx2/src/main/java/com/lzy/okrx2/observable/ResultObservable.java
  class ResultObservable (line 37) | public class ResultObservable<T> extends Observable<Result<T>> {
    method ResultObservable (line 40) | public ResultObservable(Observable<Response<T>> upstream) {
    method subscribeActual (line 44) | @Override
    class ResultObserver (line 49) | private static class ResultObserver<R> implements Observer<Response<R>> {
      method ResultObserver (line 52) | ResultObserver(Observer<? super Result<R>> observer) {
      method onSubscribe (line 56) | @Override
      method onNext (line 61) | @Override
      method onError (line 66) | @Override
      method onComplete (line 82) | @Override

FILE: okserver/src/main/java/com/lzy/okserver/OkDownload.java
  class OkDownload (line 45) | public class OkDownload {
    method getInstance (line 51) | public static OkDownload getInstance() {
    class OkDownloadHolder (line 55) | private static class OkDownloadHolder {
    method OkDownload (line 59) | private OkDownload() {
    method request (line 75) | public static DownloadTask request(String tag, Request<File, ? extends...
    method restore (line 86) | public static DownloadTask restore(Progress progress) {
    method restore (line 97) | public static List<DownloadTask> restore(List<Progress> progressList) {
    method startAll (line 112) | public void startAll() {
    method pauseAll (line 124) | public void pauseAll() {
    method removeAll (line 150) | public void removeAll() {
    method removeAll (line 159) | public void removeAll(boolean isDeleteFile) {
    method getFolder (line 186) | public String getFolder() {
    method setFolder (line 190) | public OkDownload setFolder(String folder) {
    method getThreadPool (line 195) | public DownloadThreadPool getThreadPool() {
    method getTaskMap (line 199) | public Map<String, DownloadTask> getTaskMap() {
    method getTask (line 203) | public DownloadTask getTask(String tag) {
    method hasTask (line 207) | public boolean hasTask(String tag) {
    method removeTask (line 211) | public DownloadTask removeTask(String tag) {
    method addOnAllTaskEndListener (line 215) | public void addOnAllTaskEndListener(XExecutor.OnAllTaskEndListener lis...
    method removeOnAllTaskEndListener (line 219) | public void removeOnAllTaskEndListener(XExecutor.OnAllTaskEndListener ...

FILE: okserver/src/main/java/com/lzy/okserver/OkUpload.java
  class OkUpload (line 41) | public class OkUpload {
    method getInstance (line 46) | public static OkUpload getInstance() {
    class OkUploadHolder (line 50) | private static class OkUploadHolder {
    method OkUpload (line 54) | private OkUpload() {
    method request (line 68) | public static <T> UploadTask<T> request(String tag, Request<T, ? exten...
    method restore (line 80) | public static <T> UploadTask<T> restore(Progress progress) {
    method restore (line 92) | public static List<UploadTask<?>> restore(List<Progress> progressList) {
    method startAll (line 107) | public void startAll() {
    method pauseAll (line 119) | public void pauseAll() {
    method removeAll (line 145) | public void removeAll() {
    method getThreadPool (line 171) | public UploadThreadPool getThreadPool() {
    method getTaskMap (line 175) | public Map<String, UploadTask<?>> getTaskMap() {
    method getTask (line 179) | public UploadTask<?> getTask(String tag) {
    method hasTask (line 183) | public boolean hasTask(String tag) {
    method removeTask (line 187) | public UploadTask<?> removeTask(String tag) {
    method addOnAllTaskEndListener (line 191) | public void addOnAllTaskEndListener(XExecutor.OnAllTaskEndListener lis...
    method removeOnAllTaskEndListener (line 195) | public void removeOnAllTaskEndListener(XExecutor.OnAllTaskEndListener ...

FILE: okserver/src/main/java/com/lzy/okserver/ProgressListener.java
  type ProgressListener (line 29) | public interface ProgressListener<T> {
    method onStart (line 31) | void onStart(Progress progress);
    method onProgress (line 34) | void onProgress(Progress progress);
    method onError (line 37) | void onError(Progress progress);
    method onFinish (line 40) | void onFinish(T t, Progress progress);
    method onRemove (line 43) | void onRemove(Progress progress);

FILE: okserver/src/main/java/com/lzy/okserver/download/DownloadListener.java
  class DownloadListener (line 31) | public abstract class DownloadListener implements ProgressListener<File> {
    method DownloadListener (line 35) | public DownloadListener(Object tag) {

FILE: okserver/src/main/java/com/lzy/okserver/download/DownloadTask.java
  class DownloadTask (line 56) | public class DownloadTask implements Runnable {
    method DownloadTask (line 65) | public DownloadTask(String tag, Request<File, ? extends Request> reque...
    method DownloadTask (line 79) | public DownloadTask(Progress progress) {
    method folder (line 86) | public DownloadTask folder(String folder) {
    method fileName (line 95) | public DownloadTask fileName(String fileName) {
    method priority (line 104) | public DownloadTask priority(int priority) {
    method extra1 (line 109) | public DownloadTask extra1(Serializable extra1) {
    method extra2 (line 114) | public DownloadTask extra2(Serializable extra2) {
    method extra3 (line 119) | public DownloadTask extra3(Serializable extra3) {
    method save (line 124) | public DownloadTask save() {
    method register (line 132) | public DownloadTask register(DownloadListener listener) {
    method unRegister (line 139) | public void unRegister(DownloadListener listener) {
    method unRegister (line 144) | public void unRegister(String tag) {
    method start (line 149) | public void start() {
    method restart (line 174) | public void restart() {
    method pause (line 186) | public void pause() {
    method remove (line 199) | public void remove() {
    method remove (line 204) | public DownloadTask remove(boolean isDeleteFile) {
    method run (line 213) | @Override
    method download (line 330) | private void download(InputStream input, RandomAccessFile out, Progres...
    method postOnStart (line 355) | private void postOnStart(final Progress progress) {
    method postWaiting (line 369) | private void postWaiting(final Progress progress) {
    method postPause (line 383) | private void postPause(final Progress progress) {
    method postLoading (line 397) | private void postLoading(final Progress progress) {
    method postOnError (line 409) | private void postOnError(final Progress progress, final Throwable thro...
    method postOnFinish (line 425) | private void postOnFinish(final Progress progress, final File file) {
    method postOnRemove (line 441) | private void postOnRemove(final Progress progress) {
    method updateDatabase (line 454) | private void updateDatabase(Progress progress) {

FILE: okserver/src/main/java/com/lzy/okserver/download/DownloadThreadPool.java
  class DownloadThreadPool (line 34) | public class DownloadThreadPool {
    method getExecutor (line 41) | public XExecutor getExecutor() {
    method setCorePoolSize (line 56) | public void setCorePoolSize(int corePoolSize) {
    method execute (line 63) | public void execute(Runnable runnable) {
    method remove (line 70) | public void remove(Runnable runnable) {

FILE: okserver/src/main/java/com/lzy/okserver/task/PriorityBlockingQueue.java
  class PriorityBlockingQueue (line 39) | public class PriorityBlockingQueue<E> extends AbstractQueue<E> implement...
    method signalNotEmpty (line 88) | private void signalNotEmpty() {
    method signalNotFull (line 101) | private void signalNotFull() {
    method opQueue (line 111) | private synchronized E opQueue(Node<E> node) {
    method _enqueue (line 121) | private void _enqueue(Node<E> node) {
    method _dequeue (line 144) | private E _dequeue() {
    method fullyLock (line 159) | void fullyLock() {
    method fullyUnlock (line 167) | void fullyUnlock() {
    method PriorityBlockingQueue (line 172) | public PriorityBlockingQueue() {
    method PriorityBlockingQueue (line 176) | public PriorityBlockingQueue(int capacity) {
    method PriorityBlockingQueue (line 182) | public PriorityBlockingQueue(Collection<? extends E> c) {
    method size (line 200) | public int size() {
    method remainingCapacity (line 204) | public int remainingCapacity() {
    method put (line 208) | public void put(E e) throws InterruptedException {
    method offer (line 230) | public boolean offer(E e, long timeout, TimeUnit unit) throws Interrup...
    method offer (line 253) | public boolean offer(E e) {
    method take (line 274) | public E take() throws InterruptedException {
    method poll (line 294) | public E poll(long timeout, TimeUnit unit) throws InterruptedException {
    method poll (line 316) | public E poll() {
    method peek (line 336) | public E peek() {
    method unlink (line 352) | void unlink(Node<E> p, Node<E> trail) {
    method remove (line 362) | public boolean remove(Object o) {
    method contains (line 378) | public boolean contains(Object o) {
    method toArray (line 390) | public Object[] toArray() {
    method toArray (line 404) | @SuppressWarnings("unchecked")
    method clear (line 421) | public void clear() {
    method drainTo (line 436) | public int drainTo(Collection<? super E> c) {
    method drainTo (line 440) | public int drainTo(Collection<? super E> c, int maxElements) {
    method iterator (line 476) | public Iterator<E> iterator() {
    class Itr (line 480) | private class Itr implements Iterator<E> {
      method Itr (line 486) | Itr() {
      method hasNext (line 496) | public boolean hasNext() {
      method nextNode (line 500) | private Node<E> nextNode(Node<E> p) {
      method next (line 509) | public E next() {
      method remove (line 523) | public void remove() {
    method writeObject (line 541) | private void writeObject(java.io.ObjectOutputStream s) throws java.io....
    method readObject (line 562) | private void readObject(java.io.ObjectInputStream s) throws java.io.IO...
    class Node (line 580) | class Node<T> {
      method Node (line 585) | Node(T value) {
      method getPriority (line 589) | public int getPriority() {
      method getValue (line 593) | @SuppressWarnings("unchecked")
      method setValue (line 604) | public void setValue(T value) {

FILE: okserver/src/main/java/com/lzy/okserver/task/PriorityObject.java
  class PriorityObject (line 27) | public class PriorityObject<E> {
    method PriorityObject (line 32) | public PriorityObject(int priority, E obj) {

FILE: okserver/src/main/java/com/lzy/okserver/task/PriorityRunnable.java
  class PriorityRunnable (line 27) | public class PriorityRunnable extends PriorityObject<Runnable> implement...
    method PriorityRunnable (line 29) | public PriorityRunnable(int priority, Runnable obj) {
    method run (line 33) | @Override

FILE: okserver/src/main/java/com/lzy/okserver/task/XExecutor.java
  class XExecutor (line 38) | public class XExecutor extends ThreadPoolExecutor {
    method XExecutor (line 42) | public XExecutor(int corePoolSize, int maximumPoolSize, long keepAlive...
    method XExecutor (line 46) | public XExecutor(int corePoolSize, int maximumPoolSize, long keepAlive...
    method XExecutor (line 50) | public XExecutor(int corePoolSize, int maximumPoolSize, long keepAlive...
    method XExecutor (line 54) | public XExecutor(int corePoolSize, int maximumPoolSize, long keepAlive...
    method afterExecute (line 59) | @Override
    method addOnTaskEndListener (line 89) | public void addOnTaskEndListener(OnTaskEndListener taskEndListener) {
    method removeOnTaskEndListener (line 94) | public void removeOnTaskEndListener(OnTaskEndListener taskEndListener) {
    type OnTaskEndListener (line 98) | public interface OnTaskEndListener {
      method onTaskEnd (line 99) | void onTaskEnd(Runnable r);
    method addOnAllTaskEndListener (line 104) | public void addOnAllTaskEndListener(OnAllTaskEndListener allTaskEndLis...
    method removeOnAllTaskEndListener (line 109) | public void removeOnAllTaskEndListener(OnAllTaskEndListener allTaskEnd...
    type OnAllTaskEndListener (line 113) | public interface OnAllTaskEndListener {
      method onAllTaskEnd (line 114) | void onAllTaskEnd();

FILE: okserver/src/main/java/com/lzy/okserver/upload/UploadListener.java
  class UploadListener (line 29) | public abstract class UploadListener<T> implements ProgressListener<T> {
    method UploadListener (line 33) | public UploadListener(Object tag) {

FILE: okserver/src/main/java/com/lzy/okserver/upload/UploadTask.java
  class UploadTask (line 46) | public class UploadTask<T> implements Runnable {
    method UploadTask (line 53) | public UploadTask(String tag, Request<T, ? extends Request> request) {
    method UploadTask (line 66) | public UploadTask(Progress progress) {
    method priority (line 73) | public UploadTask<T> priority(int priority) {
    method extra1 (line 78) | public UploadTask<T> extra1(Serializable extra1) {
    method extra2 (line 83) | public UploadTask<T> extra2(Serializable extra2) {
    method extra3 (line 88) | public UploadTask<T> extra3(Serializable extra3) {
    method save (line 93) | public UploadTask<T> save() {
    method register (line 98) | public UploadTask<T> register(UploadListener<T> listener) {
    method unRegister (line 105) | public void unRegister(UploadListener<T> listener) {
    method unRegister (line 110) | public void unRegister(String tag) {
    method start (line 115) | public UploadTask<T> start() {
    method restart (line 130) | public void restart() {
    method pause (line 141) | public void pause() {
    method remove (line 154) | public UploadTask<T> remove() {
    method run (line 163) | @Override
    method postOnStart (line 197) | private void postOnStart(final Progress progress) {
    method postWaiting (line 211) | private void postWaiting(final Progress progress) {
    method postPause (line 225) | private void postPause(final Progress progress) {
    method postLoading (line 239) | private void postLoading(final Progress progress) {
    method postOnError (line 251) | private void postOnError(final Progress progress, final Throwable thro...
    method postOnFinish (line 267) | private void postOnFinish(final Progress progress, final T t) {
    method postOnRemove (line 283) | private void postOnRemove(final Progress progress) {
    method updateDatabase (line 296) | private void updateDatabase(Progress progress) {

FILE: okserver/src/main/java/com/lzy/okserver/upload/UploadThreadPool.java
  class UploadThreadPool (line 34) | public class UploadThreadPool {
    method getExecutor (line 41) | public XExecutor getExecutor() {
    method setCorePoolSize (line 56) | public void setCorePoolSize(int corePoolSize) {
    method execute (line 63) | public void execute(Runnable runnable) {
    method remove (line 70) | public void remove(Runnable runnable) {
Condensed preview — 276 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (966K chars).
[
  {
    "path": ".gitignore",
    "chars": 85,
    "preview": "*.iml\n.gradle\n/.idea\n/screenshots\n/local.properties\n.DS_Store\n/build\n/captures\nlibs/\n"
  },
  {
    "path": "LICENSE",
    "chars": 11345,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README.md",
    "chars": 6713,
    "preview": "![](http://7xss53.com1.z0.glb.clouddn.com/markdown/aqyyw.jpg)\n\n## OkGo - 3.0 震撼来袭, 一个基于okhttp的标准RESTful风格的网络框架\n\n> 工程结构全新"
  },
  {
    "path": "build.gradle",
    "chars": 1011,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    re"
  },
  {
    "path": "demo/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "demo/build.gradle",
    "chars": 3160,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion rootProject.ext.compileSdkVersion\n    buildTool"
  },
  {
    "path": "demo/proguard-rules.pro",
    "chars": 7089,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in E:"
  },
  {
    "path": "demo/src/main/AndroidManifest.xml",
    "chars": 4322,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/GApp.java",
    "chars": 6738,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/MainActivity.java",
    "chars": 3356,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/PayFragment.java",
    "chars": 1309,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/WebActivity.java",
    "chars": 2869,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/BaseActivity.java",
    "chars": 6140,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/BaseDetailActivity.java",
    "chars": 8411,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/BaseFragment.java",
    "chars": 3478,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/BaseRecyclerAdapter.java",
    "chars": 3543,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/BaseRxDetailActivity.java",
    "chars": 1418,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/DividerItemDecoration.java",
    "chars": 3930,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/base/MainFragment.java",
    "chars": 4353,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/BitmapDialogCallback.java",
    "chars": 1859,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/DialogCallback.java",
    "chars": 1872,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/EncryptCallback.java",
    "chars": 3287,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/JsonCallback.java",
    "chars": 2801,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/JsonConvert.java",
    "chars": 6054,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/callback/StringDialogCallback.java",
    "chars": 1789,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/ApkModel.java",
    "chars": 1237,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/GankModel.java",
    "chars": 1306,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/GankResponse.java",
    "chars": 1059,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/ItemModel.java",
    "chars": 1233,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/LzyResponse.java",
    "chars": 1312,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/ServerModel.java",
    "chars": 2365,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/model/SimpleResponse.java",
    "chars": 1249,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DesActivity.java",
    "chars": 7179,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DownloadAdapter.java",
    "chars": 9022,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DownloadAllActivity.java",
    "chars": 2827,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DownloadFinishActivity.java",
    "chars": 2844,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DownloadListActivity.java",
    "chars": 13046,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/DownloadingActivity.java",
    "chars": 2828,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/LogDownloadListener.java",
    "chars": 1767,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okdownload/OkDownloadFragment.java",
    "chars": 2939,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/BitmapRequestActivity.java",
    "chars": 2483,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/CacheActivity.java",
    "chars": 6501,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/CommonActivity.java",
    "chars": 4637,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/CookieActivity.java",
    "chars": 3881,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/FormUploadActivity.java",
    "chars": 7002,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/HttpsActivity.java",
    "chars": 4903,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/JsonActivity.java",
    "chars": 3314,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/MethodActivity.java",
    "chars": 10135,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/OkGoFragment.java",
    "chars": 3041,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/RedirectActivity.java",
    "chars": 2526,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/SimpleDownloadActivity.java",
    "chars": 5284,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/SyncActivity.java",
    "chars": 3301,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/TestActivity.java",
    "chars": 3504,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okgo/UpActivity.java",
    "chars": 7434,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/OkRx2Fragment.java",
    "chars": 2419,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/OkRxFragment.java",
    "chars": 1570,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxBitmapActivity.java",
    "chars": 3257,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxCacheActivity.java",
    "chars": 3611,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxCommonActivity.java",
    "chars": 10719,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxFileDownloadActivity.java",
    "chars": 8863,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxFormUploadActivity.java",
    "chars": 10731,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxRetrofitActivity.java",
    "chars": 6745,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/RxUtils.java",
    "chars": 3589,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okrx2/ServerApi.java",
    "chars": 3016,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/LogUploadListener.java",
    "chars": 1731,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/OkUploadFragment.java",
    "chars": 2873,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/UploadAdapter.java",
    "chars": 10726,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/UploadAllActivity.java",
    "chars": 2819,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/UploadFinishActivity.java",
    "chars": 2496,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/UploadListActivity.java",
    "chars": 3836,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/okupload/UploadingActivity.java",
    "chars": 2490,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/supercache/NewsAdapter.java",
    "chars": 2539,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/supercache/NewsCallback.java",
    "chars": 2367,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/supercache/NewsTabFragment.java",
    "chars": 6989,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/supercache/SuperCacheActivity.java",
    "chars": 3434,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/ui/NumberProgressBar.java",
    "chars": 16984,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/ui/ProgressPieView.java",
    "chars": 19789,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/ui/SimpleViewBehavior.java",
    "chars": 13172,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/ui/TranslateUpDownBehavior.java",
    "chars": 4086,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/AnimHelper.java",
    "chars": 4849,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/ApkUtils.java",
    "chars": 4687,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/ColorUtils.java",
    "chars": 1200,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/Convert.java",
    "chars": 2974,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/GlideImageLoader.java",
    "chars": 2207,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/MD5Utils.java",
    "chars": 2581,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/PicassoImageLoader.java",
    "chars": 2173,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/java/com/lzy/demo/utils/Urls.java",
    "chars": 1727,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "demo/src/main/res/drawable/progress_bar_states.xml",
    "chars": 1864,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_base.xml",
    "chars": 1238,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_bitmap_request.xml",
    "chars": 1218,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_cache.xml",
    "chars": 2688,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_cookie.xml",
    "chars": 1935,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_custom_request.xml",
    "chars": 1304,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_download_all.xml",
    "chars": 2542,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_download_details.xml",
    "chars": 4399,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_download_list.xml",
    "chars": 2124,
    "preview": "<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you "
  },
  {
    "path": "demo/src/main/res/layout/activity_file_download.xml",
    "chars": 2719,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_form_upload.xml",
    "chars": 3335,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_https.xml",
    "chars": 1326,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_main.xml",
    "chars": 4271,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_method.xml",
    "chars": 1106,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_recycler.xml",
    "chars": 1819,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_redirect.xml",
    "chars": 1044,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_rx_cache.xml",
    "chars": 1119,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_rx_common.xml",
    "chars": 2184,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_rx_file_download.xml",
    "chars": 3109,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_rx_form_upload.xml",
    "chars": 3558,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_rx_retrofit.xml",
    "chars": 1676,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_super_cache.xml",
    "chars": 2512,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_sync.xml",
    "chars": 1036,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_test.xml",
    "chars": 1624,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_up_text.xml",
    "chars": 2592,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_upload_list.xml",
    "chars": 2751,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/activity_web.xml",
    "chars": 1916,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/fragment_pay.xml",
    "chars": 1593,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/include_data.xml",
    "chars": 2595,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_download_list.xml",
    "chars": 2068,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_download_manager.xml",
    "chars": 4647,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_main_list.xml",
    "chars": 1337,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_main_type.xml",
    "chars": 1198,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_news.xml",
    "chars": 3257,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_no_data.xml",
    "chars": 1156,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_refresh.xml",
    "chars": 1332,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/layout/item_upload_manager.xml",
    "chars": 4615,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/values/attrs.xml",
    "chars": 3758,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/values/colors.xml",
    "chars": 826,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License"
  },
  {
    "path": "demo/src/main/res/values/dimens.xml",
    "chars": 829,
    "preview": "<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you "
  },
  {
    "path": "demo/src/main/res/values/strings.xml",
    "chars": 865,
    "preview": "<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you "
  },
  {
    "path": "demo/src/main/res/values/styles.xml",
    "chars": 1481,
    "preview": "<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you "
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Thu Apr 20 14:50:29 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 855,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "okgo/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "okgo/bintray.gradle",
    "chars": 2545,
    "preview": "apply plugin: 'com.github.dcendents.android-maven'\napply plugin: 'com.jfrog.bintray'\n\nversion = rootProject.ext.versionN"
  },
  {
    "path": "okgo/build.gradle",
    "chars": 553,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion rootProject.ext.compileSdkVersion\n    buildToolsVer"
  },
  {
    "path": "okgo/proguard-rules.pro",
    "chars": 645,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in E:"
  },
  {
    "path": "okgo/src/main/AndroidManifest.xml",
    "chars": 1041,
    "preview": "<!--\n    Copyright 2016 jeasonlzy(廖子尧)\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you "
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/OkGo.java",
    "chars": 8545,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/adapter/AdapterParam.java",
    "chars": 973,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/adapter/CacheCall.java",
    "chars": 3425,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/adapter/Call.java",
    "chars": 1299,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/adapter/CallAdapter.java",
    "chars": 971,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/adapter/DefaultCallAdapter.java",
    "chars": 1051,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/CacheEntity.java",
    "chars": 4187,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/CacheMode.java",
    "chars": 1140,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/BaseCachePolicy.java",
    "chars": 7655,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/CachePolicy.java",
    "chars": 2255,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/DefaultCachePolicy.java",
    "chars": 4117,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/FirstCacheRequestPolicy.java",
    "chars": 3279,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/NoCachePolicy.java",
    "chars": 2635,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/NoneCacheRequestPolicy.java",
    "chars": 3191,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cache/policy/RequestFailedCachePolicy.java",
    "chars": 3345,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/callback/AbsCallback.java",
    "chars": 1565,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/callback/BitmapCallback.java",
    "chars": 1736,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/callback/Callback.java",
    "chars": 2947,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/callback/FileCallback.java",
    "chars": 1575,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/callback/StringCallback.java",
    "chars": 1309,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/convert/BitmapConvert.java",
    "chars": 5379,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/convert/Converter.java",
    "chars": 1136,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/convert/FileConvert.java",
    "chars": 4019,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/convert/StringConvert.java",
    "chars": 1183,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/CookieJarImpl.java",
    "chars": 1705,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/SerializableCookie.java",
    "chars": 7828,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/store/CookieStore.java",
    "chars": 1559,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/store/DBCookieStore.java",
    "chars": 5694,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/store/MemoryCookieStore.java",
    "chars": 3504,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/cookie/store/SPCookieStore.java",
    "chars": 7460,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/BaseDao.java",
    "chars": 13941,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/CacheManager.java",
    "chars": 2863,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/ColumnEntity.java",
    "chars": 2428,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/CookieManager.java",
    "chars": 2064,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/DBHelper.java",
    "chars": 6217,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/DBUtils.java",
    "chars": 3400,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/DownloadManager.java",
    "chars": 2950,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/TableEntity.java",
    "chars": 2996,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/db/UploadManager.java",
    "chars": 2932,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/exception/CacheException.java",
    "chars": 1462,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/exception/HttpException.java",
    "chars": 2237,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/exception/OkGoException.java",
    "chars": 1431,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/exception/StorageException.java",
    "chars": 1550,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/https/HttpsUtils.java",
    "chars": 8016,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/interceptor/HttpLoggingInterceptor.java",
    "chars": 8384,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/HttpHeaders.java",
    "chars": 10011,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/HttpMethod.java",
    "chars": 1492,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/HttpParams.java",
    "chars": 9064,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/Priority.java",
    "chars": 1082,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/Progress.java",
    "chars": 9549,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/Response.java",
    "chars": 3082,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/model/Result.java",
    "chars": 2748,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/DeleteRequest.java",
    "chars": 1464,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/GetRequest.java",
    "chars": 1471,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/HeadRequest.java",
    "chars": 1455,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/OptionsRequest.java",
    "chars": 1488,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/PatchRequest.java",
    "chars": 1459,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/PostRequest.java",
    "chars": 1476,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/PutRequest.java",
    "chars": 1449,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/TraceRequest.java",
    "chars": 1504,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/base/BodyRequest.java",
    "chars": 7349,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  },
  {
    "path": "okgo/src/main/java/com/lzy/okgo/request/base/HasBody.java",
    "chars": 1869,
    "preview": "/*\n * Copyright 2016 jeasonlzy(廖子尧)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not"
  }
]

// ... and 76 more files (download for full content)

About this extraction

This page contains the full source code of the jeasonlzy/okhttp-OkGo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 276 files (889.0 KB), approximately 217.3k tokens, and a symbol index with 1654 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!