Git Product home page Git Product logo

errorxcode / modernonboarding Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 4.0 344 KB

An android library to implement Walkthrough / Introduction / OnBoarding screen to your app. Make your app cool using this library

Home Page: https://www.xcoder.tk

License: Apache License 2.0

Java 100.00%
android-library onboarding-screen modern-ui welcome-screen material-design modern-onboarding walkthrough

modernonboarding's Introduction

Modern onboarding library

Android OS Languages-Java verison Instagram - x0.rahil GitHub Repo stars

thumbmail

Implimentation

In your project build.gradle (root of project)

 allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

In your module build.gradle (usually in app)

dependencies {
	        implementation 'com.github.ErrorxCode:ModernOnboarding:v1.5'
	}

Usage

Also Compatible Androidx

Create a list of OnBoardingPage passing an image, a title and a description as an argument.

List<OnBoardingPage> pages = new ArrayList<>();
pages.add(new OnBoardingPage(R.drawable.image1,"Title for page 1 goes here....","Description for page 1 goes here...."));
pages.add(new OnBoardingPage(R.drawable.image2,"Title for page 2 goes here....","Description for page 2 goes here...."));
pages.add(new OnBoardingPage(R.drawable.image3,"Title for page 3 goes here....","Description for page 3 goes here...."));

Note : You must have minimum of 3 pages & maximum of 6.

You can also use its second constructor, which also takes bgColor, txtColor as an argument, if you want to customise the page.

new OnBoardingPage(R.drawable.sound_wave, Color.BLACK,Color.WHITE,"title here..","description here...");

Finally, pass that list to OnBoarder.setupOnBoarding(). You can also pass null as 3rd argument.

OnBoarder.setupOnBoarding(this, pages, new OnFinishLastPage() {
            @Override
            public void onNext() {
                // this is called when user click finish button on last page.
            }
        });

You don't neet to do anything else. just put this code in your launching activity and the library will automatically start the onboarding screen when user opens the app for the first time

Full example

Main activity (Launching activity) :

public class OnBoardingActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.activity_main)  ---> Remove this line
        List<OnBoardingPage> pages = new ArrayList<>();
        pages.add(new OnBoardingPage(R.drawable.image1,"Title for page 1 goes here....","Description for page 1 goes here...."));
        pages.add(new OnBoardingPage(R.drawable.image2,"Title for page 2 goes here....","Description for page 2 goes here...."));
        pages.add(new OnBoardingPage(R.drawable.image3,"Title for page 3 goes here....","Description for page 3 goes here...."));
        
        OnBoarder.setupOnBoarding(this, pages, new OnFinishLastPage() {
            @Override
            public void onNext() {
                // this is called when user click finish button on last page.
            }
    }
}

Suport us

Support me to keep this library alive. If you like my hard work, please give this repo a star ๐ŸŒŸ & Nothing else. Also check my other repos. Thank you ! .

Powered by ๐Ÿ’“

Clorabase

A account-less platform as a service for android apps. (PaaS)

modernonboarding's People

Contributors

errorxcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

modernonboarding's Issues

Next and Finish button never called

Followed instructions.
Finish button (onNext) never gets called so you can never return to the Main Menu. Currently not fit for purpose. Shame, because the code design is quite elegant.

    OnBoarder.startOnBoarding(this, pages, new OnFinishLastPage() {
        @Override
        public void onNext() {

            Log.v("OnBoarding","startOnBoarding onNext called");
            OnBoardingActivity.this.startActivity(new Intent(OnBoardingActivity.this, MenuActivity.class));
        }
    });

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.