New DB version 154

This commit is contained in:
Igor I
2025-08-26 18:50:30 +05:00
parent 2e0893bac4
commit 1a4fa304da
9 changed files with 664 additions and 860 deletions

View File

@ -26,7 +26,7 @@ import tctable.TCTable;
public class DbOpenHelper extends SQLiteOpenHelper public class DbOpenHelper extends SQLiteOpenHelper
{ {
private static final int DB_VERSION = 153; //Версия ожидаемой базы private static final int DB_VERSION = 154; //Версия ожидаемой базы
private static final String DB_NAME = "Locust"; //Наименование базы private static final String DB_NAME = "Locust"; //Наименование базы
//ArrayList<String> lrFrmLocust = new ArrayList<String>(); //Список обязательных полей для формы саранцчи //ArrayList<String> lrFrmLocust = new ArrayList<String>(); //Список обязательных полей для формы саранцчи
@ -687,7 +687,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
"spray_marking_id boolean," + //Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет) "spray_marking_id boolean," + //Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет)
"efficiency boolean NOT NULL DEFAULT 0," + //For CheckBox "efficiency boolean NOT NULL DEFAULT 0," + //For CheckBox
"efficacy_impact_id integer," + //Тип оцениваемого биологического воздействия "efficacy_impact_id integer," + //Тип оцениваемого биологического воздействия (TODO потом удалить)
"efficacy_impact text," + //Тип оцениваемого биологического воздействия (множественный выбор)
"efficacy_mortality float," + //смертность саранчи(%) "efficacy_mortality float," + //смертность саранчи(%)
"efficacy_passed_time float," + //Прошло времени после обработки "efficacy_passed_time float," + //Прошло времени после обработки
"efficacy_mortality_method integer," + //метод подсчета смертности "efficacy_mortality_method integer," + //метод подсчета смертности
@ -765,7 +766,8 @@ public class DbOpenHelper extends SQLiteOpenHelper
// Контроль эффективности // Контроль эффективности
"efficacy_control boolean," + // Проведен ли контроль эффективности (бригада мониторинга)? "efficacy_control boolean," + // Проведен ли контроль эффективности (бригада мониторинга)?
"efficacy_impact_type_id integer," + // Тип оцениваемого биологического воздействия "efficacy_impact_type_id integer," + // Тип оцениваемого биологического воздействия (TODO удалить)
"efficacy_impact_type text," + // Тип оцениваемого биологического воздействия (множественный выбор)
"efficacy_mortality float," + // Наблюдаемая эффективность обработки (%) "efficacy_mortality float," + // Наблюдаемая эффективность обработки (%)
"efficacy_passed_time float," + // Прошло времени после обработки "efficacy_passed_time float," + // Прошло времени после обработки
"efficacy_mortality_method_id integer," + // Метод оценки эффективности обработки (выбор: подсчет квадратов; подсчет по разрезам; подсчет кулиг личинок; другое) "efficacy_mortality_method_id integer," + // Метод оценки эффективности обработки (выбор: подсчет квадратов; подсчет по разрезам; подсчет кулиг личинок; другое)
@ -899,622 +901,18 @@ public class DbOpenHelper extends SQLiteOpenHelper
{ {
//В SQLIte можно только добавить столбец либо переименовать таблицу https://sqlite.org/lang_altertable.html поэтому обновление усложняется.... //В SQLIte можно только добавить столбец либо переименовать таблицу https://sqlite.org/lang_altertable.html поэтому обновление усложняется....
String sql; String sql;
//if(oldVersion==152 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { //Для "RENAME COLUMN" Версия андроида должнв быть выше Android 11 //if(oldVersion==152 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { //Для "RENAME COLUMN" Версия андроида должнв быть выше Android 11
/* if(oldVersion==153) {
if(oldVersion==144)
{
sql = "create table if not exists frmlocustdel_new(" +
"id integer,uid text NOT NULL,del boolean NOT NULL DEFAULT 0,seq integer NOT NULL DEFAULT 1,send boolean NOT NULL DEFAULT 0,filled boolean,device_id text,user_id integer," +
"image_name1 text," +
"image_send1 boolean NOT NULL DEFAULT 0," +
"image_name2 text," +
"image_send2 boolean NOT NULL DEFAULT 0," +
"image_name3 text," +
"image_send3 boolean NOT NULL DEFAULT 0," +
"country_id integer," +
"region_id integer," +
"area text," +
"district text, " +
"village text, " +
"terrain text, " +
"observer text, " +
"date integer," +
"lat_center double, " +
"lon_center double, " +
"lat1 double, " +
"lon1 double, " +
"lat2 double, " +
"lon2 double, " +
"lat3 double, " +
"lon3 double, " +
"lat4 double, " +
"lon4 double, " +
"lat5 double, " +
"lon5 double, " +
"lat6 double, " +
"lon6 double, " +
"infested_area double," +
"treated_area double," +
"vegetation_type_id integer," +
"vegetation_height float," +
"vegetation_crop text," +
"vegetation_cover_id integer," +
"vegetation_damage integer," +
"vegetation_damage_area double," +
"insecticide_name text," +
"insecticide_active_substance text," +
"insecticide_concentration text," +
"insecticide_formulation_id integer," +
"insecticide_dose float," +
"insecticide_rate float," +
"insecticide_used_volume float," +
"insecticide_number_spores float," +
"insecticide_expiry_date integer," +
"insecticide_mixed text," +
"insecticide_mixed_name text," +
"insecticide_mixed_ratio float," +
"weather_time_start float," +
"weather_time_end float," +
"weather_temperature_start float," +
"weather_temperature_end float," +
"weather_humidity_start float," + //Удалили согласно заданию на 2024год
"weather_humidity_end float," + //Удалили согласно заданию на 2024год
"weather_wind_speed_start float," +
"weather_wind_speed_end float," +
"weather_direction_start integer," +
"weather_direction_end integer," +
"weather_spray_direction_start integer," +
"weather_spray_direction_end integer," +
"locust_type_id integer," +
"locust_hoppers_id integer," +
"locust_imago boolean," +
"locust_density float," +
"locust_kuliguli boolean," +
"locust_swarm boolean," +
"locust_sparse boolean," +
"locust_phase_id integer," +
"spray_platform integer," +
"spray_platform_a integer," +
"spray_platform_g integer," +
"spray_platform_h integer," +
"spray_capacity_id integer," + //Сказали удалить удалил
"spray_operatortype_id integer," +
"spray_manufacturer_name text," +
"spray_model_name text," +
"spray_height float," +
"spray_width float," +
"spray_barrier boolean," +
"spray_barrier_width float," + //В 2024 сказали убрать, теперь не используется
"spray_barrier_space float," +
"spray_speed float," +
"spray_gps boolean," +
"spray_marking_id boolean," +
"efficacy_mortality float," +
"efficacy_passed_time float," +
"efficacy_mortality_method integer," +
"safety_clothing text," +
"safety_clothing_clean boolean," +
"safety_operator_health boolean," +
"description text," +
"safety_inform text," +
"safety_container_id integer," +
"safety_non_target boolean," +
"safety_non_target_effect text," +
"safety_incident boolean," +
"safety_incident_effect text," +
"comments text" +
");";
db.execSQL(sql);
//Копирую данные из одной таблицы в другую
db.execSQL("INSERT INTO frmlocustdel_new SELECT * FROM frmlocustdel;");
db.execSQL("DROP TABLE IF EXISTS frmlocustdel;");
db.execSQL("ALTER TABLE frmlocustdel_new RENAME TO frmlocustdel;");
//We converted the version of the database to version 145. db.execSQL("ALTER TABLE frmlocustdel ADD COLUMN efficacy_impact TEXT;");
oldVersion=145; db.execSQL("UPDATE frmlocustdel SET efficacy_impact = efficacy_impact_id;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN efficacy_impact_type TEXT;");
db.execSQL("UPDATE frmlocusthealth SET efficacy_impact_type = efficacy_impact_type_id;");
oldVersion=154;
} }
if(oldVersion==145)
{
//Добвилось поле safety_container для frmlocustdel
sql = "ALTER TABLE frmlocustdel ADD safety_container text;";
db.execSQL(sql);
sql = "UPDATE frmlocustdel set safety_container=safety_container_id;";
db.execSQL(sql);
//Добавляю временную зону timezone к 2м формам саранчи и проти саранчи
sql = "ALTER TABLE frmlocust ADD timezone text;";
db.execSQL(sql);
sql = "ALTER TABLE frmlocustdel ADD timezone text;";
db.execSQL(sql);
//We converted the version of the database to version 145.
oldVersion=146;
}
if(oldVersion==146) //Новый контракт на 2020 год
{
sql = "ALTER TABLE CountriesRegions ADD lon_max double;";
db.execSQL(sql);
sql = "ALTER TABLE CountriesRegions ADD lon_min double;";
db.execSQL(sql);
sql = "ALTER TABLE CountriesRegions ADD lat_max double;";
db.execSQL(sql);
sql = "ALTER TABLE CountriesRegions ADD lat_min double;";
db.execSQL(sql);
sql = "ALTER TABLE CountriesRegions ADD area double;";
db.execSQL(sql);
//Чтобы заново закачался
sql = "update CountriesRegions set seq=1;";
db.execSQL(sql);
//Коордионаты границы для региона
//sql = "create table if not exists CountriesRegionsPoints(" +
// "id integer NOT NULL PRIMARY KEY AUTOINCREMENT," +
// "uid text, " + //Уникальный идентификатор
// "del boolean NOT NULL DEFAULT 0," +
// "seq integer NOT NULL DEFAULT 1," + //Время изменения
// "country_region_id int NOT NULL," +
// "pos integer NOT NULL," +
// "lon double, " +
// "lat double " +
// ");";
//db.execSQL(sql);
oldVersion=147;
}
if(oldVersion==147){
sql = "ALTER TABLE frmlocustdel ADD efficiency boolean NOT NULL DEFAULT 0;";
db.execSQL(sql);
oldVersion=148;
}
if(oldVersion==148) {
// Для идентификации терминала как зарегистрированного (должна быть 1 запись)
sql = "create table if not exists terminals(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"country_id integer," +
"company_id integer," +
"company_name text," + //Временноеполе до обновления таблицы компаний
"name text," +
"serial text," +
"phone text" +
");";
db.execSQL(sql);
//Список компаний
sql = "create table if not exists companies(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"name text NOT NULL" +
");";
db.execSQL(sql);
oldVersion=149;
}
if(oldVersion==149) {
//Добвилось поле тестовая ли анкета
sql = "ALTER TABLE frmlocustdel ADD test boolean;";
db.execSQL(sql);
sql = "UPDATE frmlocustdel set test=0;";
db.execSQL(sql);
//Добвилось поле тестовая ли анкета
sql = "ALTER TABLE frmlocust ADD test boolean;";
db.execSQL(sql);
sql = "UPDATE frmlocust set test=0;";
db.execSQL(sql);
oldVersion=150;
}
if(oldVersion==150) {
sql = "create table if not exists frmlocust_locations(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"frmlocust_uid text," +
"pos integer NOT NULL," + //Позиция
"lon double NOT NULL," +
"lat double NOT NULL" +
");";
db.execSQL(sql);
sql = "update frmlocust set lon_center=lon1,lat_center=lat1";
db.execSQL(sql);
//Если есть старые данные то копирую их в новую таблицу
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon1,lat1,1 from frmlocust where lon1 is not null";
db.execSQL(sql);
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon2,lat2,2 from frmlocust where lon2 is not null";
db.execSQL(sql);
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon3,lat3,3 from frmlocust where lon3 is not null";
db.execSQL(sql);
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon4,lat4,4 from frmlocust where lon4 is not null";
db.execSQL(sql);
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon5,lat5,5 from frmlocust where lon5 is not null";
db.execSQL(sql);
sql = "insert into frmlocust_locations(frmlocust_uid,lon,lat,pos) select uid,lon6,lat6,6 from frmlocust where lon6 is not null";
db.execSQL(sql);
sql = "create table if not exists frmlocustdel_locations(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"frmlocustdel_uid text," +
"pos integer NOT NULL," + //Позиция
"lon double NOT NULL," +
"lat double NOT NULL" +
");";
db.execSQL(sql);
//Если есть старые данные то копирую их в новую таблицу
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon1,lat1,1 from frmlocustdel where lon1 is not null";
db.execSQL(sql);
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon2,lat2,2 from frmlocustdel where lon2 is not null";
db.execSQL(sql);
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon3,lat3,3 from frmlocustdel where lon3 is not null";
db.execSQL(sql);
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon4,lat4,4 from frmlocustdel where lon4 is not null";
db.execSQL(sql);
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon5,lat5,5 from frmlocustdel where lon5 is not null";
db.execSQL(sql);
sql = "insert into frmlocustdel_locations(frmlocustdel_uid,lon,lat,pos) select uid,lon6,lat6,6 from frmlocustdel where lon6 is not null";
db.execSQL(sql);
oldVersion=151;
}
if(oldVersion==151) {
sql = "ALTER TABLE frmlocustdel ADD locust_purpose_id integer;";
db.execSQL(sql);
sql = """
update main.frmlocustdel set
locust_purpose_id =
CASE
WHEN locust_swarm THEN 3
WHEN locust_kuliguli THEN 2
WHEN locust_imago THEN 1
WHEN locust_sparse THEN 4
ELSE locust_purpose_id
END
where
locust_purpose_id is null;
""";
db.execSQL(sql);
sql = "ALTER TABLE frmlocustdel ADD efficacy_impact_id integer;";
db.execSQL(sql);
sql = "ALTER TABLE frmlocustdel ADD insecticide_diluted_id integer;";
db.execSQL(sql);
sql = "ALTER TABLE frmlocustdel ADD insecticide_proportion float;";
db.execSQL(sql);
sql = "create table if not exists list_purpose(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор (пока не используется)
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"name text NOT NULL," +
"sort integer" + //Порядок сортировки (специально для справичников)
");";
db.execSQL(sql);
sql = "create table if not exists list_impact(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор (пока не используется)
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"name text NOT NULL," +
"sort integer" + //Порядок сортировки (специально для справичников)
");";
db.execSQL(sql);
sql = "create table if not exists list_diluted(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор (пока не используется)
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"name text NOT NULL," +
"sort integer" + //Порядок сортировки (специально для справичников)
");";
db.execSQL(sql);
sql = "create table if not exists frmlocusthealth_locations(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор (пока не используется)
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"frmlocusthealth_uid text," +
"pos integer NOT NULL," + //Позиция
"lon double NOT NULL," +
"lat double NOT NULL" +
");";
db.execSQL(sql);
//Для формы уничтожения саранчи id может быть пустым (только если создали на КПК)
sql = "create table if not exists frmlocusthealth(" +
"id integer," + //Локальный идентификатор на сервере для убыстрения доступа
"uid text NOT NULL, " + //Уникальный идентификатор
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," +
"send boolean NOT NULL DEFAULT 0," +
"frmlocustdel_uid text NOT NULL," + //На основе какой формы заполняется анкета
"filled boolean," + //Заполнена ли анкета (спец поле а не проверка на NULL потому что обязательность полей можно выставлять галочкой в интерфейсе)
"device_id text, " + //Идентификатор устройства
"user_id integer," + //Идентификатор пользователя который заполняет анкету
//Идентификация места мониторинга
"observer text, " + //Имя руководителя бригады по мониторингу ЗЧ и ОС
"date integer," + //Дата создания (по гринвичу?)
"frmlocustdel_filled boolean," + //Заполнялась ли Форма по Мониторингу противосаранчовых обработок бригадой по обработке? (Похоже что это бесполезное поле так как есть поле frmlocustdel_uid)
//Бригада по обработке
"brigade_count integer," + //Количество работников в бригаде по обработке
"brigade_count_trained integer," + //Количество работников, ранее обученных обращению с инсектицидами и их применению
//Информация об инсектицидах
"insecticide_part_number text," + //Номер партии препарата (если указан на контейнере)
"insecticide_manufactured_date text," + //Дата производства или срок годности (срок хранения)
"insecticide_expiration_date integer," + //********** На всякий случай, может и не пригодиться **********
"insecticide_container_state_id integer," + //Состояние пакетов или контейнеров с инсектицидами
//Сведения по опрыскиванию
"spr_leak boolean," + //Механическая безопасность: наблюдалась ли утечка инсектицида? (Да, Нет)
"spr_leak_place text," + //Если Да, в какой части опрыскивателя имеется утечка? (Текст)
"spr_damage boolean," + //Система опрыскивания: повреждены распылители или сопла? (Да, Нет)
"spr_damage_place text," + //Если Да, какие повреждения? (Текст)
"spr_treated_area_check float,"+// Обработанная площадь (проверено бригадой по мониторингу) (га)
"spr_fact_volume float," + // Фактическая норма объема опрыскивания (л/га) Расчет: (объем/площадь)
"spr_observation boolean," + // Если проводилось наблюдение за опрыскиванием: соблюдалась ли надлежащая практика применения инсектицидов?
"spr_description text," + // Замечания относительно наблюдаемой практики опрыскивания
//Калибровка опрыскивателя
"calibr_consumption_check boolean," + // Калибровка расхода жидкости: проверялся ли расход жидкости опрыскивателя во время мониторинга?
"calibr_time integer," + // Время калибровки (мин.):
"calibr_volume integer," + // Собранный объем (л):
"calibr_rate integer," + // Расход жидкости (л/мин):
"calibr_precipitation boolean," + // Качество применения: проверялось ли осаждение капель во время мониторинга?
"calibr_width_card float," + // Длина трансекты, определенная с использованием масляно-/водочувствительной бумаги (м)
"calibr_wind_speed float," + // Средняя скорость ветра при осаждении капель (м/с)
"calibr_droplet_coating float," + // Ширина дорожки с хорошим покрытием капель (м)
"calibr_passes_interval float," + // Рекомендуемый интервал между проходами (м)
// Контроль эффективности
"efficacy_control boolean," + // Проведен ли контроль эффективности (бригада мониторинга)?
"efficacy_impact_type_id integer," + // Тип оцениваемого биологического воздействия
"efficacy_mortality float," + // Наблюдаемая эффективность обработки (%)
"efficacy_passed_time float," + // Прошло времени после обработки
"efficacy_mortality_method integer," + // Метод оценки эффективности обработки (выбор: подсчет квадратов; подсчет по разрезам; подсчет кулиг личинок; другое)
// Здоровье человека
"hlth_safety_clothing_clean boolean," + //Защитная одежда чистая и в хорошем состоянии (В 2024 сказали оставить только в форме по ЗЧ и ОС)
"hlth_clothing_state text," + // Замечания относительно типа и состояния средств индивидуальной защиты
"hlth_clothing_reserve boolean," + // В бригаде или на ближайшей противосаранчовой базе имеется запасная защитная одежда (в частности, комбинезоны и перчатки)
"hlth_operator_passport integer," + // Количество операторов с паспортами использования пестицидов
"hlth_filled_passport integer," + // Количество правильно заполненных паспортов использования пестицидов
"hlth_inhibition boolean," + // Во время мониторинга измерялось ли ингибирование холинэстеразы?
"hlth_description text," + // Дополнительные сведения о случайном воздействии или отравлении
// Состояние окружающей среды
"safety_observed_pollution boolean," + // Наблюдалось или сообщалось о случайном загрязнении? (например, разлив инсектицидов, неправильная очистка оборудования и т. д.)
"safety_type_pollution text," + // Если Да, то где и какой тип загрязнения?
"safety_non_target boolean," + // Наблюдалось или сообщалось о воздействии на нецелевые организмы? (например, болезни домашнего скота, смертность рыб, гибель пчел и т.д.)
"safety_non_target_effect text," + // Если Да, то где и какое воздействие?
"safety_non_target_effect_person text," + // Если информация поступила от прочих лиц, от кого именно? (укажите имя, номер телефона, адрес)
"safety_control boolean," + // Осуществлялся ли бригадой по мониторингу ЗЧ и ОС контроль в отношении наблюдаемого или зарегистрированного воздействия на окружающую среду
"safety_control_actions text," + // Если Да, опишите последующее действие(я)
"map_treatment boolean," + // Была ли составлена ситуационная карта обработки?
"image_name1 text," + //Наименование рисунка 1
"image_send1 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false)
"image_name2 text," + //Наименование рисунка 2
"image_send2 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false)
"image_name3 text," + //Наименование рисунка 3
"image_send3 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false)
"image_name4 text," + //Наименование рисунка 4
"image_send4 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false)
"image_name5 text," + //Наименование рисунка 5
"image_send5 boolean NOT NULL DEFAULT 0," + //Отправили ли рисунок 1 на сервер (При изменении отмечается как не отправленное false)
"risk_house boolean," + // Имеются ли в непосредственной близости от обработок жилые дома или жилье (в радиусе 2 км вокруг обрабатываемого участка)
"risk_house_distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего жилья:
"risk_house_buffer_zones boolean," + // Соблюдались ли буферные зоны?
"risk_house_impact boolean," + // Существует ли вероятность воздействия на жилые дома/жилье?
"risk_house_informed boolean," + // Были ли проинформированы жители о применении инсектицидов? (проверка бригадой по мониторингу)
"risk_water boolean," + // Имеются ли в непосредственной близости от обработок поверхностные воды (в радиусе 2 км вокруг обрабатываемого участка)
"risk_water_distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до ближайшего источника поверхностной воды:
"risk_water_buffer_zones boolean," + // Соблюдались ли буферные зоны?
"risk_water_impact boolean," + // Существует ли вероятность воздействия на поверхностные воды?
"risk_apiary boolean," + // Имеются ли в непосредственной близости от обработок пчеловодства (в радиусе 5 км вокруг обрабатываемого участка)
"risk_apiary_distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до пасеки
"risk_apiary_informed boolean," + // Были ли пчеловоды проинформированы о применении инсектицидов
"risk_apiary_measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на пчел
"risk_apiary_impact boolean," + // Существует ли вероятность воздействия на пчел
"risk_agricultural boolean," + // Были ли обработаны или подверглись воздействию какие-либо сельхозкультуры?
"risk_agricultural_name text," + // Наименование сельхозкультуры
"risk_agricultural_phase text," + // Фаза развития сельхозкультуры
"risk_agricultural_toxic boolean," + // Наблюдалась ли фитотоксичность
"risk_agricultural_inform boolean," + // Были ли фермеры проинформированы о предуборочном периоде
"risk_silk boolean," + // Имеются ли в непосредственной близости от обработок шелководства (в радиусе 2 км вокруг обрабатываемого участка)
"risk_silk_distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до тутовой плантации
"risk_silk_inform boolean," + // Были ли шелководы проинформированы о применении инсектицидов?
"risk_silk_trees_measure text," + // Какие меры были предприняты для снижения отрицательного воздействия на тутовые деревья
"risk_silk_trees_impact boolean," + // Существует ли вероятность воздействия на тутовые деревья
"risk_pastures boolean," + // Были ли обработаны луга или пастбища?
"risk_pastures_inform boolean," + // Были ли пастухи проинформированы о периодах удержания домашнего скота?
"risk_park boolean," + // Имеются ли в непосредственной близости от обработок другие экологически чувствительные зоны
"risk_park_type text," + // Какой тип экологически чувствительной зоны
"risk_park_distance float," + // Расстояние от ближайшего края обрабатываемого участка (м) до экологически чувствительной зоны
"risk_park_buffer_zones boolean," + // Соблюдались ли буферные зоны?
"risk_park_impact boolean," + // Существует ли вероятность воздействия на экологически чувствительные зоны?
"risk_probe_analysis boolean," + // Пробы, взятые для анализа остатков
"risk_probe_analysis_name text," + // Проба какого субстрата или организма была взята
"risk_probe_analysis_number text," + // Регистрационный номер формы отбора проб
"test boolean" + //Тестовая ли анкета
");";
db.execSQL(sql);
oldVersion=152;
}
if(oldVersion==152 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { //Для "RENAME COLUMN" Версия андроида должнв быть выше Android 11
//Теперь дата в виде текстового поля храниться так как при синхронизации с сервера она приходит в виде даты
db.execSQL("ALTER TABLE frmlocust ADD COLUMN date_temp TEXT;");
db.execSQL("UPDATE frmlocust SET date_temp = date;");
db.execSQL("ALTER TABLE frmlocust RENAME COLUMN date TO date_DEL;");
db.execSQL("ALTER TABLE frmlocust RENAME COLUMN date_temp TO date;");
db.execSQL("ALTER TABLE frmlocustdel ADD COLUMN date_temp TEXT;");
db.execSQL("UPDATE frmlocustdel SET date_temp = date;");
db.execSQL("ALTER TABLE frmlocustdel RENAME COLUMN date TO date_DEL;");
db.execSQL("ALTER TABLE frmlocustdel RENAME COLUMN date_temp TO date;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN date_temp TEXT;");
db.execSQL("UPDATE frmlocusthealth SET date_temp = date;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN date TO date_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN date_temp TO date;");
//Дата производства или срок годности (срок хранения)
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN insecticide_manufactured_date_temp TEXT;");
db.execSQL("UPDATE frmlocusthealth SET insecticide_manufactured_date_temp = insecticide_manufactured_date;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN insecticide_manufactured_date TO insecticide_manufactured_date_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN insecticide_manufactured_date_temp TO insecticide_manufactured_date;");
db.execSQL("ALTER TABLE frmlocusthealth ADD timezone text;");
sql = "create table if not exists list_containers_states(" +
"id integer NOT NULL PRIMARY KEY," +
"uid text, " + //Уникальный идентификатор пока не используется но для распределенной базы будет использоваться
"del boolean NOT NULL DEFAULT 0," +
"seq integer NOT NULL DEFAULT 1," + //Время изменения
"name text NOT NULL," +
"sort integer" + //Порядок сортировки (специально для справичников)
");";
db.execSQL(sql);
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN spr_leak_plase TO spr_leak_plase_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN spr_damage_plase TO spr_damage_plase_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN spr_leak_place TEXT;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN spr_damage_place TEXT;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN spr_treated_area_check TO spr_treated_area_check_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN spr_treated_area_check float;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN spr_fact_volume float;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN efficacy_mortality_method TO efficacy_mortality_method_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN efficacy_mortality_method_id integer;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN hlth_inhibition boolean;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN hlth_safety_clothing_clean boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN hlth_passport_count TO hlth_passport_count_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN lat_center double;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN lon_center double;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_house TO risk_house_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_house boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_house_distance TO risk_house_distance_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_house_distance float;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_house_buffer_zones TO risk_house_buffer_zones_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_house_buffer_zones boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_house_impact TO risk_house_impact_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_house_impact boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_house_informed TO risk_house_informed_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_house_informed boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_water TO risk_water_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_water boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_water_distance TO risk_water_distance_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_water_distance float;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_water_buffer_zones TO risk_water_buffer_zones_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_water_buffer_zones boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_water_impact TO risk_water_impact_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_water_impact boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_apiary TO risk_apiary_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_apiary boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_apiary_distance TO risk_apiary_distance_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_apiary_distance float;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_apiary_informed TO risk_apiary_informed_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_apiary_informed boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_apiary_measure TO risk_apiary_measure_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_apiary_measure text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_apiary_impact TO risk_apiary_impact_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_apiary_impact boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN safety_control TO safety_control_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN safety_control boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN safety_control_actions TO safety_control_actions_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN safety_control_actions text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_agricultural TO risk_agricultural_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_agricultural boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_agricultural_name TO risk_agricultural_name_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_agricultural_name text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_agricultural_phase TO risk_agricultural_phase_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_agricultural_phase text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_agricultural_toxic TO risk_agricultural_toxic_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_agricultural_toxic boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_agricultural_inform TO risk_agricultural_inform_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_agricultural_inform boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_silk_inform TO risk_silk_inform_DEL;");
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_silk_inform boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_silk_trees_measure TO risk_silk_trees_measure_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_silk_trees_measure text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_silk_trees_impact TO risk_silk_trees_impact_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_silk_trees_impact boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_pastures TO risk_pastures_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_pastures boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_pastures_inform TO risk_pastures_inform_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_pastures_inform boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_park TO risk_park_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_park boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_park_type TO risk_park_type_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_park_type text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_park_distance TO risk_park_distance_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_park_distance float;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_park_buffer_zones TO risk_park_buffer_zones_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_park_buffer_zones boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_park_impact TO risk_park_impact_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_park_impact boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_probe_analysis TO risk_probe_analysis_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_probe_analysis boolean;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_probe_analysis_name TO risk_probe_analysis_name_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_probe_analysis_name text;");
db.execSQL("ALTER TABLE frmlocusthealth RENAME COLUMN risk_probe_analysis_number TO risk_probe_analysis_number_DEL;"); //Гадина при вставке учитывает регистр символов!!!
db.execSQL("ALTER TABLE frmlocusthealth ADD COLUMN risk_probe_analysis_number text;");
oldVersion=153;
}
*/
if(oldVersion < newVersion) //Это условие выполняется: если совсем старые версии и не знаю что поменялось... if(oldVersion < newVersion) //Это условие выполняется: если совсем старые версии и не знаю что поменялось...
{ {

View File

@ -36,6 +36,7 @@ import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.GridLayout;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.ScrollView; import android.widget.ScrollView;
@ -167,6 +168,9 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
public CheckBox cbEffectiveness = null; // Галочка чтоб сделать поля не обязательными public CheckBox cbEffectiveness = null; // Галочка чтоб сделать поля не обязательными
public View spiTypeImpact = null; // Тип оцениваемого биологического воздействия public View spiTypeImpact = null; // Тип оцениваемого биологического воздействия
public GridLayout glBiologicalImpact = null; // Тип оцениваемого биологического воздействия (grid)
public EditText edtBiologicalImpact = null; // Тип оцениваемого биологического воздействия (список значений)
public EditText edtEffMortality = null; // смертность саранчи(%) public EditText edtEffMortality = null; // смертность саранчи(%)
public EditText edtEffTime = null; // Прошло времени после обработки в часах public EditText edtEffTime = null; // Прошло времени после обработки в часах
public View spiEffMethod = null; // метод подсчета смертности public View spiEffMethod = null; // метод подсчета смертности
@ -1026,7 +1030,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
}; };
cbEffectiveness.setOnClickListener(oclCbBoxEggs); cbEffectiveness.setOnClickListener(oclCbBoxEggs);
spiTypeImpact = findViewById(R.id.spiTypeImpact); //Тип оцениваемого биологического воздействия /*spiTypeImpact = findViewById(R.id.spiTypeImpact); //Тип оцениваемого биологического воздействия
guiTable.add(spiTypeImpact, "efficacy_impact_id"); guiTable.add(spiTypeImpact, "efficacy_impact_id");
((selectDB)spiTypeImpact).addField("", ""); ((selectDB)spiTypeImpact).addField("", "");
dboh = new DbOpenHelper(this); dboh = new DbOpenHelper(this);
@ -1049,8 +1053,83 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
if(cursor!=null){ cursor.close(); } if(cursor!=null){ cursor.close(); }
if(rdb!=null){ rdb.close(); } if(rdb!=null){ rdb.close(); }
} }
dboh.close();*/
//Type of biological impact being assessed (I build a table of checkboxes)
edtBiologicalImpact = findViewById(R.id.edtBiologicalImpact);
guiTable.add(edtBiologicalImpact, "efficacy_impact");
OnCheckedChangeListener occlBiologicalImpact = new OnCheckedChangeListener()
{
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
StringBuilder val = new StringBuilder();
// loop through all elements inside the GridLayout
for (int i = 0; i < glBiologicalImpact.getChildCount(); i++) {
View child = glBiologicalImpact.getChildAt(i);
if (child instanceof CheckBox) {
CheckBox cb = (CheckBox) child;
if (cb.isChecked()) {
val.append(cb.getTag().toString()).append(",");
}
}
}
// remove the last comma if there is one
if (val.length() > 0 && val.charAt(val.length() - 1) == ',') {
val.deleteCharAt(val.length() - 1);
}
// save in editText
LocustDelActivity.this.edtBiologicalImpact.setText(val.toString());
}
};
glBiologicalImpact = findViewById(R.id.glBiologicalImpact);
dboh = new DbOpenHelper(this);
rdb = null;
cursor = null;
try {
rdb = dboh.getReadableDatabase();
cursor = rdb.rawQuery("select d.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = d.name AND l.short_name='"
+ Tools.getLang() + "' LIMIT 1),d.name) name from list_impact d where d.del=0 order by d.sort,d.name", null);
if (cursor.moveToFirst())
{
int row = 0;
int col = 0;
int colCount = glBiologicalImpact.getColumnCount(); // например 2
do
{
String name = cursor.getString(cursor.getColumnIndexOrThrow("name"));
String id = cursor.getString(cursor.getColumnIndexOrThrow("id"));
CheckBox cb = new CheckBox(this);
cb.setText(name);
cb.setTag(id);
cb.setLayoutParams(new GridLayout.LayoutParams(
GridLayout.spec(row, 1f), // row index
GridLayout.spec(col, 1f) // column index
));
cb.setOnCheckedChangeListener(occlBiologicalImpact);
glBiologicalImpact.addView(cb);
col++;
if (col >= colCount) {
col = 0;
row++;
}
} while (cursor.moveToNext());
}
}catch(Exception e){
e.printStackTrace();
}finally{
if(cursor!=null){ cursor.close(); }
if(rdb!=null){ rdb.close(); }
}
dboh.close(); dboh.close();
edtEffMortality = (EditText) findViewById(R.id.edtEffMortality); // смертность саранчи(%) edtEffMortality = (EditText) findViewById(R.id.edtEffMortality); // смертность саранчи(%)
guiTable.add(edtEffMortality, "efficacy_mortality"); guiTable.add(edtEffMortality, "efficacy_mortality");
//edtEffMortality.setFilters(new InputFilter[] { new InputFilterMinMax("0", "100") }); //edtEffMortality.setFilters(new InputFilter[] { new InputFilterMinMax("0", "100") });
@ -1869,6 +1948,13 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
llEffectiveness.setVisibility(View.VISIBLE); llEffectiveness.setVisibility(View.VISIBLE);
} else } else
{ {
for (int i = 0; i < glBiologicalImpact.getChildCount(); i++) {
View child = glBiologicalImpact.getChildAt(i);
if (child instanceof CheckBox) {
CheckBox cb = (CheckBox) child;
cb.setChecked(false);
}
}
edtEffMortality.setText(""); edtEffMortality.setText("");
edtEffTime.setText(""); edtEffTime.setText("");
((selectDB)spiEffMethod).setValue(""); ((selectDB)spiEffMethod).setValue("");

View File

@ -32,6 +32,7 @@ import android.view.View.OnClickListener;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.EditText; import android.widget.EditText;
import android.widget.GridLayout;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView; import android.widget.ListView;
import android.widget.ScrollView; import android.widget.ScrollView;
@ -159,8 +160,12 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
public View spiEffControl = null; // Контроль эфективности public View spiEffControl = null; // Контроль эфективности
public View spiEffTypeImpact = null; // Тип оцениваемого биологического воздействия public View spiEffTypeImpact = null; // Тип оцениваемого биологического воздействия
public GridLayout glEffTypeImpact = null; // Тип оцениваемого биологического воздействия (grid)
public EditText edtEffTypeImpact = null; // Тип оцениваемого биологического воздействия (список значений)
//glBiologicalImpact
public EditText edtEffMortality = null; // смертность саранчи(%) public EditText edtEffMortality = null; // смертность саранчи(%)
public EditText edtEffPassedTime = null; // Прошло времени после обработки в часах public EditText edtEffPassedTime = null; // Прошло времени после обработки в часах
public View spiEffMethod = null; // метод подсчета смертности public View spiEffMethod = null; // метод подсчета смертности
public View spiEffControl2 = null; //H Проведен ли контроль эффективности (бригада мониторинга)? public View spiEffControl2 = null; //H Проведен ли контроль эффективности (бригада мониторинга)?
@ -1273,7 +1278,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
} }
//Тип оцениваемого биологического воздействия //Тип оцениваемого биологического воздействия
spiEffTypeImpact = findViewById(R.id.spiEffTypeImpact); /*spiEffTypeImpact = findViewById(R.id.spiEffTypeImpact);
guiTableDel.add(spiEffTypeImpact, "efficacy_impact_id"); guiTableDel.add(spiEffTypeImpact, "efficacy_impact_id");
((selectDB)spiEffTypeImpact).addField("", ""); ((selectDB)spiEffTypeImpact).addField("", "");
dboh = new DbOpenHelper(this); dboh = new DbOpenHelper(this);
@ -1297,8 +1302,66 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
if(cursor!=null){ cursor.close(); } if(cursor!=null){ cursor.close(); }
if(rdb!=null){ rdb.close(); } if(rdb!=null){ rdb.close(); }
} }
dboh.close();*/
//public GridLayout glEffTypeImpact = null; // Тип оцениваемого биологического воздействия (grid)
//public EditText edtEffTypeImpact = null; // Тип оцениваемого биологического воздействия (список значений)
glEffTypeImpact = findViewById(R.id.glEffTypeImpact);
dboh = new DbOpenHelper(this);
rdb = null;
cursor = null;
try {
rdb = dboh.getReadableDatabase();
cursor = rdb.rawQuery("select d.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = d.name AND l.short_name='"
+ Tools.getLang() + "' LIMIT 1),d.name) name from list_impact d where d.del=0 order by d.sort,d.name", null);
if (cursor.moveToFirst())
{
int row = 0;
int col = 0;
int colCount = glEffTypeImpact.getColumnCount(); // например 2
do
{
String name = cursor.getString(cursor.getColumnIndexOrThrow("name"));
String id = cursor.getString(cursor.getColumnIndexOrThrow("id"));
CheckBox cb = new CheckBox(this);
cb.setText(name);
cb.setTag(id);
cb.setEnabled(false);
cb.setFocusable(false);
cb.setClickable(false);
cb.setLayoutParams(new GridLayout.LayoutParams(
GridLayout.spec(row, 1f), // row index
GridLayout.spec(col, 1f) // column index
));
//cb.setOnCheckedChangeListener(occlBiologicalImpact);
glEffTypeImpact.addView(cb);
col++;
if (col >= colCount) {
col = 0;
row++;
}
} while (cursor.moveToNext());
}
}catch(Exception e){
e.printStackTrace();
}finally{
if(cursor!=null){ cursor.close(); }
if(rdb!=null){ rdb.close(); }
}
dboh.close(); dboh.close();
// Наблюдаемая эфективность обработок (%) // Наблюдаемая эфективность обработок (%)
edtEffMortality = (EditText) findViewById(R.id.edtEffMortality); edtEffMortality = (EditText) findViewById(R.id.edtEffMortality);
guiTableDel.add(edtEffMortality, "efficacy_mortality"); guiTableDel.add(edtEffMortality, "efficacy_mortality");

