Android Material Json Form Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.

Overview

Android Arsenal

Android Json Wizard

Android Json Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.

Demo

alt demo

Demo Youtube Link

Usage

Json Structure

Form json should consist of steps and fields.

Steps

Step directly corresponds to a fragment(or a page) in wizard. It consists of different fields(array of fields), title and next step.

    {
     "step1":{
             "fields":[
                 {
                     "key":"name",
                     "type":"edit_text",
                     "hint":"Enter Your Name"
                 },
                 {
                     "key":"email",
                     "type":"edit_text",
                     "hint":"Enter email address"
                 },
                 {
                     "key":"labelBackgroundImage",
                     "type":"label",
                     "text":"Choose Background Image"
                 },
                 {
                     "key":"chooseImage",
                     "type":"choose_image",
                     "uploadButtonText":"Choose"
                 }
             ],
             "title":"Step 1",
             "next":"step2"
         }
    }

Supported fields

EditText

    {
        "key":"name",
        "type":"edit_text",
        "hint":"Enter Your Name"
    }

key - must be unique in that particular step.

type - must be edit_text for EditText.

hint - hint for EditText.

value - will be the value present in the editText after completion of wizard

EditText Required Validation
"v_required" : {
                    "value" : "true",
                    "err" : "Please enter some value this is a required field."
               }
EditText Min length Validation
"v_min_length" : {
                    "value" : "3",
                    "err" : "Min length should be at least 3"
                }
EditText Max Length Validation
"v_max_length" : {
                    "value" : "30",
                    "err" : "Max length is 30"
                }
EditText Email Validation
"v_email" : {
                    "value" : "true",
                    "err" : "Not an email."
                }
EditText Regex Validation
"v_email" : {
                    "value" : "your-regex-here",
                    "err" : "Your message here."
                }

Label

    {
     "key":"labelHeaderImage",
     "type":"label",
     "text":"Choose Background Image"
    }

key - must be unique in that particular step.

type - must be label for Label.

text - text for Label.

ImagePicker

    {
     "key":"chooseImage",
     "type":"choose_image",
     "uploadButtonText":"Choose"
    }

key - must be unique in that particular step.

type - must be choose_image for ImagePicker.

uploadButtonText - text for Button of ImagePicker.

value - will be the path of chosen image on external storage

ImagePicker Required Validation
"v_required" : {
                    "value" : "true",
                    "err" : "Please enter some value this is a required field."
               }

CheckBox (can be used for single/multiple CheckBoxes)

    {
        "key":"checkData",
        "type":"check_box",
        "label":"Select multiple preferences",
        "options":[
            {
                "key":"awesomeness",
                "text":"Are you willing for some awesomeness?",
                "value":"false"
            },
            {
                "key":"newsletter",
                "text":"Do you really want to opt out from my newsletter?",
                "value":"false"
            }
        ]
    }

key - must be unique in that particular step.

type - must be check_box for CheckBox.

label - text for header of CheckBox.

options - options for CheckBox.

key(in options) - must be unique in options.

text(in options) - text fot the CheckBox.

value(in options) - true/false.

CheckBox Required Validation

Not supported yet.

Spinner

        {
            "key":"name",
            "type":"spinner",
            "hint":"Name Thy House"
            "values":["Stark", "Targeriyan", "Lannister"]
        }

key - must be unique in that particular step.

type - must be spinner

hint - hint for Spinner.

values - Array of Strings.

value - will be the value present in the spinner after completion of wizard

Spinner Required Validation
"v_required" : {
                    "value" : "true",
                    "err" : "Please enter some value this is a required field."
               }

RadioButton (can be used for single/multiple RadioButtons)

{
    "key":"radioData",
    "type":"radio",
    "label":"Select one item from below",
    "options":[
        {
            "key":"areYouPro",
            "text":"Are you pro?"
        },
        {
            "key":"areYouAmature",
            "text":"Are you amature?"
        },
        {
            "key":"areYouNovice",
            "text":"Are you novice?"
        }
    ],
    "value":"areYouNovice"
}

key - must be unique in that particular step.

type - must be radio for RadioButton.

label - text for header of RadioButton.

value - must be key of one of the options which is selected/ or empty if no option is selected.

options - options for RadioButton.

key(in options) - must be unique in options.

text(in options) - text fot the RadioButton.

RadioButton Required Validation

Not supported yet.

