Skip to content

Commit

Permalink
Move threats from common to observation section in forms (#39)
Browse files Browse the repository at this point in the history
* Remove "Threats" from common form
* Add "Threats" field in all forms
* Rename threats/findings field to "Findings" in herptiles, mammals and invertebrates
  • Loading branch information
onyxvd authored Jul 10, 2019
1 parent ee7e930 commit 6e2a81b
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public BirdsConverter(Context context) {
addSingle(R.string.tag_breeding_success, "nestingSuccess");
add(R.string.tag_land_uses_300m, "landuse300mRadius");
add(R.string.tag_remarks_type, "speciesNotes");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public CbmConverter(Context context) {
add(R.string.tag_count_subject, "count");
add(R.string.tag_location, "location");
add(R.string.tag_zone, "zone");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public CiconiaConverter(Context context) {
add(R.string.tag_died_from_other_causes, "diedOtherReasons");
add(R.string.tag_cause, "reason");
add(R.string.tag_ciconia_remarks_type, "speciesNotes");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public HerpConverter(Context context) {
addSingle(R.string.tag_sex, "sex");
addSingle(R.string.tag_age, "age");
addSingle(R.string.tag_habitat, "habitat");
addMulti(R.string.tag_threats_other, "threatsHerps");
addMulti(R.string.tag_threats_other, "findings");
add(R.string.tag_count, "count");
add(R.string.tag_marking, "marking");
add(R.string.tag_distance_from_axis, "axisDistance");
Expand All @@ -33,6 +33,7 @@ public HerpConverter(Context context) {
add(R.string.tag_sq_caud, "sqCaud");
add(R.string.tag_sq_dors, "sqDors");
add(R.string.tag_remarks_type, "speciesNotes");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public HerptileConverter(Context context) {
addSingle(R.string.tag_age, "age");
addSingle(R.string.tag_habitat, "habitat");
addMulti(R.string.tag_threats_other, "threatsHerptiles");
addMulti(R.string.tag_findings, "findings");
add(R.string.tag_count, "count");
add(R.string.tag_marking, "marking");
add(R.string.tag_distance_from_axis, "axisDistance");
Expand All @@ -34,6 +35,7 @@ public HerptileConverter(Context context) {
add(R.string.tag_sq_dors, "sqDors");
add(R.string.tag_remarks_type, "speciesNotes");
addBool(R.string.tag_confidential, "confidential");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ public InvertebratesConverter(Context context) {
addSingle(R.string.tag_age, "age");
addSingle(R.string.tag_habitat, "habitat");
addMulti(R.string.tag_threats_other, "threatsInvertebrates");
addMulti(R.string.tag_findings, "findings");
add(R.string.tag_count, "count");
add(R.string.tag_marking, "marking");
add(R.string.tag_remarks_type, "speciesNotes");
addBool(R.string.tag_confidential, "confidential");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public MammalConverter(Context context) {
addSingle(R.string.tag_age, "age");
addSingle(R.string.tag_habitat, "habitat");
addMulti(R.string.tag_threats_other, "threatsMammals");
addMulti(R.string.tag_findings, "findings");
add(R.string.tag_count, "count");
add(R.string.tag_marking, "marking");
add(R.string.tag_distance_from_axis, "axisDistance");
Expand All @@ -30,6 +31,7 @@ public MammalConverter(Context context) {
add(R.string.tag_t_air, "tempAir");
add(R.string.tag_remarks_type, "speciesNotes");
addBool(R.string.tag_confidential, "confidential");
addMulti(R.string.tag_threats, "threats");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public PlantsConverter(Context context) {
add(R.string.tag_density, "density");
add(R.string.tag_cover, "cover");
addMulti(R.string.tag_threats_other, "threatsPlants");
addMulti(R.string.tag_threats, "threats");
add(R.string.tag_remarks_type, "speciesNotes");
addBool(R.string.tag_confidential, "confidential");
}
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/layout/fragment_monitoring_form_common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,6 @@

<View style="@style/FieldSeparator" />

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />

<View style="@style/FieldSeparator" />

<org.bspb.smartbirds.pro.ui.views.MemoFormInput
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

Expand All @@ -12,6 +13,15 @@

<View style="@style/FieldSeparator" />

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />

<View style="@style/FieldSeparator" />

<EditText
style="@style/FieldInput.Memo"
android:layout_width="match_parent"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/layout/fragment_monitoring_form_new_cbm_entry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@

</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="10"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />
</TableRow>


</TableLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_1"
/>
android:text="@string/monitoring_ciconia_sep_1" />

<TableRow>

Expand Down Expand Up @@ -73,8 +72,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_2"
/>
android:text="@string/monitoring_ciconia_sep_2" />

<TableRow>

Expand Down Expand Up @@ -102,8 +100,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_3"
/>
android:text="@string/monitoring_ciconia_sep_3" />

<TableRow>

Expand All @@ -115,8 +112,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_4"
/>
android:text="@string/monitoring_ciconia_sep_4" />

<TableRow>

Expand All @@ -127,8 +123,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_5"
/>
android:text="@string/monitoring_ciconia_sep_5" />

<TableRow>

Expand All @@ -139,8 +134,7 @@

<TextView
style="@style/FieldSeparator.Ciconia"
android:text="@string/monitoring_ciconia_sep_6"
/>
android:text="@string/monitoring_ciconia_sep_6" />

<TableRow>

Expand All @@ -166,10 +160,18 @@

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />

<org.bspb.smartbirds.pro.ui.views.MultipleTextFormInput
android:hint="@string/monitoring_ciconia_notes"
android:tag="@string/tag_ciconia_remarks_type" />
</TableRow>

</TableLayout>

<View style="@style/FieldSeparator" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_span="8"
android:hint="@string/monitoring_herp_danger_observation"
android:tag="@string/tag_threats_other"
android:tag="@string/tag_findings"
app:entries="form_herp_danger_observation" />

</TableRow>
Expand Down Expand Up @@ -85,6 +85,17 @@

</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="8"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />
</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleTextFormInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

<org.bspb.smartbirds.pro.ui.views.DecimalNumberFormInput
android:id="@+id/form_herp_count"
android:layout_span="2"
android:hint="@string/monitoring_herp_count"
android:tag="@string/tag_count"
android:text="1"
app:required="true"
android:layout_span="2"
tools:ignore="HardcodedText" />
</TableRow>

Expand All @@ -63,8 +63,8 @@
<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_span="10"
android:hint="@string/monitoring_herp_danger_observation"
android:tag="@string/tag_threats_other"
app:entries="form_herptiles_danger_observation" />
android:tag="@string/tag_findings"
app:entries="form_herptiles_findings" />

</TableRow>

Expand Down Expand Up @@ -93,6 +93,17 @@

</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="10"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />
</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleTextFormInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
app:entries="form_invertebrates_age" />

<org.bspb.smartbirds.pro.ui.views.DecimalNumberFormInput
android:layout_span="2"
android:id="@+id/form_invertebrates_count"
android:layout_span="2"
android:hint="@string/monitoring_herp_count"
android:tag="@string/tag_count"
android:text="1"
Expand All @@ -62,8 +62,8 @@
<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_span="10"
android:hint="@string/monitoring_herp_danger_observation"
android:tag="@string/tag_threats_other"
app:entries="form_invertebrates_danger_observation" />
android:tag="@string/tag_findings"
app:entries="form_invertebrates_findings" />

</TableRow>

Expand All @@ -87,6 +87,17 @@

</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="10"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />
</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleTextFormInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
app:entries="form_mammals_age" />

<org.bspb.smartbirds.pro.ui.views.DecimalNumberFormInput
android:layout_span="2"
android:id="@+id/form_herp_count"
android:layout_span="2"
android:hint="@string/monitoring_herp_count"
android:tag="@string/tag_count"
android:text="1"
Expand All @@ -63,8 +63,8 @@
<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_span="10"
android:hint="@string/monitoring_herp_danger_observation"
android:tag="@string/tag_threats_other"
app:entries="form_mammals_danger_observation" />
android:tag="@string/tag_findings"
app:entries="form_mammals_findings" />

</TableRow>

Expand Down Expand Up @@ -93,6 +93,17 @@

</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleChoiceFormInput_
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="10"
android:hint="@string/monitoring_common_threats"
android:tag="@string/tag_threats"
app:entries="form_main_threats" />
</TableRow>

<TableRow>

<org.bspb.smartbirds.pro.ui.views.MultipleTextFormInput
Expand Down
Loading

0 comments on commit 6e2a81b

Please sign in to comment.