View File

@ -1939,7 +1939,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin"
android:visibility="gone">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -1952,6 +1953,41 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:id="@+id/glBiologicalImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -2053,6 +2089,14 @@
android:text="@string/Protective_clothing" android:text="@string/Protective_clothing"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/> android:textStyle="bold"/>
<EditText
android:id="@+id/edtClothing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</LinearLayout> </LinearLayout>
<GridLayout <GridLayout
@ -2117,14 +2161,6 @@
android:layout_gravity="left|top" android:layout_gravity="left|top"
android:layout_row="2" android:layout_row="2"
android:text="@string/Protection_is_absent" /> android:text="@string/Protection_is_absent" />
<EditText
android:id="@+id/edtClothing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</GridLayout> </GridLayout>
<LinearLayout <LinearLayout
@ -2182,7 +2218,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Inform_abaut_spraying" android:text="@string/Inform_abaut_spraying"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<EditText
android:id="@+id/edtInform"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_row="0"
android:hint=""
android:visibility="invisible" />
<GridLayout <GridLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -2242,15 +2285,6 @@
android:layout_gravity="left|top" android:layout_gravity="left|top"
android:layout_row="1" android:layout_row="1"
android:text="@string/Other_people" /> android:text="@string/Other_people" />
<EditText
android:id="@+id/edtInform"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_row="0"
android:hint=""
android:visibility="invisible" />
</GridLayout> </GridLayout>
</LinearLayout> </LinearLayout>
@ -2269,6 +2303,14 @@
android:text="@string/Empty_containers" android:text="@string/Empty_containers"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/> android:textStyle="bold"/>
<EditText
android:id="@+id/edtSafEmptyContainers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_row="0"
android:hint=""
android:visibility="invisible" />
</LinearLayout> </LinearLayout>
<GridLayout <GridLayout
@ -2325,14 +2367,6 @@
android:layout_gravity="left|top" android:layout_gravity="left|top"
android:layout_row="1" android:layout_row="1"
android:text="@string/Other" /> android:text="@string/Other" />
<EditText
android:id="@+id/edtSafEmptyContainers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_row="0"
android:hint=""
android:visibility="invisible" />
</GridLayout> </GridLayout>
<LinearLayout <LinearLayout

