Skip to content

Commit

Permalink
Make the FormHierarchyActivity the default and remove edit
Browse files Browse the repository at this point in the history
  • Loading branch information
lognaturel committed Nov 6, 2018
1 parent f02a54e commit 9280d8d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 29 deletions.
2 changes: 1 addition & 1 deletion collect_app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ the specific language governing permissions and limitations under the License.
<activity android:name=".activities.AboutActivity" />
<activity android:name=".preferences.PreferencesActivity" />
<activity android:name=".preferences.AdminPreferencesActivity" />
<activity android:name=".activities.FormHierarchyActivity" />
<activity android:name=".activities.ViewFormHierarchyActivity" />
<activity android:name=".activities.EditFormHierarchyActivity" />
<activity android:name=".activities.GeoPointActivity" />
<activity
android:name=".activities.GeoPointMapActivity"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
0, null, false, true);
}

Intent i = new Intent(this, EditFormHierarchyActivity.class);
Intent i = new Intent(this, FormHierarchyActivity.class);
startActivityForResult(i, RequestCodes.HIERARCHY_ACTIVITY);
return true;
case R.id.menu_preferences:
Expand Down Expand Up @@ -2377,7 +2377,7 @@ public void denied() {
if (formMode == null || ApplicationConstants.FormModes.EDIT_SAVED.equalsIgnoreCase(formMode)) {
formController.getTimerLogger().logTimerEvent(TimerLogger.EventTypes.FORM_RESUME, 0, null, false, true);
formController.getTimerLogger().logTimerEvent(TimerLogger.EventTypes.HIERARCHY, 0, null, false, true);
startActivity(new Intent(this, EditFormHierarchyActivity.class));
startActivity(new Intent(this, FormHierarchyActivity.class));
return; // so we don't show the intro screen before jumping to the hierarchy
} else {
if (ApplicationConstants.FormModes.VIEW_SENT.equalsIgnoreCase(formMode)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,24 @@

import timber.log.Timber;

public abstract class FormHierarchyActivity extends CollectAbstractActivity {

/**
* Displays the structure of a form along with the answers for the current instance. Different form
* elements are displayed in the following ways:
* - Questions each take up a row with their full label shown and their answers below
* - Non-repeat groups are not represented at all
* - Repeat groups are initially shown as collapsed and are expanded when tapped, revealing instances
* of that repeat
* - Repeat instances are displayed with their label and a count after (e.g. My group (1))
*
* Tapping on a repeat instance shows all the questions in that repeat instance using the display
* rules above.
*
* Although the user gets the impression of navigating "into" a repeat, the view is refreshed in
* {@link #refreshView()} rather than another activity/fragment being added to the backstack.
*
* Buttons at the bottom of the screen allow users to navigate the form.
*/
public class FormHierarchyActivity extends CollectAbstractActivity {
protected static final int CHILD = 1;
protected static final int EXPANDED = 2;
protected static final int COLLAPSED = 3;
Expand Down

0 comments on commit 9280d8d

Please sign in to comment.