Demo Input Json (Complete)

{
    "count":"3",
    "step1":{
        "fields":[
            {
                "key":"name",
                "type":"edit_text",
                "hint":"Enter Your Name",
                "v_min_length":{  "value" : "3",
                                    "err" : "Min length should be at least 3"
                                },
                "v_max_length":{  "value" : "10",
                    "err" : "Max length can be at most 10."
                }
            },
            {
                "key":"email",
                "type":"edit_text",
                "hint":"Enter Your Email",
                "v_email":{  "value" : "true",
                    "err" : "Not an email."
                }
            },
            {
                "key":"labelBackgroundImage",
                "type":"label",
                "text":"Choose Background Image"
            },
            {
                "key":"chooseImage",
                "type":"choose_image",
                "uploadButtonText":"Choose",
                "v_required":{  "value" : "true",
                    "err" : "Please choose an image to proceed."
                }
            },
            {
                "key":"house",
                "type":"spinner",
                "hint": "Name Thy House",
                "values":["Stark", "Targeriyan", "Lannister"],
                "v_required":{  "value" : "true",
                    "err" : "Please choose a value to proceed."
                }
            }
        ],
        "title":"Step 1 of 3",
        "next":"step2"
    },
    "step2":{
        "fields":[
            {
                "key":"name",
                "type":"edit_text",
                "hint":"Enter Country"
            },
            {
                "key":"checkData",
                "type":"check_box",
                "label":"Select multiple preferences",
                "options":[
                    {
                        "key":"awesomeness",
                        "text":"Are you willing for some awesomeness?",
                        "value":"false"
                    },
                    {
                        "key":"newsletter",
                        "text":"Do you really want to opt out from my newsletter?",
                        "value":"false"
                    }
                ]
            },
            {
                "key":"radioData",
                "type":"radio",
                "label":"Select one item from below",
                "options":[
                    {
                        "key":"areYouPro",
                        "text":"Are you pro?"
                    },
                    {
                        "key":"areYouAmature",
                        "text":"Are you amature?"
                    },
                    {
                        "key":"areYouNovice",
                        "text":"Are you novice?"
                    }
                ],
                "value":"areYouNovice"
            }
        ],
        "title":"Step 2 of 3",
        "next":"step3"
    },
    "step3":{
        "fields":[
            {
                "key":"anything",
                "type":"edit_text",
                "hint":"Enter Anything You Want"
            }
        ],
        "title":"Step 3 of 3"
    }
}

Starting form activity with your json

    Intent intent = new Intent(context, JsonFormActivity.class);
    String json = "Your complete JSON";
    intent.putExtra("json", json);
    startActivityForResult(intent, REQUEST_CODE_GET_JSON);

And receive result populated json in onActivityResult()

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == REQUEST_CODE_GET_JSON && resultCode == RESULT_OK) {
        Log.d(TAG, data.getStringExtra("json"));
    }
    super.onActivityResult(requestCode, resultCode, data);
}

Output Json (of demo input json)

{
    "count":"3",
    "step1":{
        "fields":[
            {
                "key":"name",
                "type":"edit_text",
                "hint":"Enter Your Name",
                "value":"Vijay"
            },
            {
                "key":"email",
                "type":"edit_text",
                "hint":"Enter Your Email",
                "value":"[email protected]"
            },
            {
                "key":"labelBackgroundImage",
                "type":"label",
                "text":"Choose Background Image"
            },
            {
                "key":"chooseImage",
                "type":"choose_image",
                "uploadButtonText":"Choose",
                "value":"\/storage\/emulated\/0\/Pictures\/Wally\/10017.png"
            }
        ],
        "title":"Step 1 of 3",
        "next":"step2"
    },
    "step2":{
        "fields":[
            {
                "key":"name",
                "type":"edit_text",
                "hint":"Enter Country",
                "value":"India"
            },
            {
                "key":"checkData",
                "type":"check_box",
                "label":"Select multiple preferences",
                "options":[
                    {
                        "key":"awesomeness",
                        "text":"Are you willing for some awesomeness?",
                        "value":"true"
                    },
                    {
                        "key":"newsletter",
                        "text":"Do you really want to opt out from my newsletter?",
                        "value":"false"
                    }
                ]
            },
            {
                "key":"radioData",
                "type":"radio",
                "label":"Select one item from below",
                "options":[
                    {
                        "key":"areYouPro",
                        "text":"Are you pro?"
                    },
                    {
                        "key":"areYouAmature",
                        "text":"Are you amature?"
                    },
                    {
                        "key":"areYouNovice",
                        "text":"Are you novice?"
                    }
                ],
                "value":"areYouPro"
            }
        ],
        "title":"Step 2 of 3",
        "next":"step3"
    },
    "step3":{
        "fields":[
            {
                "key":"anything",
                "type":"edit_text",
                "hint":"Enter Anything You Want",
                "value":"anything"
            }
        ],
        "title":"Step 3 of 3"
    }
}

