+поле

This commit is contained in:
2024-08-15 17:10:05 +05:00
parent 3227fff605
commit bb99f1644e
4 changed files with 31 additions and 7 deletions

View File

@ -1082,6 +1082,22 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
((selectDB)spiSprObservation).addField(getString(R.string.Yes), "1"); ((selectDB)spiSprObservation).addField(getString(R.string.Yes), "1");
((selectDB)spiSprObservation).addField(getString(R.string.No), "0"); ((selectDB)spiSprObservation).addField(getString(R.string.No), "0");
// Чтоб при изменении значения скрывались соответствующие поля
((selectDB)spiSprObservation).setOnChangeValueListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
LinearLayout llSprDescription = findViewById(R.id.llSprDescription);
if(((selectDB)spiSprObservation).getValue() != null && ((selectDB)spiSprObservation).getValue().equals("1")) {
llSprDescription.setVisibility(View.VISIBLE);
}else{
edtSprDescription.setText("");
llSprDescription.setVisibility(View.GONE);
}
}
});
//H Замечания относительно наблюдаемой практики опрыскивания //H Замечания относительно наблюдаемой практики опрыскивания
edtSprDescription = (EditText) findViewById(R.id.edtSprDescription); edtSprDescription = (EditText) findViewById(R.id.edtSprDescription);
guiTableHealth.add(edtSprDescription, "spr_description"); guiTableHealth.add(edtSprDescription, "spr_description");
@ -3107,6 +3123,15 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
//boolean f; //boolean f;
//int c; //int c;
//Если проводилось наблюдение за опрыскиванием: соблюдалась ли надлежащая практика применения инсектицидов?
LinearLayout llSprDescription = findViewById(R.id.llSprDescription);
if(((selectDB)spiSprObservation).getValue() != null && ((selectDB)spiSprObservation).getValue().equals("1")) {
llSprDescription.setVisibility(View.VISIBLE);
}else{
edtSprDescription.setText("");
llSprDescription.setVisibility(View.GONE);
}
//Имеются ли в непосредственной близости от обработок жилые дома или жилье (в радиусе 2 км вокруг обрабатываемого участка) //Имеются ли в непосредственной близости от обработок жилые дома или жилье (в радиусе 2 км вокруг обрабатываемого участка)
LinearLayout llRiskHouseDistance = findViewById(R.id.llRiskHouseDistance); LinearLayout llRiskHouseDistance = findViewById(R.id.llRiskHouseDistance);
LinearLayout llRiskHouseBufferZones = findViewById(R.id.llRiskHouseBufferZones); LinearLayout llRiskHouseBufferZones = findViewById(R.id.llRiskHouseBufferZones);

View File

@ -2105,6 +2105,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/llSprDescription"
android:baselineAligned="false" android:baselineAligned="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -2044,22 +2044,19 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/llSprDescription"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin"
android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Remarks_about_the_observed_spray_application_practice" android:text="@string/Remarks_about_the_observed_spray_application_practice"
android:textAppearance="?android:attr/textAppearanceSmall"/> android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin">
<EditText <EditText
android:id="@+id/edtSprDescription" android:id="@+id/edtSprDescription"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:importantForAutofill="no" android:importantForAutofill="no"

View File

@ -2182,6 +2182,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/llSprDescription"
android:baselineAligned="false" android:baselineAligned="false"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"