Giter Club home page Giter Club logo

wizardroid's People

Contributors

alexander-- avatar denny0223 avatar geertw avatar intrications avatar julianlazarus avatar nimrodda avatar virtualvoid avatar

Stargazers

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

Watchers

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

wizardroid's Issues

Add support for Parcelable ContextVariable

First of all thank you for this great library.

I'm using a class which implements Parcelable interface. It is not possible to extend Parcelable because it already extends another class.

I want to use this class as a ContextVariable so I changed the Wizard class to support classes which implement Parcelable interface. This can be done by using "Parcelable.class.isAssignableFrom(field.getType())"

Maybe you can include this in a future release.

Gradle build using maven central fails: "cannot find symbol"

Hi,

I tried to add the maven deposit dependency to Gradle file, I see the aar file in the cache folder (so download part works), but it seems the file is invisible at the compilation step. So it can't compile the project and say I need some dependency.

Same if aar downloaded and put in the libs folder. Seems ignored by the system. Don't know if it's me or the lib.

Doesn't work both in Android Studio and command line.

I tried to delete the Gradle cache (in the home folder), but it changed nothing.

Any idea?

Regards

Remove unecessary dependance

Hi,

I am looking to your next step blocker update.

I don't really understand why you add the Otto lib.

E.g from what I have seen, all the Bus communication between WizardFlow and WizardFragment can be replaced by a simple callback as WizardFragment contains an instance of WizardFlow.

I have not checked everywhere but I am sure Bus can be avoided, BroadcastReceiver may be used if callbacks are not possible.

The reason of why I think adding a dependence is not a good idea is imagine what happened if you are already relying on Otto in your project, and if your lib is not including the last version (which will be the case each time Otto will be updated as Gradle will get the last version for your project, version which won't correspond to the included version of this lib until you update it), then may be it will work, and may be not, with strange errors.

Of course it will be possible to recompile or use some little Gradle tricks to make it work but it makes the dev work more complex for a small advantage.

Otto is amazing to improve the code, and the rapidity of coding, but for another llb I am not sure it s the best option.

What do you think?

How to use ActionBarSherlock with WizarDroid?

I use ActionBarSherlock in my project and I'd like to use it with the wizard as well. However, ABS requires the activities to extend SherlockFragmentActvity which is incompatible with your WizardActivity.
How could I use it anyway?

Problem with update of EditText

When we calculate some information in field 1, we have to modify and propose some parameters to the user (according to the country he selected for example)
and we have to set some edittext on the second step

we can't modfiy them in onCreateView otherwise field isn't updated (and keep the default value)

we have to put that update in the onResume

I think it would be a good idea to put it somewhere (like in the faq or in an example)

please see the example on http://sharesend.com/1ot9wvby

The part of the code which show the issue is in FormStep3

//Set your layout here
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.step_summary, container, false);
    TextView firstnameTv = (TextView) v.findViewById(R.id.firstname);

    // work because it is a textview
    firstnameTv.setText(firstname);



    txtfirstnamenotwork = (EditText) v.findViewById(R.id.txtfirstnamenotwork);
    txtfirstnamework = (EditText) v.findViewById(R.id.txtfirstnamework);

    // do not work in onCreateView
    txtfirstnamenotwork.setText(firstname);

    return v;
}

@Override
public void onResume()
{
    super.onResume();

    // work if set in onResume
    txtfirstnamework.setText(firstname);
}

Creating custom wizard layout leads to nullpointerexception

Here's my code of BasicWizardLayout-inherited class

package im.point.torgash.mecicinealert;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import org.codepond.wizardroid.WizardFlow;
import org.codepond.wizardroid.layouts.BasicWizardLayout;

import im.point.torgash.mecicinealert.loginwizard.LoginWizardStep0;
import im.point.torgash.mecicinealert.loginwizard.LoginWizardStep1;
import im.point.torgash.mecicinealert.loginwizard.LoginWizardStep2;
import im.point.torgash.mecicinealert.loginwizard.LoginWizardStep3;

/**
 * Created by ivanblch on 11.01.2015.
 */