Including in your project

gradle:

Step 1. Add the JitPack repository to your build file

repositories {
    maven {
        url "https://jitpack.io"
    }
}

Step 2. Add the dependency in the form

dependencies {
    compile 'com.github.vijayrawatsan:android-json-form-wizard:1.0'
}

maven:

Step 1. Add the JitPack repository to your build file

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Step 2. Add the dependency in the form

<dependency>
    <groupId>com.github.vijayrawatsan</groupId>
    <artifactId>android-json-form-wizard</artifactId>
    <version>1.0</version>
</dependency>

TODOs

  • Support validation for Checkbox and RadioButton.
  • Improve image picker UI.

Contributing

Contributions welcome via Github pull requests.

Credits

Thanks!

License

This project is licensed under the MIT License. Please refer the License.txt file.

Comments
  • Crash on upload image and go back

    Crash on upload image and go back

    Hello,

    Thanks for uploading this useful code. One issue is coming in current version:

    Issue: Crash on uploading image and going forward and coming back.

    How to reproduce: 1: upload image in page 1 2: Go to page 2. 3. Write some text 4. Go back to page 1. (Crash).

    Can you please check.

    opened by niteshkhilwani 9
  • Keyboard error

    Keyboard error

    When i try to type something i have app crash In logs :

    java.lang.ClassCastException: android.support.v7.internal.view.ContextThemeWrapper cannot be cast to com.vijay.jsonwizard.interfaces.JsonApi
                at com.vijay.jsonwizard.customviews.GenericTextWatcher.afterTextChanged(GenericTextWatcher.java:37)
                at android.widget.TextView.sendAfterTextChanged(TextView.java:7247)
                at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:8891)
                at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:970)
                at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:497)
                at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435)
                at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30)
                at android.text.method.QwertyKeyListener.onKeyDown(QwertyKeyListener.java:222)
                at android.text.method.TextKeyListener.onKeyDown(TextKeyListener.java:136)
                at android.widget.TextView.doKeyDown(TextView.java:5385)
                at android.widget.TextView.onKeyDown(TextView.java:5204)
                at android.view.KeyEvent.dispatch(KeyEvent.java:2609)
                at android.view.View.dispatchKeyEvent(View.java:7205)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:353)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1359)
                at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1920)
                at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1395)
                at android.app.Activity.dispatchKeyEvent(Activity.java:2370)
                at android.support.v7.internal.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:49)
                at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:258)
                at android.support.v7.internal.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:49)
                at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1847)
                at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3701)
                at android.view.ViewRootImpl.handleImeFinishedEvent(ViewRootImpl.java:3651)
                at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2818)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                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)
    
    opened by NilakArgento 8
  • Spinner is not displaying

    Spinner is not displaying

    This is my form.json, but it does not display the spinner

    { "count":"1", "step1":{ "fields":[ { "key":"from_account", "type":"spinner", "hint": "Select source account", "values":["0100719742003", "0200404805009"], "v_required":{ "value" : "true", "err" : "Please choose a value to proceed." } } ], "title":"Step 1 of 1" } }

    opened by a-v-ebrahimi 2
  • Unable to Validate Spinner

    Unable to Validate Spinner

    Hi,

    I tried validating (required field) the spinner in a similar ways as we did for editText and Mobile but it is not working. Can you please help me out with this?

    opened by aakashsinha 2
  • java.lang.NullPointerException

    java.lang.NullPointerException

    java.lang.RuntimeException: Unable to start activity ComponentInfo{www.simonpanel.co.il.simonpanel/com.vijay.jsonwizard.activities.JsonFormActivity}: java.lang.NullPointerException: Null pointer exception during instruction 'monitor-enter v2'
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367)
                at android.app.ActivityThread.access$800(ActivityThread.java:148)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5274)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
         Caused by: java.lang.NullPointerException: Null pointer exception during instruction 'monitor-enter v2'
                at com.vijay.jsonwizard.activities.JsonFormActivity.getStep(JsonFormActivity.java:54)
                at com.vijay.jsonwizard.fragments.JsonFormFragment.getStep(JsonFormFragment.java:162)
                at com.vijay.jsonwizard.presenters.JsonFormFragmentPresenter.addFormElements(JsonFormFragmentPresenter.java:43)
                at com.vijay.jsonwizard.fragments.JsonFormFragment.onViewCreated(JsonFormFragment.java:69)
                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
                at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
                at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
                at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:551)
                at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
                at android.app.Activity.performStart(Activity.java:5993)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367)
                at android.app.ActivityThread.access$800(ActivityThread.java:148)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5274)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
    
    opened by Ofiro 2
  • ic_launcher in mipmap folders

    ic_launcher in mipmap folders

    According to this: http://stackoverflow.com/questions/29965398/gradle-finished-with-non-zero-exit-value-1-ic-launcher-png-error-duplicate-fi

    I think that is necessary to delete the ic_launcher in mipmap folders.

    Oh and Thanks for the awesome work!

    opened by LuigiPapino 2
  • java.lang.ClassNotFoundException on EditText text change event.

    java.lang.ClassNotFoundException on EditText text change event.

    E/AndroidRuntime: FATAL EXCEPTION: main Process: konzeptfabrica.com.vehicloadmin, PID: 27961 java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/internal/widget/TintContextWrapper; at com.vijay.jsonwizard.customviews.GenericTextWatcher.afterTextChanged(GenericTextWatcher.java:35) at android.widget.TextView.sendAfterTextChanged(TextView.java:7698) at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9486) at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:454) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:33) at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685) at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:445) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:340) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5300) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:114) Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.internal.widget.TintContextWrapper" on path: DexPathList[[zip file "/data/app/konzeptfabrica.com.vehicloadmin-2/base.apk"],nativeLibraryDirectories=[/vendor/lib64, /system/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at com.vijay.jsonwizard.customviews.GenericTextWatcher.afterTextChanged(GenericTextWatcher.java:35)  at android.widget.TextView.sendAfterTextChanged(TextView.java:7698)  at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9486)  at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972)  at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516)  at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:454)  at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:33)  at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685)  at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:445)  at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:340)  at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:135)  at android.app.ActivityThread.main(ActivityThread.java:5300)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:114)  Suppressed: java.lang.ClassNotFoundException: android.support.v7.internal.widget.TintContextWrapper at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 20 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

    opened by adityagundecha 1
  • Not loading complete json

    Not loading complete json

    Hi Vijay,

    On compile the latest version, only load image part is getting loaded in form. Rest all the fields are getting loaded.

    SDK on device: 18.

    Tried both ways: compiling from URL and library.

    Can you please help in this.

    opened by niteshkhilwani 1
  • Landscape

    Landscape

    Error on change from portrait to landscape

    FATAL EXCEPTION: main
        Process: us.ethnicmedia.sevendays, PID: 4560
        java.lang.RuntimeException: Unable to start activity ComponentInfo{us.ethnicmedia.sevendays/com.vijay.jsonwizard.activities.JsonFormActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.vijay.jsonwizard.mvp.ViewState.setSavedInstance(boolean)' on a null object reference
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3947)
                at android.app.ActivityThread.access$900(ActivityThread.java:151)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5254)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
         Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.vijay.jsonwizard.mvp.ViewState.setSavedInstance(boolean)' on a null object reference
                at com.vijay.jsonwizard.mvp.BaseFragment.onCreate(BaseFragment.java:26)
                at com.vijay.jsonwizard.fragments.JsonFormFragment.onCreate(JsonFormFragment.java:58)
                at android.support.v4.app.Fragment.performCreate(Fragment.java:1766)
                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:917)
                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
                at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1120)
                at android.support.v4.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:1924)
                at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:268)
                at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:58)
                at com.vijay.jsonwizard.activities.JsonFormActivity.onCreate(JsonFormActivity.java:36)
                at android.app.Activity.performCreate(Activity.java:5990)
                at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
                at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3947)
                at android.app.ActivityThread.access$900(ActivityThread.java:151)
                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
                at android.os.Handler.dispatchMessage(Handler.java:102)
                at android.os.Looper.loop(Looper.java:135)
                at android.app.ActivityThread.main(ActivityThread.java:5254)
                at java.lang.reflect.Method.invoke(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:372)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
    
    opened by NilakArgento 1
  • ClassCastException when trying to fill EditText

    ClassCastException when trying to fill EditText

    Hi,

    When i try to fill an EditText, the application crashes with the error below . I'm using appcompat-v7:22.2.1

    java.lang.ClassCastException: android.support.v7.internal.widget.TintContextWrapper cannot be cast to com.vijay.jsonwizard.interfaces.JsonApi at com.vijay.jsonwizard.customviews.GenericTextWatcher.afterTextChanged(GenericTextWatcher.java:30) at android.widget.TextView.sendAfterTextChanged(TextView.java:7722) at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9493) at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:516) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:454) at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:33) at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685) at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:445) at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:340) at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:211) at android.app.ActivityThread.main(ActivityThread.java:5321) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1016) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)

    opened by kedjeha 1
  • Problem RadioButton

    Problem RadioButton

    When trying to Add a radio butto as an example

    { "key":"radioData", "type":"radio", "label":"Select one item from below", "options":[ { "key":"areYouPro", "text":"Are you pro?" }, { "key":"areYouAmature", "text":"Are you amature?" }, { "key":"areYouNovice", "text":"Are you novice?" } ], "value":"areYouNovice" }

    presents the following problem

    E/JsonFormInteractor: Exception occurred in making child view at index : 2 : Exception is : No value for orientation org.json.JSONException: No value for orientation at org.json.JSONObject.get(JSONObject.java:392) at com.vijay.jsonwizard.widgets.RadioButtonFactory.getEditableViewsFromJson(RadioButtonFactory.java:59) at com.vijay.jsonwizard.widgets.RadioButtonFactory.getViewsFromJson(RadioButtonFactory.java:48) at com.vijay.jsonwizard.interactors.JsonFormInteractor.fetchFormElements(JsonFormInteractor.java:60) at com.vijay.jsonwizard.presenters.JsonFormFragmentPresenter.getStepFormElements(JsonFormFragmentPresenter.java:114) at com.vijay.jsonwizard.presenters.JsonFormFragmentPresenter.addFormEditionElements(JsonFormFragmentPresenter.java:90) at com.vijay.jsonwizard.presenters.JsonFormFragmentPresenter.addFormElements(JsonFormFragmentPresenter.java:75) at com.vijay.jsonwizard.fragments.JsonFormFragment.onViewCreated(JsonFormFragment.java:88) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:892) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6923) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)

    opened by gustavobrunoro 0
  • Fatal Exception: java.lang.RuntimeException

    Fatal Exception: java.lang.RuntimeException

    I am getting following crashes from firebase log. Unable to start activity java.lang.NullPointerException: Attempt to invoke virtual method 'void com.vijay.jsonwizard.mvp.ViewState.setSavedInstance(boolean)' on a null object reference

    opened by KhadkaRabindra 0
  • Dependable Question

    Dependable Question

    Is it possible for the library to handle questions that depends on selected results of the previous question? e.g Are you sure you want to continue? Yes No on selecting Yes user is asked to proceed and and on selecting no they are allowed to explain why

    opened by Kreateyou 0
  • NoClassDefFoundError

    NoClassDefFoundError

    I got an error in my sample project using this library that says:

    FATAL EXCEPTION: main Process: com.garudainfinity.leumartsurvey, PID: 30819 java.lang.NoClassDefFoundError: com.vijay.jsonwizard.activities.JsonFormActivity at com.garudainfinity.leumartsurvey.activities.SurveyListActivity.onClick(SurveyListActivity.java:156) at android.view.View.performClick(View.java:5214) at android.view.View$PerformClick.run(View.java:20978) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6134) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

    this is how i call the activity: intent = new Intent(this, JsonFormActivity.class); String json = "Your complete JSON"; intent.putExtra("json", json); startActivityForResult(intent, 1);

    am i doing this wrong?

    opened by ryanhaidy 3
  • How to solve ActionBarActivity Deprecated?

    How to solve ActionBarActivity Deprecated?

    Hi, I tried to include this library into my new project, but app chashes when i call JsonFormActivity. Reason is Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/ActionBarActivity;

    How can I solve?

    Thanks

    opened by mitsus 0
