-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add disabling and hiding feature for views on form load #378
Conversation
for (int i = 1; i <= count; i++) { | ||
JSONObject ithStepObject = json.optJSONObject(JsonFormConstants.STEP + i); | ||
JSONArray fieldsJsonObject = ithStepObject.optJSONArray(JsonFormConstants.FIELDS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using this com.vijay.jsonwizard.utils.FormUtils#getMultiStepFormFields
method to get all the form fields.
@Override | ||
public void makeFieldHidden(JSONObject fieldObject) { | ||
Utils.makeFieldHidden(fieldObject); | ||
} | ||
|
||
@Override | ||
public void makeFieldDisabled(JSONObject fieldObject) { | ||
Utils.makeFieldDisabled(fieldObject); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementations are not needed since whatever they are returning is already a public static
method in the Utils
@@ -84,7 +84,8 @@ protected void onCreate(Bundle savedInstanceState) { | |||
|
|||
public void init(String json) { | |||
try { | |||
setmJSONObject(new JSONObject(json)); | |||
JSONObject formObject = new JSONObject(json); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This initialization can be inline.
@@ -84,7 +84,8 @@ protected void onCreate(Bundle savedInstanceState) { | |||
|
|||
public void init(String json) { | |||
try { | |||
setmJSONObject(new JSONObject(json)); | |||
JSONObject formObject = new JSONObject(json); | |||
setmJSONObject(formObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move encounter_type
to a constants file
if (type != null && type.equals(JsonFormConstants.EXPANSION_PANEL)) { | ||
genericPopupDialog.setHeader(toolbarHeader); | ||
genericPopupDialog.setContainer(container); | ||
public static void makeFieldDisabled(JSONObject fieldObject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add java docs for public methods.
Fragment fragment = context.getFragmentManager().findFragmentByTag("GenericPopup"); | ||
if (fragment != null) { | ||
fragmentTransaction.remove(fragment); | ||
public static void makeFieldHidden(JSONObject fieldObject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add java docs for public methods.
gradle.properties
Outdated
@@ -1,4 +1,4 @@ | |||
VERSION_NAME=1.7.24-SNAPSHOT | |||
VERSION_NAME=1.7.24.23-SNAPSHOT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update to the correct version
void makeFieldHidden(JSONObject fieldObject); | ||
|
||
void makeFieldDisabled(JSONObject fieldObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This are not required since their implementations are returning values of public static
methods in a utils class
…P/opensrp-client-native-form into add-disable-hide-feature-on-forms
…m into add-disable-hide-feature-on-forms
No description provided.