public class LoginWizardLayout extends BasicWizardLayout {
    Button nextButton;
    Button previousButton;
    /**
     * Note that initially BasicWizardLayout inherits from {@link android.support.v4.app.Fragment} and therefore you must have an empty constructor
     */
    public LoginWizardLayout() {
        super();
    }
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View wizardLayout = inflater.inflate(R.layout.my_wizard_layout, container, false);
        nextButton = (Button) wizardLayout.findViewById(R.id.wizard_next_button);
        nextButton.setOnClickListener(this);
        previousButton = (Button) wizardLayout.findViewById(R.id.wizard_previous_button);
        previousButton.setOnClickListener(this);

        return wizardLayout;
    }
    //You must override this method and create a wizard flow by
    //using WizardFlow.Builder as shown in this example
    @Override
    public WizardFlow onSetup() {
        /* Optionally, you can set different labels for the control buttons
        setNextButtonLabel("Advance");
        setBackButtonLabel("Return");
        setFinishButtonLabel("Finalize"); */
        setNextButtonText("Далее");
        setBackButtonText("Назад");
        setFinishButtonText("Завершить");

        return new WizardFlow.Builder()
                .addStep(LoginWizardStep0.class)
                .addStep(LoginWizardStep1.class)           //Add your steps in the order you want them
                .addStep(LoginWizardStep2.class)           //to appear and eventually call create()
                .addStep(LoginWizardStep3.class)
                .create();                              //to create the wizard flow.
    }
    @Override
    public void onClick(View v) {
        switch(v.getId()) {
            case R.id.wizard_next_button:
                //Tell the wizard to go to next step
                wizard.goNext();
                break;
            case R.id.wizard_previous_button:
                //Tell the wizard to go back one step
                wizard.goBack();
                break;
        }
        updateWizardControls();
    }

    private void updateWizardControls() {
        previousButton.setEnabled(!wizard.isFirstStep());
        nextButton.setText(wizard.isLastStep()
                ? R.string.action_finish
                : R.string.action_next);
    }
}

And this is what I get in LogCat:

 java.lang.RuntimeException: Unable to resume activity {im.point.torgash.mecicinealert/im.point.torgash.mecicinealert.MainActivity}: java.lang.NullPointerException
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2964)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2993)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
            at android.os.Handler.dispatchMessage(Handler.java:110)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:5299)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.NullPointerException
            at org.codepond.wizardroid.layouts.BasicWizardLayout.updateWizardControls(BasicWizardLayout.java:111)
            at org.codepond.wizardroid.layouts.BasicWizardLayout.onResume(BasicWizardLayout.java:65)
            at android.support.v4.app.Fragment.performResume(Fragment.java:1829)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:983)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1108)
            at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1927)
            at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:444)
            at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:433)
            at android.support.v7.app.ActionBarActivity.onPostResume(ActionBarActivity.java:140)
            at android.app.Activity.performResume(Activity.java:5356)
            at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)
            at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2993)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
            at android.os.Handler.dispatchMessage(Handler.java:110)
            at android.os.Looper.loop(Looper.java:193)
            at android.app.ActivityThread.main(ActivityThread.java:5299)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
            at dalvik.system.NativeStart.main(Native Method)

As you can see, LogCat doesn't mention my own Java code errors: the exception is thrown in your class. Is there a way to fix this?

Passing Serializable objects

In Wizard.java, when putting a Serializable object into the context bundle, it throws an IllegalArgumentException, there is a bug in field.get(field.getName()), because field.getName() is returning a String, but field.get() is expecting an "instance of the declaring type of the method".

No null check on Date fields for ContextManagerImpl.persistStepContext()

I found an issue while using Date fields. Because no null check is done, if a date field is null, the call to getTime() will throw a null pointer exception. See ContextManagerImpl line 124.

Here's the stack trace:
java.lang.NullPointerException
at org.codepond.wizardroid.persistence.ContextManagerImpl.persistStepContext(ContextManagerImpl.java:124)
at org.codepond.wizardroid.Wizard.goNext(Wizard.java:178)
at org.codepond.wizardroid.layouts.BasicWizardLayout.onClick(BasicWizardLayout.java:83)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)

Material Compatibility

Hi, first of all thanks for the great library.

I would like to see support for material design button bar. I am currently using the following layout xml. Maybe we can add a "MaterialWizardLayout" that uses the xml below.

