Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TonnyL/WhatsNew
🎉 WhatsNew automatically displays a short description of the new features when users update your app
https://github.com/TonnyL/WhatsNew
android-library kotlin kotlin-android whatsnew
Last synced: 27 days ago
JSON representation
🎉 WhatsNew automatically displays a short description of the new features when users update your app
- Host: GitHub
- URL: https://github.com/TonnyL/WhatsNew
- Owner: TonnyL
- License: mit
- Created: 2017-12-01T14:12:54.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T17:22:41.000Z (over 3 years ago)
- Last Synced: 2024-11-23T12:08:26.421Z (about 1 month ago)
- Topics: android-library, kotlin, kotlin-android, whatsnew
- Language: Kotlin
- Homepage:
- Size: 254 KB
- Stars: 473
- Watchers: 13
- Forks: 38
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhatsNew
[![build](https://github.com/TonnyL/WhatsNew/workflows/build/badge.svg)](https://github.com/TonnyL/WhatsNew/actions?query=workflow%3Abuild)
![platform](https://img.shields.io/badge/platform-android-lightgrey.svg)
[![maven central](https://img.shields.io/maven-central/v/io.github.tonnyl/whatsnew)](https://repo1.maven.org/maven2/io/github/tonnyl/whatsnew/)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)`WhatsNew` automatically displays a short description of the new features when users update your app. Inspired by [WhatsNew](https://github.com/BalestraPatrick/WhatsNew).
## Download
### Gradle
Add code below to your **project** level `build.gradle` file:
```
buildscript {
repositories {
mavenCentral()
}
}
```Add code below to your **module** level `build.gradle` file:
```gradle
dependencies {
implementation 'io.github.tonnyl:whatsnew:x.y.z'
}
```## Usage
### Basic
+ Kotlin:```kotlin
WhatsNew.newInstance(
WhatsNewItem("Nice Icons", "Completely customize colors, texts and icons.", R.drawable.ic_heart),
WhatsNewItem("Such Easy", "Setting this up only takes 2 lines of code, impressive you say?", R.drawable.ic_thumb_up),
WhatsNewItem("Very Sleep", "It helps you get more sleep by writing less code.", R.drawable.ic_satisfied_face),
WhatsNewItem("Text Only", "No icons? Just go with plain text.", WhatsNewItem.NO_IMAGE_RES_ID)
).presentAutomatically(this@MainActivity)
```or with DSL style code
```kotlin
val whatsnew = whatsNew {
item {
title = "Nice Icons"
content = "Completely customize colors, texts and icons."
imageRes = R.drawable.ic_heart
}
item {
title = "Such Easy"
content = "Setting this up only takes 2 lines of code, impressive you say?"
imageRes = R.drawable.ic_thumb_up
}
}
whatsnew.presentAutomatically(this)
```
+ Java:```java
WhatsNew.newInstance(
new WhatsNewItem("Nice Icons", "Completely customize colors, texts and icons.", R.drawable.ic_heart),
new WhatsNewItem("Such Easy", "Setting this up only takes 2 lines of code, impressive you say?", R.drawable.ic_thumb_up),
new WhatsNewItem("Very Sleep", "It helps you get more sleep by writing less code.", R.drawable.ic_satisfied_face),
new WhatsNewItem("Text Only", "No icons? Just go with plain text.", WhatsNewItem.NO_IMAGE_RES_ID)
).presentAutomatically(AnotherActivity.this);
```### Customizations
+ Kotlin:```kotlin
val whatsnew = WhatsNew.newInstance(
WhatsNewItem("Nice Icons", "Completely customize colors, texts and icons.", R.drawable.ic_heart),
WhatsNewItem("Such Easy", "Setting this up only takes 2 lines of code, impressive you say?", R.drawable.ic_thumb_up),
WhatsNewItem("Very Sleep", "It helps you get more sleep by writing less code.", R.drawable.ic_satisfied_face),
WhatsNewItem("Text Only", "No icons? Just go with plain text.", WhatsNewItem.NO_IMAGE_RES_ID))with(whatsnew) {
presentationOption = PresentationOption.DEBUGtitleColor = ContextCompat.getColor(this@MainActivity, R.color.colorAccent)
titleText = "What's Up"buttonText = "Got it!"
buttonBackground = ContextCompat.getColor(this@MainActivity, R.color.colorPrimaryDark)
buttonTextColor = ContextCompat.getColor(this@MainActivity, R.color.colorAccent)itemContentColor = Color.parseColor("#808080")
itemTitleColor = ContextCompat.getColor(this@MainActivity, R.color.colorAccent)
}whatsnew.presentAutomatically(this@MainActivity)
```
+ Java:```java
WhatsNew whatsNew = WhatsNew.newInstance(
new WhatsNewItem("Nice Icons", "Completely customize colors, texts and icons.", R.drawable.ic_heart),
new WhatsNewItem("Such Easy", "Setting this up only takes 2 lines of code, impressive you say?", R.drawable.ic_thumb_up),
new WhatsNewItem("Very Sleep", "It helps you get more sleep by writing less code.", R.drawable.ic_satisfied_face),
new WhatsNewItem("Text Only", "No icons? Just go with plain text.", WhatsNewItem.NO_IMAGE_RES_ID));whatsNew.setPresentationOption(PresentationOption.DEBUG);
whatsNew.setTitleColor(ContextCompat.getColor(this, R.color.colorAccent));
whatsNew.setTitleText("What's Up");whatsNew.setButtonText("Got it!");
whatsNew.setButtonBackground(ContextCompat.getColor(this, R.color.colorPrimaryDark));
whatsNew.setButtonTextColor(ContextCompat.getColor(this, R.color.colorAccent));whatsNew.setItemTitleColor(ContextCompat.getColor(this, R.color.colorAccent));
whatsNew.setItemContentColor(Color.parseColor("#808080"));whatsNew.presentAutomatically(AnotherActivity.this);
```## Thanks to
[Patrick Balestra](https://github.com/BalestraPatrick)## License
WhatsNew is under the MIT license. See the [LICENSE](LICENSE) for more info.