-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new activity to capture both form config and jsonwizard
- Loading branch information
Showing
8 changed files
with
89 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...rc/main/java/com/vijay/jsonwizard/activities/FormConfigurationJsonWizardFormActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.vijay.jsonwizard.activities; | ||
|
||
import com.vijay.jsonwizard.delegates.JsonWizardFormDelegate; | ||
|
||
import org.json.JSONException; | ||
|
||
public class FormConfigurationJsonWizardFormActivity extends FormConfigurationJsonFormActivity{ | ||
|
||
private final JsonWizardFormDelegate delegate = new JsonWizardFormDelegate(); | ||
|
||
@Override | ||
public void initializeFormFragment() { | ||
initializeFormFragmentCore(); | ||
} | ||
|
||
@Override | ||
public void writeValue(String stepName, String key, String value, String openMrsEntityParent, String openMrsEntity, String openMrsEntityId) throws JSONException { | ||
callSuperWriteValue(stepName, key, value, openMrsEntityParent, openMrsEntity, openMrsEntityId); | ||
} | ||
|
||
@Override | ||
public void onFormFinish() { | ||
callSuperFinish(); | ||
} | ||
|
||
protected void callSuperFinish(){ | ||
super.onFormFinish(); | ||
} | ||
|
||
protected void callSuperWriteValue(String stepName, String key, String value, String openMrsEntityParent, String openMrsEntity, String openMrsEntityId) throws JSONException { | ||
super.writeValue(stepName, key, value, openMrsEntityParent, openMrsEntity, openMrsEntityId); | ||
} | ||
|
||
protected void initializeFormFragmentCore(){ | ||
delegate.initializeFormFragmentCore(this.getSupportFragmentManager()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...java/com/vijay/jsonwizard/activities/NoLocaleFormConfigurationJsonWizardFormActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.vijay.jsonwizard.activities; | ||
|
||
public class NoLocaleFormConfigurationJsonWizardFormActivity extends FormConfigurationJsonWizardFormActivity { | ||
@Override | ||
protected boolean isUsingLocaleForms() { | ||
return false; | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
...-wizard/src/main/java/com/vijay/jsonwizard/activities/NoLocaleJsonWizardFormActivity.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...json-form-wizard/src/main/java/com/vijay/jsonwizard/delegates/JsonWizardFormDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.vijay.jsonwizard.delegates; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.FragmentManager; | ||
|
||
import com.vijay.jsonwizard.constants.JsonFormConstants; | ||
import com.vijay.jsonwizard.fragments.JsonWizardFormFragment; | ||
|
||
public class JsonWizardFormDelegate { | ||
|
||
public void initializeFormFragmentCore(@NonNull FragmentManager supportFragmentManager){ | ||
JsonWizardFormFragment jsonWizardFormFragment = JsonWizardFormFragment.getFormFragment(JsonFormConstants.FIRST_STEP_NAME); | ||
supportFragmentManager.beginTransaction() | ||
.add(com.vijay.jsonwizard.R.id.container, jsonWizardFormFragment) | ||
.commit(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
android-json-form-wizard/src/main/java/com/vijay/jsonwizard/utils/NoLocaleFormUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.vijay.jsonwizard.utils; | ||
|
||
import android.content.Context; | ||
|
||
public class NoLocaleFormUtils extends FormUtils{ | ||
@Override | ||
protected String getLocaleFormIdentity(Context context, String formIdentity) { | ||
return formIdentity; | ||
} | ||
} |