Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/warting/In-App-Update-Compose
A compose friendly way to deal with in app updates on android
https://github.com/warting/In-App-Update-Compose
android compose in-app-updates jetpack-compose
Last synced: 2 months ago
JSON representation
A compose friendly way to deal with in app updates on android
- Host: GitHub
- URL: https://github.com/warting/In-App-Update-Compose
- Owner: warting
- License: mit
- Created: 2021-10-04T08:40:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-02T03:29:11.000Z (7 months ago)
- Last Synced: 2024-07-02T05:44:00.147Z (7 months ago)
- Topics: android, compose, in-app-updates, jetpack-compose
- Language: Kotlin
- Homepage:
- Size: 405 KB
- Stars: 66
- Watchers: 4
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - warting/In-App-Update-Compose - A compose friendly way to deal with in app updates on android (Kotlin)
README
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.warting.in-app-update/in-app-update-compose/badge.png)](https://maven-badges.herokuapp.com/maven-central/se.warting.in-app-update/in-app-update-compose)
[![Crowdin](https://badges.crowdin.net/in-app-update-compose/localized.svg)](https://crowdin.com/project/in-app-update-compose)# In-App update compose
A way to make in app updates in compose
## How to include in your project
The library is available via MavenCentral:
```
allprojects {
repositories {
// ...
mavenCentral()
}
}
```Snapshots of the development version are available in Sonatype's snapshots repository.
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/se.warting.in-app-update/in-app-update-compose?server=https%3A%2F%2Foss.sonatype.org)](https://oss.sonatype.org/content/repositories/snapshots/se/warting/in-app-update/in-app-update-compose/)
```groovy
allprojects {
repositories {
// ...
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
}
```Add it to your module dependencies:
```
dependencies {
implementation("se.warting.in-app-update:in-app-update-compose:")
}
```## How to use
All you need to do is to use `RequireLatestVersion`:
```
@Composable
fun MainView() {
RequireLatestVersion {
Welcome()
}
}
```
For a full implementation
see: [Full sample](app/src/main/java/se/warting/appupdatecompose/UiActivity.kt)or if you want more granular control:
```
@Composable
fun InAppUpdate() {
val updateState = rememberInAppUpdateState()
when (val result = updateState.appUpdateResult) {
is AppUpdateResult.NotAvailable -> NotAvailable()
is AppUpdateResult.Available -> Available(result)
is AppUpdateResult.InProgress -> InProgress(result)
is AppUpdateResult.Downloaded -> Downloaded(result)
}
}
```For a full implementation
see: [Full sample](app/src/main/java/se/warting/appupdatecompose/MainActivity.kt)