`

<!-- Layout for wizard controls -->
<LinearLayout
    android:id="@+id/wizard_button_bar"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    style="?android:attr/buttonBarStyle">

    <Button
        android:id="@+id/wizard_previous_button"
        android:text="@string/action_previous"
        android:enabled="false"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        style="?android:attr/buttonBarButtonStyle"/>

    <Button
        android:id="@+id/wizard_next_button"
        android:text="@string/action_next"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        style="?android:attr/buttonBarButtonStyle"/>

</LinearLayout>

<!--
        **********************************************************************
        **You MUST have this ViewPager as the container for wizard's steps  **
        **********************************************************************
-->
<android.support.v4.view.ViewPager
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@id/step_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@id/wizard_button_bar"/>
`

Null ContextVariables of form at 2nd step/order

I am using release 1.3.1.

I am trying to build a wizard using 3 steps forms as below,

@OverRide
public WizardFlow onSetup() {
return new WizardFlow.Builder()
.addStep(Step1.class, true)
.addStep(Step2.class, true)
.addStep(Step3.class)
.create();
}

Step1.class and Step2.class have few variables and step3 displays values of all ContextVariables of step1.class and Step2.class.

I am facing issue that values of step2.class are not showing in step3.class when those of step1.class are showing correctly.

I have interchange order of step1 and step2 then able to see all values of ContextVariables of step2 (which is now at first in order) but not those of step1(which is at 2nd in order) in step3.

Please help me to find out what wrong I am doing and how could it be solved.

Using Boolean as context variable throws fatal exception

I'm using WizarDroid 1.1.1 via Maven repo. I have declared a boolean as a context variable:

    @ContextVariable
    private Boolean isUsingSSL;

When I click Next, the program dies with a fatal exception:

01-10 15:45:46.145    2122-2122/com.singularity.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.IllegalArgumentException: not a primitive field
            at java.lang.reflect.Field.getZField(Native Method)
            at java.lang.reflect.Field.getBoolean(Field.java:297)
            at org.codepond.wizardroid.persistence.ContextManagerImpl.persistStepContext(ContextManagerImpl.java:100)
            at org.codepond.wizardroid.Wizard.goNext(Wizard.java:153)
            at org.codepond.wizardroid.layouts.BasicWizardLayout.onClick(BasicWizardLayout.java:83)
            at android.view.View.performClick(View.java:4204)
            at android.view.View$PerformClick.run(View.java:17355)
            at android.os.Handler.handleCallback(Handler.java:725)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)

EDIT: same thing happens with an Integer. Seems like only Strings are working for me.

notifyCompleted() throws an Exception

i have found if two time in a raw call notifyCompleted(false) or notifyCompleted(true) it thows an exception of nested fragments. for you form example when i check the middle step and proceed and come back again the exception is thrown. would you please guide me in fixing this.

Add an easy way to transfer arguments from the activity to a step of the wizard

Hi,

I wanted to transfer some arguments from the activity to the wizard fragment. Right now I am using OTTO bus which is a bit big for something simple to implement I think.

A simple method can be added to the API:

public Builder addStep(java.lang.Class<? extends org.codepond.android.wizardroid.WizardStep> stepClass, Bundle b)

That way the Bundle would be loaded in the fragment easily!

To get back the Bundle inside the fragment you can let the user do it in the normal way (getArguments()) or may be add some annotation magic stuff. As my knowledge in annotation is very poor, I don't know if it's difficult and may be it s overkilling.

Regards

Unneeded log

There are some log in the library and no way to disable it.

Log.isLoggable() may be used to fix it.

Ability to block Next ViewPager slide

Just remembered I am missing a feature!

In some situation I need to block the user to go precedent because after a step a file has been generated and should not be responsible generated.

Disabling the button in the UI is not enough as it is still possible to press hardware precedent button.

It should be possible to call a method which would block precedent button And disable software one (on the UI)

Use ListFragment as a WizardStep

I would like to use a ListFragment as a wizard step. But since WizardStep extends Fragment it is not possible.

I tried to use generics but didn't succeed. My java knowlegde on that part is very basic.
Any idea how to proceed? Change WizardStep into an interface?

Saved states for listview inside step

I'm using a wizard step with a listview inside wich had one row selected and the state of the listview is not maintain.
Is there a way to achieve this ?

Adding a back button request

Is there a way to have functionality similar to notifyCompleted() and notifyIncomplete() for previousButton? previousButton cannot be manipulated as it is declared privately within WizarDroid.

Switch from Activity to Fragment

Hi,

The current implementation of the library is based on an Activity.

Since last Google IO 2013, support library has been updated to support nested fragment.