View File

@ -24,11 +24,6 @@
android:showDividers="middle" android:showDividers="middle"
android:paddingRight="@dimen/activity_vertical_margin"> android:paddingRight="@dimen/activity_vertical_margin">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="spiEffTypeImpact" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -2530,6 +2525,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:visibility="gone"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
@ -2552,6 +2548,67 @@
android:background="@color/button_pink_normal_start"/> android:background="@color/button_pink_normal_start"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:enabled="false"
android:focusable="false"
android:clickable="false"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<GridLayout
android:id="@+id/glEffTypeImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -1807,7 +1807,8 @@
<LinearLayout <LinearLayout
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:visibility="gone">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -1824,6 +1825,41 @@
android:minHeight="@dimen/minHeight"/> android:minHeight="@dimen/minHeight"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:id="@+id/glBiologicalImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content" >
@ -1928,78 +1964,6 @@
android:text="@string/Protective_clothing" android:text="@string/Protective_clothing"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="3"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbSafClothingGoggles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Goggles" />
<CheckBox
android:id="@+id/cbSafClothingMasks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Masks" />
<CheckBox
android:id="@+id/cbSafClothingGloves"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Gloves" />
<CheckBox
android:id="@+id/cbSafClothingOveralls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Overalls" />
<CheckBox
android:id="@+id/cbSafClothingCaps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Caps" />
<CheckBox
android:id="@+id/cbSafClothingBoots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Boots" />
<CheckBox
android:id="@+id/cbSafClothingAbsent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="2"
android:text="@string/Protection_is_absent" />
<EditText <EditText
android:id="@+id/edtClothing" android:id="@+id/edtClothing"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -2008,6 +1972,70 @@
android:layout_row="2" android:layout_row="2"
android:hint="" android:hint=""
android:visibility="invisible" /> android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="3"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbSafClothingGoggles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Goggles" />
<CheckBox
android:id="@+id/cbSafClothingMasks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Masks" />
<CheckBox
android:id="@+id/cbSafClothingGloves"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Gloves" />
<CheckBox
android:id="@+id/cbSafClothingOveralls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Overalls" />
<CheckBox
android:id="@+id/cbSafClothingCaps"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Caps" />
<CheckBox
android:id="@+id/cbSafClothingBoots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Boots" />
<CheckBox
android:id="@+id/cbSafClothingAbsent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="2"
android:text="@string/Protection_is_absent" />
</GridLayout> </GridLayout>
<LinearLayout <LinearLayout
@ -2065,69 +2093,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/Inform_abaut_spraying" android:text="@string/Inform_abaut_spraying"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbSafInformFarmer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Farmer" />
<CheckBox
android:id="@+id/cbSafInformShepherd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Shepherd" />
<CheckBox
android:id="@+id/cbSafInformBeekeeper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Beekeeper" />
<CheckBox
android:id="@+id/cbSafInformVillager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Villager" />
<CheckBox
android:id="@+id/cbSafInformOfficial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Official" />
<CheckBox
android:id="@+id/cbSafInformOther"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Other_people" />
<EditText <EditText
android:id="@+id/edtInform" android:id="@+id/edtInform"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -2136,6 +2101,62 @@
android:layout_row="0" android:layout_row="0"
android:hint="" android:hint=""
android:visibility="invisible" /> android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbSafInformFarmer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Farmer" />
<CheckBox
android:id="@+id/cbSafInformShepherd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Shepherd" />
<CheckBox
android:id="@+id/cbSafInformBeekeeper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Beekeeper" />
<CheckBox
android:id="@+id/cbSafInformVillager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Villager" />
<CheckBox
android:id="@+id/cbSafInformOfficial"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Official" />
<CheckBox
android:id="@+id/cbSafInformOther"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Other_people" />
</GridLayout> </GridLayout>
<!--LinearLayout <!--LinearLayout
@ -2181,69 +2202,6 @@
android:text="@string/Empty_containers" android:text="@string/Empty_containers"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/> android:textStyle="bold"/>
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbTripleRinsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Farmer" />
<CheckBox
android:id="@+id/cbPunctured"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Shepherd" />
<CheckBox
android:id="@+id/cbTakenBackToBase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Beekeeper" />
<CheckBox
android:id="@+id/cbLeftInField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Villager" />
<CheckBox
android:id="@+id/cbBuried"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Official" />
<CheckBox
android:id="@+id/cbBurned"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Other" />
<EditText <EditText
android:id="@+id/edtSafEmptyContainers" android:id="@+id/edtSafEmptyContainers"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -2252,6 +2210,62 @@
android:layout_row="0" android:layout_row="0"
android:hint="" android:hint=""
android:visibility="invisible" /> android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<CheckBox
android:id="@+id/cbTripleRinsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Farmer" />
<CheckBox
android:id="@+id/cbPunctured"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Shepherd" />
<CheckBox
android:id="@+id/cbTakenBackToBase"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="0"
android:text="@string/Beekeeper" />
<CheckBox
android:id="@+id/cbLeftInField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Villager" />
<CheckBox
android:id="@+id/cbBuried"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Official" />
<CheckBox
android:id="@+id/cbBurned"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="2"
android:layout_gravity="left|top"
android:layout_row="1"
android:text="@string/Other" />
</GridLayout> </GridLayout>
<LinearLayout <LinearLayout

