Skip to content
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

Merged
merged 17 commits into from
Mar 17, 2020

Conversation

bennsimon
Copy link
Member

No description provided.

@bennsimon bennsimon linked an issue Mar 4, 2020 that may be closed by this pull request
Comment on lines 552 to 554
for (int i = 1; i <= count; i++) {
JSONObject ithStepObject = json.optJSONObject(JsonFormConstants.STEP + i);
JSONArray fieldsJsonObject = ithStepObject.optJSONArray(JsonFormConstants.FIELDS);
Copy link
Member

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.

Comment on lines 643 to 651
@Override
public void makeFieldHidden(JSONObject fieldObject) {
Utils.makeFieldHidden(fieldObject);
}

@Override
public void makeFieldDisabled(JSONObject fieldObject) {
Utils.makeFieldDisabled(fieldObject);
}
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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.

@@ -1,4 +1,4 @@
VERSION_NAME=1.7.24-SNAPSHOT
VERSION_NAME=1.7.24.23-SNAPSHOT
Copy link
Member

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

Comment on lines 124 to 126
void makeFieldHidden(JSONObject fieldObject);

void makeFieldDisabled(JSONObject fieldObject);
Copy link
Member

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

dubdabasoduba
dubdabasoduba previously approved these changes Mar 17, 2020
@bennsimon bennsimon merged commit 12827d7 into master Mar 17, 2020
@bennsimon bennsimon deleted the add-disable-hide-feature-on-forms branch March 17, 2020 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature to handle disabling of views
2 participants