Current implementation based on an activity make it impossible to insert a wizard in a multi fragment UI (example: you have a fragment on the left to choose a wizard, and a fragment on the right to show this wizard).

By moving the code from wizard activity to a fragment, you would make that possible without losing any functionality.

Regards

Passing data between steps

Any thoughts on how to pass data between steps? saveModel() is not usefull. It is created at the beginning and therefor to pass data which could change in the steps.

Crash when rotating device

I was trying out this piece this library. I build a simple app based on the demo. But it crashes when rotating device.

When I press next button after device rotation I get an null pointer exception in org.codepond.android.wizardroid.WizardStep.setState(WizardStep.java:39)

The onStepStateChangedListener is null.

Context Variable Update Issue

With the new version i have some strange behavior.

There is a difference between swiping the steps through gestures or buttons. With a sliding gesture everything is fine. ContextVariables get updated correctly, but if I'm using Buttons there is no update of the context variables anymore. (Which is only the case for the step right behind the step where I updated the value.

Let me assume we have 4 Steps (in each of the first three steps there is one relevant context variable to update and the fourth step shows just a summary)

  1. Select a user (required Step)
  2. Select some values (non required step due to default values)
  3. Select a bluetooth device to connect (required step)
  4. Summary show each set context variable

Now in my summary step all values are displayed correctly as long as I'm swiping from step 3 to step 4 with the gesture. If I'm using the Next button to get to step four it won't work. But there is one exception, if I'm using the buttons to get back to step one, and stepping with buttons then vice versa to step 4 the value gets updated then.

I'm searching for the differences between changing a step via slides or buttons. But also changing the Wizards goNext Function like this:

     /**
     * Advance the wizard to the next step
     */
    public void goNext() {
        if (canGoNext()) {
            if (isLastStep()) {
                processStepBeforeChange(getCurrentStep(), getCurrentStepPosition());
                callbacks.onWizardComplete();
            }
            else {
                mPreviousPosition = getCurrentStepPosition();
                mPreviousStep = getCurrentStep();
                processStepBeforeChange(mPreviousStep, mPreviousPosition);
                setCurrentStep(mPager.getCurrentItem() + 1);
                callbacks.onStepChanged();
            }
        }
    }

won't work (I expected that with this I can force the value to be updated) but the viewpager always attaches the Activity and or executes onCreateView with null as context variable (with the exceptions mentioned above).

I guess the viewpager is always trying to cache fragments for smoother working and therefore the value gets updated with buttons when I'm far away from my last step (in my case the first step).

What can I do?

BR Daniel

Add abort() method in the documentation

I know it's not very difficult to find the abord() method, but I think it could be a good thing to include it in the documentation, probably through a "precedent" button.

Moreover, the word abort may be not the best one to describe the effect of the method, why not goPrecedent() and goNext() instead?

Regards

Adding a ListFragment Step wizard

Hi,

As you may know, a list fragment is a bit more interesting than a Fragment with a listview. Some methods are added to make the listview disappear or appear again, to add an empty list message and so on.

It would be great to have a dedicated ListFragment step class too.

The WizardStep class is very simple, and it would be easy to move all the code in a dedicated class, create two WizardStep classes (one based on Fragment and the other on ListFragment) and just call the method from the common class.

Regards

Maven support

Hi,

I am using Gradle in my project and wanted to use your lib as it seems to fit my need perfectly.

However, I had no success with:
compile 'org.codepond.android.wizardroid:wizardroid-core:1.0.0-SNAPSHOT'

I am already using Gradle for many lib in the same project so I know it s not a Gradle setup issue.

Moreover I noticed that I can't find your lib in Maven central website.
http://search.maven.org/#search|ga|1|wizardroid

Is there another repository I may add to get your lib?

Regards

Problems building standalone wizardroid-sample

I've been having a problem with my own project incorporating WizarDroid, so trying to isolate the problem, I copied the wizardroid-sample code to its own top level directory and attempted to build it using a trimmed down version of my own Maven pom.xml. This exactly replicated my issue, which is likely something I am doing, but am hoping someone can point out.

There was one other issue, which appears to be an unresolved reference to the @string/action_previous title in wizard.xml. Adding a property in strings.xml fixes it.

