Search in sources :

Example 1 with PaperOnboardingEngine

use of com.ramotion.paperonboarding.PaperOnboardingEngine in project paper-onboarding-android by Ramotion.

the class PaperOnboardingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.onboarding_main_layout);
    PaperOnboardingEngine engine = new PaperOnboardingEngine(findViewById(R.id.onboardingRootView), getDataForOnboarding(), getApplicationContext());
    engine.setOnChangeListener(new PaperOnboardingOnChangeListener() {

        @Override
        public void onPageChanged(int oldElementIndex, int newElementIndex) {
            Toast.makeText(getApplicationContext(), "Swiped from " + oldElementIndex + " to " + newElementIndex, Toast.LENGTH_SHORT).show();
        }
    });
    engine.setOnRightOutListener(new PaperOnboardingOnRightOutListener() {

        @Override
        public void onRightOut() {
            // Probably here will be your exit action
            Toast.makeText(getApplicationContext(), "Swiped out right", Toast.LENGTH_SHORT).show();
        }
    });
}
Also used : PaperOnboardingOnChangeListener(com.ramotion.paperonboarding.listeners.PaperOnboardingOnChangeListener) PaperOnboardingEngine(com.ramotion.paperonboarding.PaperOnboardingEngine) PaperOnboardingOnRightOutListener(com.ramotion.paperonboarding.listeners.PaperOnboardingOnRightOutListener)

Aggregations

PaperOnboardingEngine (com.ramotion.paperonboarding.PaperOnboardingEngine)1 PaperOnboardingOnChangeListener (com.ramotion.paperonboarding.listeners.PaperOnboardingOnChangeListener)1 PaperOnboardingOnRightOutListener (com.ramotion.paperonboarding.listeners.PaperOnboardingOnRightOutListener)1