Giter VIP home page Giter VIP logo

allaboard's Introduction

All Aboard!

Build Status Download

Create onboarding flows for your Android apps using a clean and simple Kotlin DSL.

Download

Add the following to your app's build.gradle.

dependencies {
    implementation 'me.tylerbwong:allaboard:1.1.0'
}

Basic Usage

Adding an onboarding flow is as easy as adding this call to your Activity's onCreate() (or Fragment's onCreateView()).

onboarding {
    
}

Then add some pages!

onboarding {
    page {
        
    }
}

Here's a complete example.

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    
    ...
    
    // Use a PageNavigator to programmatically change pages
    val navigator = onboarding {
        backgroundColor = R.color.colorPrimary
        showIndicator = true
        onPageChangeListener = ... // Set an onPageChangeListener to listen to page changes
        navigationView = ... // Set a custom navigation view to handle switching pages
        
        // Specify contents with resource ids or strings
        page {
            imageRes = R.drawable.page_one_image
            titleRes = R.string.page_one_title
            subTitleText = "This is a subtitle."
        }
    
        page {
            imageUrl = "https://images.com/page_two.png"
            titleText = "This is a train."
            subTitleRes = R.string.page_two_subtitle
        }
    
        page {
            customView = pageThreeView // Use inflated custom views
        }
    
        page {
            customViewRes = R.layout.page_four // Or just pass a layout resource id!
        }
    
        onFinish {
            Toast.makeText(this@AllAboardActivity, "We're all done here!", Toast.LENGTH_LONG).show()
        }
    }
}

Acknowledgements

This library was heavily inspired by zsmb13/MaterialDrawerKt. Definitely go check it out!

Other libraries used in this project

License

Copyright 2018 Tyler Wong

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.