The second is that I get a NoClassDefFoundError: org.codepond.wizardroid.R$layout when I attempt to run the sample on my device. Am I using WizarDroid incorrectly? Below is my Maven pom.xml. Thank you.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.codepond</groupId>
  <artifactId>wizardroid-sample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>apk</packaging>

  <name>WizarDroidSample</name>

  <dependencies>
    <dependency>
      <groupId>android</groupId>
      <artifactId>android</artifactId>
      <version>4.4.2_r3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.android.support</groupId>
      <artifactId>support-v4</artifactId>
      <version>21.0.3</version>
      <type>aar</type>
    </dependency>
    <dependency>
      <groupId>org.codepond</groupId>
      <artifactId>wizardroid</artifactId>
      <version>1.3.0</version>
      <type>aar</type>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <android.app.dir>/storage/emulated/0/Android/data/${app.pkg.name}/files</android.app.dir>
    <app.pkg.name>com.codepond.wizardsample</app.pkg.name>
    <test.resources.dir>${basedir}/src/test/resources</test.resources.dir>
    <test.content.dir>${test.resources.dir}/content</test.content.dir>
    <android.content.dir>${android.app.dir}/content</android.content.dir>
  </properties>

  <build>
    <finalName>${project.artifactId}</finalName>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.simpligility.maven.plugins</groupId>
          <artifactId>android-maven-plugin</artifactId>
          <version>4.1.1</version>
          <extensions>true</extensions>
          <configuration>
            <includeLibsJarsFromAar>true</includeLibsJarsFromAar>
            <sdk>
              <!-- platform as api level (api level 16 = platform 4.1)-->
              <platform>19</platform>
            </sdk>
            <test>
              <coverage>true</coverage>
              <createReport>true</createReport>
            </test>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>1.7</source>
            <target>1.7</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>com.simpligility.maven.plugins</groupId>
        <artifactId>android-maven-plugin</artifactId>
      </plugin>

    </plugins>
  </build>

</project>

notifyCompleted(false) throws an Exception

In my step I use a simple if statement in a onTextChanged event where i check whether the Next button should be disabled or enabled.. I check if the editText is empty if so I use notifyCompleted(false) else notifyCompleted(true).. But looks like when I use notifyCompleted(false) It throws an exception which is called when you might be trying to nest a fragment within other fragment.

Here's my code

Thank you.

Multiple variables are not working.

I've got a basic 3 step wizard, and I can only get 1 variable working.

@ContextVariable
private String apiPassword;
@ContextVariable
private String apiEmail;
@ContextVariable
private String fun;

I can't get anything other then apiEmail set. I threw in "fun" to just hardcode set's all over my code, and it's always null on the next page of the wizard. All three steps have that code at the top.

Improve the transfer of arguments between an activity and a step fragment

