Skip to content

Commit

Permalink
Merge branch 'master' into optibp_button_text_addition
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidwarsivd authored Jan 10, 2022
2 parents 60c36f8 + 8829729 commit 0ab2df1
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
Expand Down Expand Up @@ -76,7 +77,7 @@ public class JsonFormFragment extends MvpFragment<JsonFormFragmentPresenter, Jso
protected ScrollView mScrollView;
private Menu mMenu;
private JsonApi mJsonApi;
private Map<String, List<View>> lookUpMap = new HashMap<>();
private final Map<String, List<View>> lookUpMap = new HashMap<>();
private Button previousButton;
private Button nextButton;
private String stepName;
Expand All @@ -86,7 +87,7 @@ public class JsonFormFragment extends MvpFragment<JsonFormFragmentPresenter, Jso

private static NativeFormsProperties nativeFormProperties;

private final Handler handler = new Handler(this);
private final Handler handler = new Handler(Looper.getMainLooper(), this);

public static JsonFormFragment getFormFragment(String stepName) {
JsonFormFragment jsonFormFragment = new JsonFormFragment();
Expand All @@ -100,7 +101,7 @@ public static JsonFormFragment getFormFragment(String stepName) {
@Override
public boolean handleMessage(@NonNull @NotNull Message msg) {
//noinspection SwitchStatementWithTooFewBranches
switch (msg.what){
switch (msg.what) {
case GRAY_OUT_ACTIVE_WHAT:
requireActivity().invalidateOptionsMenu();
return true;
Expand Down Expand Up @@ -285,7 +286,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_toolbar, menu);
presenter.setUpToolBar();

if (getForm() != null && getForm().isGreyOutSaveWhenFormInvalid()){
if (getForm() != null && getForm().isGreyOutSaveWhenFormInvalid()) {
boolean isFormFilled = presenter.areFormViewsFilled();
if (isFormFilled) {
menu.findItem(R.id.action_next).setTitle(R.string.next);
Expand Down Expand Up @@ -678,7 +679,7 @@ public void unCheck(String parentKey, String exclusiveKey, CompoundButton compou
break;
}
} else if (isCheckbox(view)) {
CheckBox checkBox = ((LinearLayout) view).findViewWithTag(JsonFormConstants.CHECK_BOX);
CheckBox checkBox = view.findViewWithTag(JsonFormConstants.CHECK_BOX);
String parentKeyAtIndex = (String) checkBox.getTag(R.id.key);
String childKeyAtIndex = (String) checkBox.getTag(R.id.childKey);
if (checkBox.isChecked() && parentKeyAtIndex.equals(parentKey) && childKeyAtIndex.equals(exclusiveKey)) {
Expand Down Expand Up @@ -736,7 +737,7 @@ public void run() {

Form form = getForm();
if (!(view instanceof MaterialEditText)
|| (form != null && !form.isGreyOutSaveWhenFormInvalid())){
|| (form != null && !form.isGreyOutSaveWhenFormInvalid())) {
view.requestFocus();
}
}
Expand Down

0 comments on commit 0ab2df1

Please sign in to comment.