From 10a7b458079287721e1a52a05dfa42a732b69bde Mon Sep 17 00:00:00 2001 From: Tonyo Francis Date: Thu, 19 Apr 2018 19:30:24 -0400 Subject: [PATCH] retry on network gain fixes Version 2.0.0-RC16 - Fix for retry on network gain. Thanks to dougkeen - Library updates --- CHANGELOG | 4 ++++ README.md | 10 +++++----- .../tonyodev/fetch2/downloader/FileDownloaderImpl.kt | 4 ++-- versions.gradle | 8 ++++---- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 65bac09a..49bbebae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 2.0.0-RC16 +- Fix for retry on network gain. Thanks to dougkeen +- Library updates + Version 2.0.0-RC15 - updated Fetch Migrator diff --git a/README.md b/README.md index 25cbda94..6fdaa1f7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Build Status](https://travis-ci.org/tonyofrancis/Fetch.svg?branch=v2)](https://travis-ci.org/tonyofrancis/Fetch) -[ ![Download](https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=2.0.0-RC15) ](https://bintray.com/tonyofrancis/maven/fetch2/2.0.0-RC15/link) +[ ![Download](https://api.bintray.com/packages/tonyofrancis/maven/fetch2/images/download.svg?version=2.0.0-RC16) ](https://bintray.com/tonyofrancis/maven/fetch2/2.0.0-RC16/link) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Networking-blue.svg?style=flat)](https://android-arsenal.com/details/1/5196) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/tonyofrancis/Fetch/blob/master/LICENSE) @@ -45,7 +45,7 @@ How to use Fetch Using Fetch is easy! Just add the Gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetch2:fetch2:2.0.0-RC15" +implementation "com.tonyodev.fetch2:fetch2:2.0.0-RC16" ``` Next, get an instance of Fetch using the builder, and request a download. @@ -244,7 +244,7 @@ to use the OkHttp Downloader instead. You can create your own custom downloaders if necessary. See the Java docs for details. ```java -implementation "com.tonyodev.fetch2downloaders:fetch2downloaders:2.0.0-RC15" +implementation "com.tonyodev.fetch2downloaders:fetch2downloaders:2.0.0-RC16" ``` Set the OkHttp Downloader for Fetch to use. ```java @@ -265,7 +265,7 @@ If you would like to take advantage of RxJava2 features when using Fetch, add the following gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetch2rx:fetch2rx:2.0.0-RC15" +implementation "com.tonyodev.fetch2rx:fetch2rx:2.0.0-RC16" ``` RxFetch makes it super easy to enqueue download requests and query downloads using rxJava2 functional methods. @@ -297,7 +297,7 @@ Fetch1 Migration Migrate downloads from Fetch1 to Fetch2 using the migration assistant. Add the following gradle dependency to your application's build.gradle file. ```java -implementation "com.tonyodev.fetchmigrator:fetchmigrator:2.0.0-RC15" +implementation "com.tonyodev.fetchmigrator:fetchmigrator:2.0.0-RC16" ``` Then run the Migrator. diff --git a/fetch2/src/main/java/com/tonyodev/fetch2/downloader/FileDownloaderImpl.kt b/fetch2/src/main/java/com/tonyodev/fetch2/downloader/FileDownloaderImpl.kt index c2dd9d36..2b1bdcc8 100644 --- a/fetch2/src/main/java/com/tonyodev/fetch2/downloader/FileDownloaderImpl.kt +++ b/fetch2/src/main/java/com/tonyodev/fetch2/downloader/FileDownloaderImpl.kt @@ -108,11 +108,11 @@ class FileDownloaderImpl(private val initialDownload: Download, Thread.sleep(500) } catch (e: InterruptedException) { logger.e("FileDownloader", e) - break; + break } if (!networkInfoProvider.isNetworkAvailable) { disconnectDetected = true - break; + break } } if (disconnectDetected) { diff --git a/versions.gradle b/versions.gradle index 985a84b9..c69ab7bb 100644 --- a/versions.gradle +++ b/versions.gradle @@ -1,5 +1,5 @@ ext { - kotlin_version = '1.2.31' + kotlin_version = '1.2.40' okhttp_version = '3.10.0' android_support_version = '27.1.1' constraint_layout_version = "1.1.0" @@ -11,11 +11,11 @@ ext { library_compile_version = 27 library_target_version = 27 library_build_tools_version = "27.0.3" - gradle_tools_version = "3.1.0" + gradle_tools_version = "3.1.1" rxJava2_version = "2.1.12" rxAndroid2_version = "2.0.2" timber_version = "4.7.0" novoda_bintray_version = "0.8.0" - library_version = "2.0.0-RC15" - library_version_code = 16 + library_version = "2.0.0-RC16" + library_version_code = 17 } \ No newline at end of file