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

[DNM] Fix moving to next form page on AndroidX Fragments #662

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,21 @@ public boolean next() {
return false;
}


public Runnable nextAsRunnable() {
return new Runnable() {
@Override
public void run() {
try {
presenter.onNextClick(mMainView);
} catch (Exception e) {
Timber.e(e, " --> next");
}
}
};

}

public void setShouldSkipStep(boolean shouldSkipStep) {
this.shouldSkipStep = shouldSkipStep;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class NextProgressDialogTask extends AsyncTask<Void, Void, Void> {
private JsonWizardFormFragment formFragment;
private Context context;
private ProgressDialog progressDialog;
private Runnable runnableOnUiThread;

private void showDialog() {
setProgressDialog(new ProgressDialog(getContext()));
Expand All @@ -34,7 +35,7 @@ public NextProgressDialogTask(JsonWizardFormFragment jsonFormFragment) {

@Override
protected Void doInBackground(Void... voids) {
getFormFragment().next();
runnableOnUiThread = getFormFragment().nextAsRunnable();
return null;
}

Expand All @@ -48,6 +49,10 @@ protected void onPreExecute() {
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
hideDialog();

if (runnableOnUiThread != null) {
runnableOnUiThread.run();
}
}

public JsonWizardFormFragment getFormFragment() {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=2.1.14-SNAPSHOT
VERSION_NAME=2.1.14.1-GIZ-SNAPSHOT
VERSION_CODE=1
GROUP=org.smartregister
POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard
Expand Down