Skip to content

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

License

Notifications You must be signed in to change notification settings

ErrorxCode/ModernOnboarding

Repository files navigation

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)