I have read your answer to my precedent request (#17) and I can tell you your code works.

Indeed, I did it the wrong way.

In the current API, you need to have a key in your Bundle equal to the name of your variable marked with an annotation, right?

I see several issues with that. The first is that it is not consistent with the way arguments are transfered from a Fragment to another.

The second is that there is a real risk of typo between the name of the key and the name of the variable (which is mitigated by the feature of crashing if the key is not found).

It adds several lines of boilerplate code (initiating the Bundle and putting the variables).

But I think I have a solution.

Instead of having this:

public Builder addStep(java.lang.Class<? extends org.codepond.android.wizardroid.WizardStep> stepClass, Bundle b)

Why not using that:

public Builder addStep(java.lang.Class<? extends org.codepond.android.wizardroid.WizardStep> stepClass, Objects... o)

Since the last time I read about annotation and I understood that it works through reflexion.

So imagine, you just mark your variables, and you transfer them to addStep method through the vararg. Then, the array is read, and value from the variable is added to the Bundle which is attached to the Fragment.

Much more simple!

Another way, would be to add an argument to the annotation. You would just put the Class (one or several), and then you don't need anymore to pass them through the addStep() method.

Even more cleaner.

And my final idea: why limitating the transfer of variable to one Fragment only?

I mean in Fragment, if you mark a variable with the annotation the variable can be available in every following step, right?

So in my opinion, it should be the same for Activity variables.

In the third way, it s 100% consistent with the Fragment API, less code, much easier to document and to use.

Regards

Add a way to drop support library

As of today, there are less and less application supporting version <14 (see the movement min SDK 14 during the Google IO 2013!).

Would it be possible to have a second version of the WizardStep framgent not using support library at all? Because otherwise, it may create conflict with other libraries including another version of the support library.

Moreover, it may create issue with other fragment you may want to include in a step and somewhere outside of a wizard if they are not extending "support fragment" (it s not possible to use nested fragment between classical fragment and support fragment).

The way I think it should be done would be to move as much as possible code out of the fragment (in Wizard class?) following the "composite design pattern". Then you would have two fragments to extend from depending from your needs (one with support lib and one without).

These two fragments would only include code to init the composite object (Wizard one?), so you don't need to code everything two times.

To go even further, with Gradle you would generate two separate Jar (there is support for "flavor" apk and I suppose favored jar too).

It would be super clean that way!

Regards

How to skip a WizardStep

I use WizarDroid and I intend to skip a step if certain conditions are met.
How can I tell the wizard that the next step can be skipped?

Proguard

Hi,

Here is my today little contribution to your awesome project.

To make your lib works with Proguard, the user needs to add:

#Wizardroid
-keepnames class * { @org.codepond.android.wizardroid.ContextVariable *;}

in its configuration file.

As I think it may be very useful, you should add it to your documentation.

Regards

Swipe Back/Prev is very sensitive

I have an EditText on one of my WizardStep pages and when I go to select it to enter text 8 times out of ten it will go to the next/previous wizard step because if the touch moves at all it's interpreted as a swipe.

I've also noticed that I can put my finger on the right most side of my screen and if I swipe left I can go multiple pages in one long swipe left.

I tracked it down to the setOnPageChangeListener in Wizard.java. I cloned the repo and commented out that listener out of curiosity and everything still seems to work.

Did you override the built in ViewPager funtionality for a reason I am not seeing?

Having a dedicated landpage to present the lib

I know it s absolutly not urgent, but just to share an idea, why not create a landpage for your lib like this one:
http://square.github.io/picasso/
?

Source code : https://github.com/square/picasso/tree/master/website/static , all the project is under Apache license, so you can steal!

Moreover, README file should be short in my opinion, right now the information are in two version in WIKI and in the README file. A simple link to the Wiki should be enough.

Regards

Using @ContextVariable when overriding BasicWizardLayout

I was hopping to have access to all the data acquired in the wizard from within the onWizardComplete() method in my class that extends the BasicWizardLayout class.

Unfortunately all the @ContextVariable fields in my sub class are null when I click submit and land in the OnWizardComplete override. Should I have access to these? Am I missing something?

Go To Step

Hi !
I've actually implemented a result Step, where the user see everything he set in the Wizar.
I just want to know if it's possible (and I tried but don't find how to) to use super.wizard.setCurrentStep() in a Step, then the user can click on a value he wants to change, and the wizard can go on the step.
Thanks for the Wizard, it's a really nice work, and I hope you can clarify this point !

Context Variable values lost after orientation change

If the screen orientation changes i.e from landscape to portrait, or vice-versa, the Context Variable values decorated using the @ContextVariable attribute are lost.

My solution to fix this is shown below in the WizardFragment class, onActivityCreated method - to replace 'contextManager.persistStepContext(this);' with 'contextManager.loadStepContext(this);'

@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
//TODO: get rid of this dependency
contextManager = new ContextManagerImpl();
if (savedInstanceState != null) {
flow.loadFlow(savedInstanceState);
//Load pre-saved wizard context
contextManager.setContext(savedInstanceState.getBundle(STATE_WIZARD_CONTEXT));
}
else {
//Initialize wizard context
contextManager.setContext(new Bundle());
}
wizard = new Wizard(flow, contextManager, this, this.getActivity());

// Replace this:
// contextManager.persistStepContext(this);
// with this:
contextManager.loadStepContext(this);
}

Dynamically change wizard flow in runtime

The lib has greatly improved. I am still not using the latest version but will do it very soon.

However I think one thing is still missing. Right now steps are defined before the process begin. It should be possible to switch from step 1 to step X directly depending on the option selected by the user.

Regarding the implementation, several possibilities are possible.

First you can indicate in the next method which fragment you want. If no argument is provided then you go to next step. Good if you have optional steps.

Second possibility is an architecture similar to wizard example from Roman Nurik. There is a class inside indicating the different possible path. Good if paths are complex and fix.
IMO first solution is ok for most use and easier to implement.

If added, I am sorry, but I won't have anymore feature request! Or may be... :-)

Rework the UI of the bottom bar