Releases(1.1.1-SNAPSHOT)
Owner
Vijay Rawat
Vijay Rawat
Wizard Pager is a library that provides an example implementation of a Wizard UI on Android

Wizard Pager is a library that provides an example implementation of a Wizard UI on Android, it's based of Roman Nurik's wizard pager.

Julián Suárez 520 Nov 11, 2022
WizardTower - What will eventually be a Roguelike about being a powerful wizard, with a tower.

Wizard Tower Roguelike by sgibber2018 Description: This is a Roguelike I've been wanting to make for a long time. The premise is really simple: you ar

Sam Gibson 0 Jan 5, 2022
Animation View to Highlight particular Views 🎯 for Android

TargetView Animation View to Highlight particular Views ?? for Android, it can be Used with Views that you see important (Like CountDownTimer), And al

Anas Altair 53 Aug 7, 2021
🗨️ Beautiful Dialog is a Simple and Beautiful custom dialog

Beautiful Dialog ??️ Beautiful Dialog is a Simple and Beautiful custom dialog. Screenshots Including in your project Gradle Add below codes to your ro

Geovani Amaral 21 Jan 6, 2023
This is a library to help creating expanding views with animation in Android

About the Library inspiration This library is strongly inspired in this concept from Hila Peleg in dribble. See it below Working example For more deta

