drozdzynski / Steppers

Steppers view library for Android, based on Google Material design guidelines
767 stars 106 forks source link

Is there a way to keep track of user´s progress ? #20

Closed vayalasp closed 7 years ago

vayalasp commented 7 years ago

I was trying to find a way to keep track of the users progress in the steps, for example, If my steps are too log, I want to let users to close, save his progress and next time they open, open it in the position they were las time. For that I need to be able to focus any step and not necesarily the fisrt one. How can I do that?

Bu the way, VERY NICE LIBRARY....

drozdzynski commented 7 years ago

For now, it's not available, but I will start making fixes and additions in few days, finally I have time to work on it, because of Christmas.

vayalasp commented 7 years ago

Thanks man. Meanwhile any clue on how can I do that myself?

olganazo commented 7 years ago

Hi, Thank you for this great lib. When do you plan to release this enhancement ?

In the same idea as keeping track of user's process it would be great to have a onContinueAction in order to be able to initialize when starting a new step. This could also help to keep track ! It would be nice too to be able to change the continue/cancel/finish labels.

Thank you again.

drozdzynski commented 7 years ago

Currently, I'm working on 2 projects, that's why I don't have much time, but I will try to do it in first days of February.

olganazo commented 7 years ago

Great thank you very much. I've learned a lot reading your lib.

Thanks

Nathalie

Le 25 janv. 2017 8:19 AM, "Krystian Drożdżyński" notifications@github.com a écrit :

Currently, I'm working on 2 projects, that's why I don't have much time, but I will try to do it in first days of February.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/drozdzynski/Steppers/issues/20#issuecomment-275036621, or mute the thread https://github.com/notifications/unsubscribe-auth/AYKonizwqSbxX73x_ZKckhVRYkrP_pgbks5rVvdvgaJpZM4LP0uT .

olganazo commented 7 years ago

Hi

I've done it. I have created a OnContinueAction class identical to the OnCancel / OnFinishAction.

In stepperView, in the config class I have added


private OnContinueAction onContinueAction;
 public Config setOnContinueAction(OnContinueAction onContinueAction) {
            this.onContinueAction = onContinueAction;
            return this;
 }

public OnContinueAction getOnContinueAction() {
            return onContinueAction;
}

I have modified the SteppersAdapter to add a call to onContinue in the ButtonContunue Listener

  holder.buttonContinue.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(position == getItemCount() - 1) config.getOnFinishAction().onFinish();
                else {
                    config.getOnContinueAction().onContinue();
                    nextStep();
                }
            }
        });

And now I just have to declare the onContinue in my activity, this is where I can keep track of user progression and do inits

 steppersViewConfig.setOnContinueAction(new OnContinueAction() {
            @Override
            public void onContinue() {
                mCurrentStep++;
                initStep();
            }
        });