diff --git a/README.md b/README.md index 825c7e86..5d1d12f5 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Once you’re up and running, you can choose an issue to start working on from h Issues tagged as [good first issue](https://github.com/odk-x/tool-suite-X/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) should be a good place to start. -Pull requests are welcome, though please submit them against the development branch. We prefer verbose descriptions of the change you are submitting. If you are fixing a bug please provide steps to reproduce it or a link to a an issue that provides that information. If you are submitting a new feature please provide a description of the need or a link to a forum discussion about it. +Pull requests are welcome, though please submit them against the development branch. We prefer verbose descriptions of the change you are submitting. If you are fixing a bug, please provide steps to reproduce it or a link to an issue that provides that information. If you are submitting a new feature, please provide a description of the need or a link to a forum discussion about it. ## Links for users This document is aimed at helping developers and technical contributors. For information on how to get started as a user of ODK-X, see our [online documentation](https://docs.odk-x.org), or to learn more about the Open Data Kit project, visit [https://odk-x.org](https://odk-x.org). diff --git a/broken_tests/src/org/opendatakit/tables/fragments/AbsWebTableFragmentStub.java b/broken_tests/src/org/opendatakit/tables/fragments/AbsWebTableFragmentStub.java index c0adb11c..4f8e2f85 100644 --- a/broken_tests/src/org/opendatakit/tables/fragments/AbsWebTableFragmentStub.java +++ b/broken_tests/src/org/opendatakit/tables/fragments/AbsWebTableFragmentStub.java @@ -65,4 +65,13 @@ public void databaseUnavailable() { // we assume the service connection is mocked and does not require any of these calls } + @Override + public void onBackPressed() { + if (ODKWebView.canGoBack()) { + ODKWebView.goBack(); + } else { + super.onBackPressed(); + } + } + } diff --git a/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseActivity.java b/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseActivity.java index 96d21ff7..6612fffd 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseActivity.java +++ b/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseActivity.java @@ -17,8 +17,11 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; +import android.app.Activity; +import android.app.AlertDialog; import android.content.ActivityNotFoundException; import android.content.ComponentName; +import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.os.Handler; diff --git a/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseWebActivity.java b/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseWebActivity.java index ff077683..2c62d8b5 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseWebActivity.java +++ b/tables_app/src/main/java/org/opendatakit/tables/activities/AbsBaseWebActivity.java @@ -1,5 +1,6 @@ package org.opendatakit.tables.activities; +import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.net.Uri; @@ -83,7 +84,7 @@ public abstract class AbsBaseWebActivity extends AbsTableActivity implements IOd // no need to preserve private PropertyManager mPropertyManager; - public abstract String getInstanceId(); + public abstract String getInstanceId(); /** * Gets the active webkit view diff --git a/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java b/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java index 48ead2da..10686e27 100644 --- a/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java +++ b/tables_app/src/main/java/org/opendatakit/tables/activities/MainActivity.java @@ -21,8 +21,10 @@ import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager.BackStackEntry; import androidx.fragment.app.FragmentTransaction; +import android.app.AlertDialog; import android.content.ActivityNotFoundException; import android.content.ComponentName; +import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.Menu; @@ -299,7 +301,21 @@ public void initializationCompleted() { @Override public void onBackPressed() { - popBackStack(); + new AlertDialog.Builder(this) + .setIcon(android.R.drawable.ic_dialog_alert) + .setTitle("Closing Application") + .setMessage("Are you sure you want to close this application?") + .setPositiveButton("Yes", new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) { + finish(); + } + + }) + .setNegativeButton("No", null) + .show(); + //popBackStack(); } /**