Skip to content

flopezluksenberg/android-lib-welcome

Repository files navigation

Android Welcome Library

Android Welcome Library is a simple android library written in kotlin that allows show a fancy welcome in your app with fews (and easy) configurations.

Sample

alt text

Gradle Configuration

  1. Go to your root build.gradle file and add next line:
allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
    }
}
  1. Next, go to you application level build.gradle file and add dependency:
dependencies {
    ...
    compile 'com.github.flopezluksenberg:android-lib-welcome:v1.0.0'
    ...
}
  1. Sync gradle files.
  2. Enjoy it!

App Configuration

To configure your welcome intro you need follow next steps:

  1. Create an android application class in your app if you don't have one yet
  2. In onCreate method of your application class, initialize welcome library with welcome steps knowing that welcome step definition is like next code:

WelcomeStep definition

data class WelcomeStep(val title: String,
                       val description: String,
                       val backgroundColor: Int,
                       val imageResourceId: Int)

Example of WelcomeStep can be:

private val welcomeStep1 = WelcomeStep(
    "A very nice title for this tab!",
    "A very nice description in this tab",
    ContextCompat?.getColor(this, android.R.color.holo_red_dark),
    R.drawable.an_icon_in_the_middle_of_screen
)

Application class sample

class YourApplicationClass : Application(){
    private val welcomeSteps : Array<WelcomeStep> = arrayOf(WelcomeStep(...), WelcomeStep(...), ...)
    //...
    override fun onCreate() {
        WelcomeApi.init(this, welcomeSteps)
    }
    //...
}
  1. (Optional) Set welcome activity theme. To perform this you must add next code in your app AndroidManifest.xml
<application ...>
    //..
    <activity android:name="com.flopezluksenberg.welcome.ui.WelcomeActivity" android:theme="MyVeryFancyTheme!"/>
    //..
</application>

Note: It is recommended to use theme that inherits from some variant of NoActionBar theme

About

Welcome library created for easychange

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages