• Stars
    star
    475
  • Rank 92,465 (Top 2 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎉 WhatsNew automatically displays a short description of the new features when users update your app

WhatsNew

build platform maven central license

WhatsNew automatically displays a short description of the new features when users update your app. Inspired by 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:

dependencies {
    implementation 'io.github.tonnyl:whatsnew:x.y.z'
}

Usage

Basic

  • 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

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:
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:
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.DEBUG

        titleColor = 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:
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

License

WhatsNew is under the MIT license. See the LICENSE for more info.

More Repositories

1

Awesome_APIs

:octocat: A collection of APIs
11,690
star
2

PaperPlane

📚 PaperPlane - An Android reading app, including articles from Zhihu Daily, Guokr Handpick and Douban Moment.
Kotlin
1,140
star
3

Espresso

🚚 Espresso is an express delivery tracking app designed with Material Design style, built on MVP(Model-View-Presenter) architecture with RxJava2, Retrofit2, Realm database and ZXing
Java
1,087
star
4

Spark

🎨 An Android library to create gradient animation like Instagram&Spotify
Kotlin
671
star
5

Mango

🏀 An Android app for dribbble.com
Kotlin
655
star
6

Light

🍭 The usual Snackbar, but elegant
Kotlin
547
star
7

Charles

[WIP]✨ Charles is a local multi-media selector for Android
Kotlin
429
star
8

FanfouHandpick

📖 A Fanfou Handpick Client Developed by Kotlin
Kotlin
227
star
9

Zhihu_Zhuanlan_APIs

知乎专栏API分析
190
star
10

Windary

🎓 My solutions to LeetCode problems written in Go, Java, JavaScript, Kotlin, Python, Rust & Swift.
Swift
189
star
11

Translator

📘 Translator-A translation app based on Android platform
Java
67
star
12

Reader

📚 MVP + Volley + Gson, 内容包含了糗事百科,煎蛋,和内涵段子
Java
58
star
13

Latticify

[DEPRECATED]💬 An Android app for Slack.
Kotlin
42
star
14

awesome-courses-of-chinese-university

中国大学课程资料
30
star
15

GaussianBlur

Android Gaussian Blur using RenderScript
Java
26
star
16

wukong

A command-line tool for browsing GitHub trending written by Rust. [DEPRECATED]
Rust
24
star
17

Packman

A mobile application made for managing GitLab CI/CD jobs, demonstrating how to implement some latest technologies in mobile software development.
Kotlin
16
star
18

Dash

Design patterns in Kotlin and Swift.
Swift
12
star
19

Telecode

Country&Region&Telecode data in Chinese&English
11
star
20

CircleProgressBar

A circel progress bar library on Android
Java
6
star
21

WaterPal

🥛 WaterPal - Remind you to drink water at regular time.
Java
5
star
22

toolman

A collection of tools
Shell
5
star
23

Moka-Feedback

Moka is a mobile app for GitHub.
4
star
24

cathem

Dart
4
star
25

MyPythonLearnProject

My Project of Learning Python
Python
3
star
26

TDate

Calculate the date in a way that is similar to Windows system
C++
2
star
27

TonnyL

1
star
28

ActionsFlow

1
star