Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiryl Rozau committed Mar 9, 2019
1 parent 66ed0f0 commit 5ec5205
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ You must apply version of library for you project base on compileSdkVersion:

```groovy
android {
compileSdkVersion 28
compileSdkVersion 28 // 28 is required minimum
}
dependencies {
Expand All @@ -19,6 +18,9 @@ dependencies {
// Without AndroidX
implementation "com.kirich1409:strict-mode-compat:28.0.0"
// Kotlin Extensions
implementation "com.kirich1409:strict-mode-compat-kotlin:28.1.1"
}
```

Expand Down Expand Up @@ -70,24 +72,41 @@ public class SampleApplication extends Application {
}
```

Download
--------

```groovy
compile 'com.kirich1409:strict-mode-compat:28.1.0'
```

Kotlin Extensions
-----------------

For project that using Kotlin you can add

```groovy
compile 'com.kirich1409:strict-mode-compat-kotlin:28.1.0'
Or you can use Kotlin extension and configure StrictModeCompat via DSL
###### SampleApplication.kt ######
```kotlin
class SampleApplicationKt : Application() {

override fun onCreate() {
super.onCreate()
initStrictMode(enable = BuildConfig.DEVELOPER_MODE, enableDefaults = false) {
threadPolicy {
resourceMismatches = true
customSlowCalls = true
unbufferedIo = true

penalty {
log = true
}
}

vmPolicy {
fileUriExposure = true
leakedRegistrationObjects = true
cleartextNetwork = true
cleartextNetwork = true
untaggedSockets = true
contentUriWithoutPermission = true

penalty {
log = true
}
}
}
}
}
```

instead of dependency described in [Download](#Download)

License
-------

Expand Down

0 comments on commit 5ec5205

Please sign in to comment.