Nimrodda / WizarDroid

*Deprecated* A lightweight Android library for creating step by step wizards

Home Page:https://wizardroid.codepond.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WizardFragment.onStepChanged() does not notify about all changes

hsz opened this issue · comments

Let's assume we've got this simple implementation:

public class ProfileWizardFragment extends WizardFragment {

    @Override
    public void onStepChanged() {
        super.onStepChanged();
        Log.d("onStepChanged()", String.valueOf(wizard.getCurrentStepPosition()));
    }

    @OnClick(R.id.next_button)
    public void next() {
        wizard.goNext();
        Log.d("next()", String.valueOf(wizard.getCurrentStepPosition()));
    }

}

When user clicks next_button once, there is next() method called and then onStepChanged() method. Next step from the queue is presented.

Log result:

D/onStepChanged(): 1
D/next(): 1

But when user clicks on the button few times very quickly, onStepChanged() is called only once at the beginning, meanwhile next() catches all of the events:

D/onStepChanged(): 2
D/next(): 2
D/next(): 3
D/next(): 4
D/next(): 5

In fact, view is updating properly on the time (we can see all of the views: 2, 3, 4, 5 during the clicking).

And what happens if you fast swipe the pages? Did you test?

@Nimrodda Thank you for the quick response.

It works fine with swiping the pages.

In fact I've also observed that it doesn't notify about all of the subpages when you go back with back button.

onStepChanged() is called for the 5 element even if you press back button 4 times and finally you are on the 2 element. After a delay and pressing back button once again, it logs 1:

D/onStepChanged(): 5
D/onStepChanged(): 1

Any plans for fixing any of the bugs in this project ?

Hello @hsz and thank you for your feedback. WizarDroid is an open source project developed in my spare time (which is extremely limited these days). You may contribute a fix yourself if you're unsatisfied of the progress done in the project. Any contribution is highly appreciated. Thanks!