View File

@ -2419,6 +2419,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -2444,6 +2445,61 @@
android:background="@color/button_pink_normal_start"/> android:background="@color/button_pink_normal_start"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:enabled="false"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<GridLayout
android:id="@+id/glEffTypeImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content" >

View File

@ -1935,7 +1935,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin"
android:visibility="gone">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -1948,6 +1949,42 @@
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</LinearLayout>
<GridLayout
android:id="@+id/glBiologicalImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -2052,6 +2089,14 @@
android:text="@string/Protective_clothing" android:text="@string/Protective_clothing"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"/> android:textStyle="bold"/>
<EditText
android:id="@+id/edtClothing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</LinearLayout> </LinearLayout>
<GridLayout <GridLayout
@ -2124,14 +2169,6 @@
android:layout_row="2" android:layout_row="2"
android:text="@string/Protection_is_absent" /> android:text="@string/Protection_is_absent" />
<EditText
android:id="@+id/edtClothing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
</GridLayout> </GridLayout>
<LinearLayout <LinearLayout

View File

@ -2670,11 +2670,14 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"> android:paddingLeft="@dimen/activity_horizontal_margin"
android:visibility="gone">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -2696,6 +2699,62 @@
android:background="@color/button_pink_normal_start"/> android:background="@color/button_pink_normal_start"/>
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="5dp"
android:text="@string/Type_of_assessed_biological_impact"
android:textAppearance="?android:attr/textAppearanceSmall"
android:enabled="false"
android:focusable="false"
android:clickable="false"/>
<EditText
android:id="@+id/edtBiologicalImpact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="2"
android:hint=""
android:visibility="invisible" />
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin">
<GridLayout
android:id="@+id/glEffTypeImpact"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:columnCount="2"
android:rowCount="2"
android:paddingLeft="@dimen/activity_horizontal_margin">
<!-- CheckBox elements are created programmatically -->
</GridLayout>
<View
android:layout_width="@dimen/activity_vertical_margin"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@color/button_pink_normal_start"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"