Skip to content

Commit

Permalink
Readme added lib options (pretty format / override)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deishelon committed Jan 26, 2019
1 parent 2393bfd commit 8f60add
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ Step 2. Subscribe to the mission updates

Step 3. Start download

```java
```kotlin
RxDownload.start(mission).subscribe()
```

Stop download

```java
```kotlin
RxDownload.stop(mission).subscribe()
```

Expand Down Expand Up @@ -92,6 +92,34 @@ DownloadConfig.init(builder)

For more APIs please see RxDownload.kt


### Override
You can configure `Mission` so that if file exists it will be re-downloaded.
If not specified - false

```kotlin
val mission = Mission(...)
mission.overwrite = Boolen (true/false)
```

### Pretty format
Ypu can download status with n decimal point

Default is 1 decimal point

```kotlin
val percent = status.percentPretty(INT_DECIMAL_POINT_FORMAT) // returns `String` i.e 12.2

val rawPercent = status.percent() // returns `Double`

val totalSize = status.formatTotalSize(INT_DECIMAL_POINT_FORMAT) // returns `String` i.e 22.2 MB

val dwnSoFarSize = status.formatDownloadSize(INT_DECIMAL_POINT_FORMAT) // returns `String` i.e 44.4 MB

val progress = status.formatString(INT_DECIMAL_POINT_FORMAT) // returns `String` i.e 44.4 MB / 102.3 MB
```


### Configuration (optional)

Add your configuration when APP starts up, like this:
Expand Down

0 comments on commit 8f60add

Please sign in to comment.