Skip to content

Commit

Permalink
[FIX] readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Arencibia committed Jun 26, 2019
1 parent 884b7b8 commit 559fa0a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ implementation 'com.github.adrian011494:apklisupdate:$VERSION'
```
### Usage

* Check current app
```kotlin
ApklisUpdate.hasAppUpdate(this, callback = object : UpdateCallback {

override fun onNewUpdate(appUpdateInfo: AppUpdateInfo) {

//Start info fragment or do what you want.
supportFragmentManager.beginTransaction().add(
R.id.container, ApklisUpdateFragment.newInstance(
updateInfo = appUpdateInfo,
actionsColor = ContextCompat.getColor(this@MainActivity, R.color.colorAccent)
)
).commit()

}

override fun onOldUpdate(appUpdateInfo: AppUpdateInfo) {
Log.d("MainActivity", "onOldUpdate $appUpdateInfo")
}

override fun onError(e: Throwable) {
e.printStackTrace()
}
})
```
* Check external app
```kotlin
ApklisUpdate.hasAppUpdate("APP_PACKAGE_NAME", callback = object : UpdateCallback {...})
```
### Contributing
All contributions are welcome!!!

0 comments on commit 559fa0a

Please sign in to comment.