Diego Bezerra 944 Dec 27, 2022
A powerful library for creating notifications in android platform.

Download Download the latest AAR or grab via Maven: <dependency> <groupId>com.github.halysongoncalves</groupId> <artifactId>pugnotification</artif

Halyson Lima Gonçalves 867 Nov 19, 2022
Android library for creating an expandable to full screen view inside a viewgroup composition.

Expandable Panel Android Library Check ExpandablePanel Demo application on GooglePlay: Details This Android library implements the expand by sliding l

Jorge Castillo 422 Nov 10, 2022
Library for creating blur effects under Android UI elements

BlurTutorial Meet BlurTutorial, an Android-based library made by Cleveroad Hurry to check our newest library that helps to blur the background in Andr

Cleveroad 150 Dec 16, 2022
Step by step,just use HorizontalStepView,VerticalStepView. step indicator,flow indicator,timeline,order process,express status

StepView Step by step. Step indicator. Flow indicator。 snapshot like this:HorizontalStepView like this also like this:VerticalStepView Yeah,I am not w

baoyachi. Aka Rust Hairy crabs 4.1k Dec 30, 2022
Just a Wheel——A easy way to setEmptyView to ListView、GridView or RecyclerView etc..

中文说明在这里 TEmptyView Just a Wheel—— A easier way to setEmptyView. Without having to write xml file every time. It supports AdapterView(ListView,GridView

Barry 454 Jan 9, 2023
This project created just for help developer who want to and ability of read VISA, UNION PAY, HUMO, ATTO and some other cards data read.

If you enjoy my content, please consider supporting what I do. Thank you. By me a Coffee To get a Git project into your build: Step 1. Add the JitPack

Fozilbek Imomov 1 Oct 15, 2022
Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Simple and lightweight UI library for user new experience, combining floating bottom navigation and bottom sheet behaviour. Simple and beautiful.

Rizki Maulana 118 Dec 14, 2022
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
A beautiful Android custom View that works similar to a range or seekbar. With animations.

ValueBar A beautiful Android custom View that works similar to a range or seekbar. Selection by gesture. With animations. Supporting API level 11+. De

Philipp Jahoda 147 Nov 20, 2022
NeoPOP was created with one simple goal; to create the next generation of a beautiful, affirmative design system

NeoPop is CRED's inbuilt library for using NeoPop components in your app

CRED 254 Dec 29, 2022
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
Make your native android Toasts Fancy. A library that takes the standard Android toast to the next level with a variety of styling options. Style your toast from code.

FancyToast-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ... ma

Shashank Singhal 1.2k Dec 26, 2022
Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.

FancyAlertDialog-Android Prerequisites Add this in your root build.gradle file (not your module build.gradle file): allprojects { repositories { ..

Shashank Singhal 350 Dec 9, 2022
A Material design Android pincode library. Supports Fingerprint.

LolliPin A Lollipop material design styled android pincode library (API 14+) To include in your project, add this to your build.gradle file: //Loll

Omada Health 1.6k Nov 25, 2022