Skip to content

Commit

Permalink
move formutils factory methods into formutils
Browse files Browse the repository at this point in the history
fix codacy util class naming
  • Loading branch information
LZRS committed Jul 9, 2021
1 parent 95a6544 commit f7a4606
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import com.vijay.jsonwizard.interfaces.OnFormFetchedCallback;
import com.vijay.jsonwizard.utils.AppExecutors;
import com.vijay.jsonwizard.utils.FormUtils;
import com.vijay.jsonwizard.utils.FormUtilsFactory;
import com.vijay.jsonwizard.utils.NativeFormLangUtils;

import org.json.JSONException;
Expand Down Expand Up @@ -45,7 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

protected FormUtils getFormUtils(){
return FormUtilsFactory.newInstance();
return FormUtils.newInstance();
}

private void checkIfFormUpdate(@NonNull JSONObject formJsonObject) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.vijay.jsonwizard.activities;

import com.vijay.jsonwizard.utils.FormUtils;
import com.vijay.jsonwizard.utils.FormUtilsFactory;

public class NoLocaleJsonWizardFormActivity extends JsonWizardFormActivity {
@Override
protected FormUtils getFormUtils() {
return FormUtilsFactory.noLocaleInstance();
return FormUtils.newInstanceWithNoLocale();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ public class FormUtils {
private Utils utils = new Utils();
private GenericDialogInterface genericDialogInterface;

public static FormUtils newInstance(){
return new FormUtils();
}

public static FormUtils newInstanceWithNoLocale(){
return new FormUtils(){
@Override
protected String getLocaleFormIdentity(Context context, String formIdentity) {
return formIdentity;
}
};
}

public static Point getViewLocationOnScreen(View view) {
int[] location = new int[2];
view.getLocationOnScreen(location);
Expand Down

This file was deleted.

0 comments on commit f7a4606

Please sign in to comment.