Hi,

Just FYI I played a lot with the wizard pattern, and finally, regarding the bottom bar, I think in most cases you will need a central action button.

Here is a screenshot of my current work (not definitive).

May be it would be a good idea to implement something similar in your default UI?

Central button has not to be displayed all the time, and it doesn't look strange when it s set to invisible.

My application will be open source soon, so code is coming if you want it :-)

capture du 2013-10-16 09 59 14

Cannot recreate the tutorial.

It may be just me but I am unable to recreate a wizard from your tutorial.
I posted the question on Stack Overflow
And nobody gave me the correct answer so far. Maybe you guys can help a little?

When I try to inflate the view of the wizardstep1 I get NullPointerException, and It is very confusing cause I didn't change any of your code, I just copy and pasted it.. made sure It fits in my app and ran it.

Thank you in advance.

Improve example UI (buttons)

Hi,

In case you have not guessed, I really like your lib!

I think it may be very useful to many many dev.

So I think the example UI should be clean.

Here is an improvement regarding the button precedent and next (I don't put text as it s definied in the step fragment)

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">

    <View   android:id="@+id/horizontal_line"
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@android:color/darker_gray"
            android:layout_above="@+id/wizard_button_bar"/>

    <LinearLayout
            android:id="@+id/wizard_button_bar"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            >

        <Button
                android:id="@+id/wizard_precedent_button"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                style="?android:attr/borderlessButtonStyle"
                />

        <View   android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@android:color/darker_gray"/>

        <Button
                android:id="@+id/wizard_next_button"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                style="?android:attr/borderlessButtonStyle"
                />
    </LinearLayout>

    <FrameLayout
            android:id="@+id/step_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_above="@+id/horizontal_line"/>

</RelativeLayout>

Crash occures when having more than one required step marked completed

I'm having an issue I'm trying to pin point, but it seems to come about having two pages with completion required. I'm getting the following exception:

Recursive entry to executePendingTransactions

Stack trace looks like this. Currently this is within my own application and I will try to see if I can get into a stand alone app.

2-06 14:10:13.539: ERROR/AndroidRuntime(1075): FATAL EXCEPTION: main
java.lang.IllegalStateException: Recursive entry to executePendingTransactions
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1439)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)
at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:163)
at android.support.v4.view.ViewPager.dataSetChanged(ViewPager.java:892)
at android.support.v4.view.ViewPager$PagerObserver.onChanged(ViewPager.java:2819)
at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
at android.support.v4.view.PagerAdapter.notifyDataSetChanged(PagerAdapter.java:276)
at org.codepond.wizardroid.Wizard.onStepCompleted(Wizard.java:140)
at org.codepond.wizardroid.Wizard.receive(Wizard.java:131)
at org.codepond.wizardroid.infrastructure.Bus.post(Bus.java:21)
at org.codepond.wizardroid.WizardStep.notifyCompleted(WizardStep.java:48)
at com.trixiesoft.clapp.wizards.PostStep2.checkValues(PostStep2.java:113)
at com.trixiesoft.clapp.wizards.PostStep2$1.afterTextChanged(PostStep2.java:53)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7247)
at android.widget.TextView.setText(TextView.java:3703)
at android.widget.TextView.setText(TextView.java:3554)
at android.widget.EditText.setText(EditText.java:80)
at android.widget.TextView.setText(TextView.java:3529)
at android.widget.TextView.onRestoreInstanceState(TextView.java:3429)
at android.view.View.dispatchRestoreInstanceState(View.java:12093)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2588)
at android.view.View.restoreHierarchyState(View.java:12071)
at android.support.v4.app.Fragment.restoreViewState(Fragment.java:447)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:949)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)
at android.support.v4.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:163)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1068)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:550)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:509)
at android.support.v4.view.ViewPager.dataSetChanged(ViewPager.java:908)
at android.support.v4.view.ViewPager$PagerObserver.onChanged(ViewPager.java:2819)
at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
at android.support.v4.view.PagerAdapter.notifyDataSetChanged(PagerAdapter.java:276)
at org.codepond.wizardroid.Wizard.goNext(Wizard.java:155)
at org.codepond.wizardroid.layouts.BasicWizardLayout.onClick(BasicWizardLayout.java:83)
at android.view.View.performClick(View.java:4204)
at android.view.View$PerformClick.run(View.java:17355)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)

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.