Остановился на защитной одежде (нужно добавить в таблицы это поле)
This commit is contained in:
@ -6,6 +6,10 @@ import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.EditText;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@ -32,13 +36,26 @@ public class DateTimeTM extends com.google.android.material.textfield.TextInputE
|
||||
m_Value = val;
|
||||
if(val!=null && !val.equals(""))
|
||||
{
|
||||
Date date = new Date(Long.parseLong(m_Value)*1000);
|
||||
|
||||
Date date=null;
|
||||
try {
|
||||
date = new Date(Long.parseLong(m_Value)*1000);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
if(date==null){
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
date = format.parse(m_Value);
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
}
|
||||
if(date!=null) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm");
|
||||
//format.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
String str = format.format(date);
|
||||
setText(str);
|
||||
}else{
|
||||
setText("");
|
||||
}
|
||||
}else
|
||||
{
|
||||
setText("");
|
||||
|
||||
@ -210,7 +210,9 @@ public class DBGUITable
|
||||
Object obj=findComponent(cursor.getColumnName(i));
|
||||
if(obj!=null)
|
||||
{
|
||||
if(cursor.getColumnName(i).equals("date")) {
|
||||
Log.e("CCALM", "1 field " + cursor.getColumnName(i) + " = " + cursor.getString(i) + " type= " + cursor.getType(i));
|
||||
}
|
||||
|
||||
if(cursor.getType(i)==2){ //Because cutting double
|
||||
setValue(obj, ""+cursor.getDouble(i));
|
||||
@ -261,21 +263,21 @@ public class DBGUITable
|
||||
public void setValue(Object obj, String value)
|
||||
{
|
||||
if(obj==null) return;
|
||||
String className = obj.getClass().toString();
|
||||
//Log.d("igor","getClass = "+className);
|
||||
|
||||
//Log.d("igor","getClass = "+obj.getClass().toString());
|
||||
|
||||
if(obj.getClass().toString().indexOf("android.widget.EditText")!=-1) ((EditText)obj).setText(value);
|
||||
if(obj.getClass().toString().indexOf("android.material.textfield.TextInputEditText")!=-1) ((TextInputEditText)obj).setText(value);
|
||||
if(obj.getClass().toString().indexOf("android.widget.Spinner")!=-1) Tools.selSpinnerIC(((Spinner)obj), value);
|
||||
if(obj.getClass().toString().indexOf("android.widget.CheckBox")!=-1) ((CheckBox)obj).setChecked(value.equals("1") ? true : false);
|
||||
//if(obj.getClass().toString().indexOf("java.lang.Integer")!=-1) ((Integer)obj)=Integer.parseInt(value); так не работает
|
||||
//if(obj.getClass().toString().indexOf("java.lang.String")!=-1) ((String)obj)=value; так не работает
|
||||
if(obj.getClass().toString().indexOf("dbfields.SpinnerDB")!=-1) ((SpinnerDB)obj).setValue(value);
|
||||
if(obj.getClass().toString().indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)obj).setValue(value);
|
||||
if(obj.getClass().toString().indexOf("dbfields.StringDB")!=-1) ((StringDB)obj).setValue(value);
|
||||
if(obj.getClass().toString().indexOf("dbfields.DateTimeTM")!=-1) ((DateTimeTM)obj).setValue(value);
|
||||
if(obj.getClass().toString().indexOf("dbfields.DateTimeText")!=-1) ((DateTimeText)obj).setValue(value);
|
||||
if(obj.getClass().toString().indexOf("dbfields.DateInput")!=-1)
|
||||
if(className.indexOf("android.widget.EditText")!=-1) ((EditText)obj).setText(value);
|
||||
if(className.indexOf("android.material.textfield.TextInputEditText")!=-1) ((TextInputEditText)obj).setText(value);
|
||||
if(className.indexOf("android.widget.Spinner")!=-1) Tools.selSpinnerIC(((Spinner)obj), value);
|
||||
if(className.indexOf("android.widget.CheckBox")!=-1) ((CheckBox)obj).setChecked(value.equals("1") ? true : false);
|
||||
//if(className.indexOf("java.lang.Integer")!=-1) ((Integer)obj)=Integer.parseInt(value); так не работает
|
||||
//if(className.indexOf("java.lang.String")!=-1) ((String)obj)=value; так не работает
|
||||
if(className.indexOf("dbfields.SpinnerDB")!=-1) ((SpinnerDB)obj).setValue(value);
|
||||
if(className.indexOf("dbfields.AutoCompleteTextViewDB")!=-1) ((AutoCompleteTextViewDB)obj).setValue(value);
|
||||
if(className.indexOf("dbfields.StringDB")!=-1) ((StringDB)obj).setValue(value);
|
||||
if(className.indexOf("dbfields.DateTimeTM")!=-1) ((DateTimeTM)obj).setValue(value);
|
||||
if(className.indexOf("dbfields.DateTimeText")!=-1) ((DateTimeText)obj).setValue(value);
|
||||
if(className.indexOf("dbfields.DateInput")!=-1)
|
||||
{
|
||||
if(value==null)
|
||||
{ ((DateInput)obj).setDate((Date)null);
|
||||
|
||||
@ -22,7 +22,7 @@ import tctable.TCTable;
|
||||
|
||||
public class DbOpenHelper extends SQLiteOpenHelper
|
||||
{
|
||||
private static final int DB_VERSION = 152; //Версия ожидаемой базы
|
||||
private static final int DB_VERSION = 153; //Версия ожидаемой базы
|
||||
private static final String DB_NAME = "Locust"; //Наименование базы
|
||||
|
||||
//ArrayList<String> lrFrmLocust = new ArrayList<String>(); //Список обязательных полей для формы саранцчи
|
||||
@ -478,7 +478,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
"terrain text, " + //Название местности либо урочища
|
||||
|
||||
"observer text, " + //ФИО наблюдателя
|
||||
"date integer, " + //Время создания секунд с 1970 года (long) (по гринвичу?)
|
||||
"date text, " +//"date integer, " + //Время создания секунд с 1970 года (long) (по гринвичу?)
|
||||
"timezone text, " + //Временная зона
|
||||
"lat_center double, " +
|
||||
"lon_center double, " +
|
||||
@ -582,7 +582,7 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
"terrain text, " + //Название местности либо урочища
|
||||
|
||||
"observer text, " + //ФИО наблюдателя
|
||||
"date integer," + //Время создания секунд с 1970 года (long), теоретически должна быть уникальной для пользователя (по гринвичу?)
|
||||
"date text," + //"date integer," + //Время создания секунд с 1970 года (long), теоретически должна быть уникальной для пользователя (по гринвичу?)
|
||||
"timezone text, " + //Временная зона
|
||||
"lat_center double, " +
|
||||
"lon_center double, " +
|
||||
@ -1350,6 +1350,29 @@ public class DbOpenHelper extends SQLiteOpenHelper
|
||||
|
||||
oldVersion=152;
|
||||
}
|
||||
if(oldVersion==152) {
|
||||
//Теперь дата в виде текстового поля храниться так как при синхронизации с сервера она приходит в виде даты
|
||||
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;");
|
||||
|
||||
++++++++
|
||||
sql = "ALTER TABLE frmlocusthealth ADD safety_clothing_clean boolean;";
|
||||
db.execSQL(sql);
|
||||
|
||||
oldVersion=153;
|
||||
}
|
||||
|
||||
if(oldVersion < newVersion) //Это условие выполняется: если совсем старые версии и не знаю что поменялось...
|
||||
{
|
||||
|
||||
@ -835,194 +835,7 @@ public class LocustActivity extends FragmentActivity implements LocationListener
|
||||
LocustActivity.this.edtLonCenter.setText("");
|
||||
}
|
||||
});
|
||||
/*
|
||||
btnGetGPS1 = (View) findViewById(R.id.btnGetGPS1);
|
||||
OnClickListener oclBtnGetGPS = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat1.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon1.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//TODO Если удалось получить координаты то добавляем ещё 1 поля для их ввода
|
||||
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
btnGetGPS1.setOnClickListener(oclBtnGetGPS);
|
||||
|
||||
btnDelGPS1 = (View) findViewById(R.id.btnDelGPS1);
|
||||
btnDelGPS1.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat1.setText("");
|
||||
LocustActivity.this.edtLon1.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
btnGetGPS2 = (View) findViewById(R.id.btnGetGPS2);
|
||||
OnClickListener oclGetGPS2 = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat2.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon2.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
btnGetGPS2.setOnClickListener(oclGetGPS2);
|
||||
|
||||
btnDelGPS2 = (View) findViewById(R.id.btnDelGPS2);
|
||||
btnDelGPS2.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat2.setText("");
|
||||
LocustActivity.this.edtLon2.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
btnGetGPS3 = (View) findViewById(R.id.btnGetGPS3);
|
||||
OnClickListener oclGetGPS3 = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat3.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon3.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
btnGetGPS3.setOnClickListener(oclGetGPS3);
|
||||
|
||||
btnDelGPS3 = (View) findViewById(R.id.btnDelGPS3);
|
||||
btnDelGPS3.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat3.setText("");
|
||||
LocustActivity.this.edtLon3.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
btnGetGPS4 = (View) findViewById(R.id.btnGetGPS4);
|
||||
OnClickListener oclGetGPS4 = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat4.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon4.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
btnGetGPS4.setOnClickListener(oclGetGPS4);
|
||||
|
||||
btnDelGPS4 = (View) findViewById(R.id.btnDelGPS4);
|
||||
btnDelGPS4.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat4.setText("");
|
||||
LocustActivity.this.edtLon4.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
btnGetGPS5 = (View) findViewById(R.id.btnGetGPS5);
|
||||
OnClickListener oclGetGPS5 = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat5.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon5.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
btnGetGPS5.setOnClickListener(oclGetGPS5);
|
||||
|
||||
btnDelGPS5 = (View) findViewById(R.id.btnDelGPS5);
|
||||
btnDelGPS5.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat5.setText("");
|
||||
LocustActivity.this.edtLon5.setText("");
|
||||
}
|
||||
});
|
||||
|
||||
btnGetGPS6 = (View) findViewById(R.id.btnGetGPS6);
|
||||
OnClickListener oclGetGPS6 = new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
DecimalFormatSymbols custom = new DecimalFormatSymbols(new Locale("en", "US"));
|
||||
custom.setDecimalSeparator('.');
|
||||
DecimalFormat df = new DecimalFormat("0.0000000");
|
||||
df.setDecimalFormatSymbols(custom);
|
||||
if(LocustActivity.this._lat!=0 && LocustActivity.this._lon!=0) {
|
||||
LocustActivity.this.edtLat6.setText(df.format(LocustActivity.this._lat));
|
||||
LocustActivity.this.edtLon6.setText(df.format(LocustActivity.this._lon));
|
||||
}
|
||||
//Checking if the GPS is active and if it is inactive, I display a warning about it
|
||||
LocationManager locationManager = (LocationManager) LocustActivity.this.getSystemService(Context.LOCATION_SERVICE);;
|
||||
if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
|
||||
Toast.makeText(LocustActivity.this, LocustActivity.this.getResources().getString(R.string.Please_activate_GPS), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
btnGetGPS6.setOnClickListener(oclGetGPS6);
|
||||
|
||||
btnDelGPS6 = (View) findViewById(R.id.btnDelGPS6);
|
||||
btnDelGPS6.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
LocustActivity.this.edtLat6.setText("");
|
||||
LocustActivity.this.edtLon6.setText("");
|
||||
}
|
||||
});
|
||||
*/
|
||||
btnOnMap = (View) findViewById(R.id.btnOnMap);
|
||||
OnClickListener oclBtnOnMap = new OnClickListener() {
|
||||
@Override
|
||||
|
||||
@ -151,13 +151,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
|
||||
public View spiLocSpecies = null; // вид: CIT, DMA, LMI, др.
|
||||
public View spiLocHoppers = null; // Стадии личинок, возраста: Младшие Средние Старшие
|
||||
|
||||
//public View spiImago = null; // Имаго (да, нет)
|
||||
|
||||
public EditText edtLocDensity = null; // плотность на м2
|
||||
//public View spiKuliguli = null; // Кулиги (да, нет)
|
||||
//public View spiSwarm = null; // Стаи (да, нет)
|
||||
//public View spiSparse = null; // Разреженные (да, нет)
|
||||
public View spiMainPurpose = null; // Основная цель при обработке (Имаго,Кулиги,Стаи,Разреженные)
|
||||
|
||||
public View spiLocustPhaseId = null; // Фара саранчи
|
||||
@ -464,9 +458,7 @@ public class LocustDelActivity extends FragmentActivity implements LocationListe
|
||||
guiTable.add(edtLonCenter, "lon_center");
|
||||
|
||||
ArrayList<LatLon> latlon = new ArrayList<LatLon>();
|
||||
if(latlon.size()==0){
|
||||
latlon.add(new LatLon(0, 0));
|
||||
}
|
||||
latlonList = findViewById(R.id.latlonList);
|
||||
LatLonAdapter adapter = new LatLonAdapter(this, R.layout.list_lat_lon, latlon, this, latlonList);
|
||||
latlonList.setAdapter(adapter);
|
||||
|
||||
@ -29,6 +29,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -46,6 +47,8 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
private Timer timer = new Timer();
|
||||
public File file = null;
|
||||
|
||||
public String android_id="";
|
||||
|
||||
public void alert(String text)
|
||||
{
|
||||
AlertDialog.Builder adb = new AlertDialog.Builder(this,R.style.AlertDialogTheme);
|
||||
@ -69,6 +72,7 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
|
||||
//Загрузка сохранёного языка
|
||||
Tools.loadLocale(this);
|
||||
android_id = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
|
||||
|
||||
llList = (LinearLayout) findViewById(R.id.llList);
|
||||
@ -600,17 +604,16 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
switch (spiList.getSelectedItemPosition())
|
||||
{
|
||||
case 0:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and filled!=1", null); //Не отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and filled!=1 and device_id='"+android_id+"'", null); //Не отправленные
|
||||
break;
|
||||
case 1:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=0 and filled=1", null); //Не отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=0 and filled=1 and device_id='"+android_id+"'", null); //Не отправленные
|
||||
break;
|
||||
case 2:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=1", null); //Отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and send=1 and device_id='"+android_id+"'", null); //Отправленные
|
||||
break;
|
||||
default:
|
||||
//cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0", null); //Все
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel", null); //Все
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select uid, coalesce(district,'') || ' ' || coalesce(terrain,'') terrain, date from frmlocustdel where del=0 and device_id='"+android_id+"'", null); //Все
|
||||
break;
|
||||
}
|
||||
|
||||
@ -639,9 +642,22 @@ public class LocustDelListActivity extends AppCompatActivity
|
||||
btn.uid = cursor.getString(cursor.getColumnIndex("uid"));
|
||||
|
||||
// Преобразует с учётом временой зоны (пример long dv = 946684800L * 1000L; //2000 ный по гринвичу дало 6 утра)
|
||||
long dv = cursor.getLong(cursor.getColumnIndex("date")) * (long) 1000;// its need to be in milisecond
|
||||
String vv = "";
|
||||
String val = cursor.getString(cursor.getColumnIndex("date"));
|
||||
try {
|
||||
long dv = Long.parseLong(val) * (long) 1000;// its need to be in milisecond
|
||||
Date df = new java.util.Date(dv);
|
||||
String vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
if(vv.isEmpty()) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date df = format.parse(val);
|
||||
vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
}
|
||||
|
||||
btn.setText(cursor.getString(cursor.getColumnIndex("terrain")) + " (" + vv + ")");
|
||||
|
||||
|
||||
@ -122,10 +122,16 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
public EditText edtInsConcentration = null; // концентрация(г д.в./л или%)
|
||||
public View spiInsFormulation = null; // формуляция(УМО, КЭ, др.)
|
||||
public EditText edtInsDose = null; // норма расхода(л/га)
|
||||
public View spiInsDiluted = null; // Коммерческий припарат разбавлен?
|
||||
public EditText edtInsProportion = null; // пропорция разбавления рабочей жидкости
|
||||
public EditText edtInsRate = null; // расход рабочей жидкости(л/га)
|
||||
|
||||
public EditText edtInsUsedVolume = null; // Общий объем использованной рабочей жидкости (л)
|
||||
|
||||
public View spiEffectiveness = null; // Контроль эфективности
|
||||
public View spiTypeImpact = null; // Тип оцениваемого биологического воздействия
|
||||
|
||||
|
||||
//public EditText edtInsUsedVolume = null; // Общий объем использованной рабочей жидкости (л)
|
||||
// public DateInput edtInsExpiryDate = null; // окончание срока действия (дата)
|
||||
// public SpinnerDB spiInsMixed = null; // смешивается ли инсектицид с водой или растворителем?
|
||||
// public EditText edtInsMixedName = null; // Если да то с каким
|
||||
@ -134,8 +140,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
public View spiWeaTimeEnd = null; // время окончания
|
||||
public EditText edtWeaTemperatureStart = null; // Температура нач.(°C)
|
||||
public EditText edtWeaTemperatureEnd = null; // Температура кон.(°C)
|
||||
public EditText edtWeaWindSpeedStart = null; // скорость ветра нач. (м/с)
|
||||
public EditText edtWeaWindSpeedEnd = null; // скорость ветра кон. (м/с)
|
||||
//public EditText edtWeaWindSpeedStart = null; // скорость ветра нач. (м/с)
|
||||
//public EditText edtWeaWindSpeedEnd = null; // скорость ветра кон. (м/с)
|
||||
|
||||
public View spiWindDirectionStart = null; // направление ветра нач.
|
||||
public View spiWindDirectionEnd = null; // направление ветра кон.
|
||||
@ -144,14 +150,10 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
|
||||
public View spiLocSpecies = null; // вид: CIT, DMA, LMI, др.
|
||||
public View spiLocHoppers = null; // Стадии личинок, возраста: Младшие Средние Старшие
|
||||
|
||||
//public View spiImago = null; // Имаго (да, нет)
|
||||
|
||||
public EditText edtLocDensity = null; // плотность на м2
|
||||
//public View spiKuliguli = null; // Кулиги (да, нет)
|
||||
//public View spiSwarm = null; // Стаи (да, нет)
|
||||
//public View spiSparse = null; // Разреженные (да, нет)
|
||||
public View spiMainPurpose = null; // Основная цель при обработке (Имаго,Кулиги,Стаи,Разреженные)
|
||||
|
||||
|
||||
public View spiLocustPhaseId = null; // Фара саранчи
|
||||
public View spiSprPlatform = null; // Вид опрыскивания
|
||||
|
||||
@ -165,6 +167,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
//public EditText edtSprModel = null; // Модель опрыскивателя
|
||||
// public DateInput edtDateCalibration = null; // Дата последней калибровки
|
||||
public EditText edtSprHeight = null; // Высота над поверхностью почвы (м)
|
||||
|
||||
// public EditText edtSprWidth = null; // Ширина захвата (м)
|
||||
// public EditText edtSprSpacing = null; // Расстояние между проходами опрыскивателя (м) (Надия Рашидовна сказала удалить)
|
||||
public View spiSprBarrier = null; // Барьеры (да, нет)
|
||||
@ -179,6 +182,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
public EditText edtEffTime = null; // Прошло времени после обработки в часах
|
||||
public View spiEffMethod = null; // метод подсчета смертности
|
||||
|
||||
|
||||
public CheckBox cbSafClothingGoggles = null; // Какой защитной одеждой пользовался оператор: Очки
|
||||
public CheckBox cbSafClothingMasks = null; // Какой защитной одеждой пользовался оператор: Маска
|
||||
public CheckBox cbSafClothingGloves = null; // Какой защитной одеждой пользовался оператор: Перчатки
|
||||
@ -187,8 +191,12 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
public CheckBox cbSafClothingBoots = null; // Какой защитной одеждой пользовался оператор: Сапоги
|
||||
public CheckBox cbSafClothingAbsent = null; // Какой защитной одеждой пользовался оператор: Отсутствуют
|
||||
|
||||
|
||||
public EditText edtClothing = null; // Сборная колонка
|
||||
|
||||
public View spiHlthProtectiveClothingClean = null; // Защитная одежда чистая и в хорошем состоянии
|
||||
|
||||
|
||||
public View spiProtectiveClothingClean = null;
|
||||
public View spiOperatorExposedInsecticide = null;
|
||||
public EditText edtDescription = null;
|
||||
@ -273,9 +281,625 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
Intent intent = getIntent();
|
||||
uid = intent.getStringExtra("uid"); // Параметр для Активити
|
||||
|
||||
guiTableDel = new DBGUITable(this, "frmlocustdel");
|
||||
guiTableDel.add(uid, "uid");
|
||||
guiTableHealth = new DBGUITable(this, "frmlocusthealth");
|
||||
guiTableHealth.add(uid, "uid");
|
||||
|
||||
//Страна
|
||||
spiCountry = findViewById(R.id.spiCountry);
|
||||
guiTableDel.add(spiCountry, "country_id");
|
||||
((selectDB)spiCountry).addField("", "");
|
||||
// Выбираем страны и заполняем поля
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select id, uid, name from countries where del=0 order by name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiCountry).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// Чтоб при изменении страны обновлялся список регионов
|
||||
((selectDB)spiCountry).setOnChangeValueListener(new OnClickListener()
|
||||
{
|
||||
@Override
|
||||
public void onClick(View v)
|
||||
{
|
||||
((selectDB)spiRegion).clearFields();
|
||||
((selectDB)spiRegion).addField("", "");
|
||||
|
||||
if(((selectDB)spiCountry).getValue() != null && ((selectDB)spiCountry).getValue() != "")
|
||||
{
|
||||
DbOpenHelper dboh = new DbOpenHelper(LocustHealthActivity.this);
|
||||
Cursor cursor = dboh.getReadableDatabase().rawQuery(
|
||||
"select id, name from countriesregions where del=0 and country_id=" + ((selectDB)spiCountry).getValue() + " order by name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiRegion).addField(cursor.getString(cursor.getColumnIndex("name")),
|
||||
cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
//Область
|
||||
spiRegion = findViewById(R.id.spiRegion); // Регион
|
||||
guiTableDel.add(spiRegion, "region_id");
|
||||
//Район
|
||||
edtArea = (EditText) findViewById(R.id.edtArea); // Район
|
||||
guiTableDel.add(edtArea, "area");
|
||||
//Посёлок
|
||||
edtVillage = (EditText) findViewById(R.id.edtVillage); // Название местности либо урочища
|
||||
guiTableDel.add(edtVillage, "village");
|
||||
//Имя лидера команды по обработке
|
||||
edtObserver = (EditText) findViewById(R.id.edtObserver);
|
||||
guiTableDel.add(edtObserver, "observer");
|
||||
//Дата
|
||||
edtDate = (EditText) findViewById(R.id.edtDate); // Должна быть уникальной
|
||||
guiTableDel.add(edtDate, "date");
|
||||
//Событие для кнопки выбора даты тут не нужна поэтому её и нет
|
||||
|
||||
edtLatCenter = (EditText) findViewById(R.id.edtLatCenter); // Широта
|
||||
guiTableDel.add(edtLatCenter, "lat_center");
|
||||
edtLonCenter = (EditText) findViewById(R.id.edtLonCenter); // Долгота
|
||||
guiTableDel.add(edtLonCenter, "lon_center");
|
||||
|
||||
ArrayList<LatLon> latlon = new ArrayList<LatLon>();
|
||||
latlon.add(new LatLon(0, 0));
|
||||
latlonList = findViewById(R.id.latlonList);
|
||||
LatLonAdapter adapter = new LatLonAdapter(this, R.layout.list_lat_lon, latlon, this, latlonList);
|
||||
latlonList.setAdapter(adapter);
|
||||
// adapter.clc=new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Tools.setListViewHeightBasedOnItems(LocustHealthActivity.this.latlonList);
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
|
||||
//Тип растительности
|
||||
spiVegType = findViewById(R.id.spiVegType); // Тип(Дикая, Культурная)
|
||||
guiTableDel.add(spiVegType, "vegetation_type_id");
|
||||
((selectDB)spiVegType).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_vegetation d where d.del=0 order by d.sort, d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiVegType).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
//высота растительности
|
||||
edtVegHeight = (EditText) findViewById(R.id.edtVegHeight); // Высота (м)
|
||||
guiTableDel.add(edtVegHeight, "vegetation_height");
|
||||
|
||||
//Густота растительного покрова
|
||||
spiVegCover = findViewById(R.id.spiVegCover); // Густота растительного покрова(%)
|
||||
guiTableDel.add(spiVegCover, "vegetation_cover_id");
|
||||
((selectDB)spiVegCover).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_cover d where d.del=0 order by d.sort, d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiVegCover).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
//Наименование сельхоз культуры
|
||||
edtVegCrop = (EditText) findViewById(R.id.edtVegCrop); // Перечисление культур
|
||||
guiTableDel.add(edtVegCrop, "vegetation_crop");
|
||||
|
||||
//Наименование инсектицида
|
||||
edtInsName = (EditText) findViewById(R.id.edtInsName); // коммерческое название
|
||||
guiTableDel.add(edtInsName, "insecticide_name");
|
||||
|
||||
// Наименование активного вещества отравы
|
||||
edtInsActiveSubstance = (EditText) findViewById(R.id.edtInsActiveSubstance);
|
||||
guiTableDel.add(edtInsActiveSubstance, "insecticide_active_substance");
|
||||
|
||||
// концентрация(г д.в./л или%)
|
||||
edtInsConcentration = (EditText) findViewById(R.id.edtInsConcentration);
|
||||
guiTableDel.add(edtInsConcentration, "insecticide_concentration");
|
||||
//edtInsConcentration.setFilters(new InputFilter[] { new InputFilterMinMax("0", "100") }); потому что текст
|
||||
|
||||
// формуляция(УМО, КЭ, др.)
|
||||
spiInsFormulation = findViewById(R.id.spiInsFormulation);
|
||||
guiTableDel.add(spiInsFormulation, "insecticide_formulation_id");
|
||||
((selectDB)spiInsFormulation).addField("", "");
|
||||
// Выбираем страны и заполняем поля
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_formulation d where d.del=0 order by d.sort, d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiInsFormulation).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// норма расхода(л/га)
|
||||
edtInsDose = (EditText) findViewById(R.id.edtInsDose);
|
||||
guiTableDel.add(edtInsDose, "insecticide_dose");
|
||||
|
||||
// Коммерческий припарат разбавлен?
|
||||
spiInsDiluted = findViewById(R.id.spiInsDiluted);
|
||||
guiTableDel.add(spiInsDiluted, "insecticide_diluted_id");
|
||||
((selectDB)spiInsDiluted).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_diluted d where d.del=0 order by d.sort, d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiInsDiluted).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// расход рабочей жидкости(л/га)
|
||||
edtInsProportion = (EditText) findViewById(R.id.edtInsProportion);
|
||||
guiTableDel.add(edtInsProportion, "insecticide_proportion");
|
||||
|
||||
// расход рабочей жидкости(л/га)
|
||||
edtInsRate = (EditText) findViewById(R.id.edtInsRate);
|
||||
guiTableDel.add(edtInsRate, "insecticide_rate");
|
||||
|
||||
// время начала
|
||||
spiWeaTimeStart = findViewById(R.id.spiWeaTimeStart);
|
||||
guiTableDel.add(spiWeaTimeStart, "weather_time_start");
|
||||
((selectDB)spiWeaTimeStart).addField("", "");
|
||||
for (int i = 0; i < 24; i++) {
|
||||
((selectDB) spiWeaTimeStart).addField(String.valueOf(i), String.valueOf(i)+".0");
|
||||
}
|
||||
// время окончания
|
||||
spiWeaTimeEnd = findViewById(R.id.spiWeaTimeEnd);
|
||||
guiTableDel.add(spiWeaTimeEnd, "weather_time_end");
|
||||
((selectDB)spiWeaTimeEnd).addField("", "");
|
||||
for (int i = 0; i < 24; i++) {
|
||||
((selectDB) spiWeaTimeEnd).addField(String.valueOf(i), String.valueOf(i)+".0");
|
||||
}
|
||||
// Температура нач.(°C)
|
||||
edtWeaTemperatureStart = (EditText) findViewById(R.id.edtWeaTemperatureStart);
|
||||
guiTableDel.add(edtWeaTemperatureStart, "weather_temperature_start");
|
||||
// Температура кон.(°C)
|
||||
edtWeaTemperatureEnd = (EditText) findViewById(R.id.edtWeaTemperatureEnd);
|
||||
guiTableDel.add(edtWeaTemperatureEnd, "weather_temperature_end");
|
||||
|
||||
// направление ветра нач.
|
||||
spiWindDirectionStart = findViewById(R.id.spiWindDirectionStart);
|
||||
guiTableDel.add(spiWindDirectionStart, "weather_direction_start");
|
||||
((selectDB)spiWindDirectionStart).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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, degree from list_directions d where d.del=0 order by d.degree", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiWindDirectionStart).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// направление ветра кон.
|
||||
spiWindDirectionEnd = findViewById(R.id.spiWindDirectionEnd);
|
||||
guiTableDel.add(spiWindDirectionEnd, "weather_direction_end");
|
||||
((selectDB)spiWindDirectionEnd).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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, degree from list_directions d where d.del=0 order by d.degree", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiWindDirectionEnd).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// направление опрыскивания нач.
|
||||
spiSprayDirectionStart = findViewById(R.id.spiSprayDirectionStart);
|
||||
guiTableDel.add(spiSprayDirectionStart, "weather_spray_direction_start");
|
||||
((selectDB)spiSprayDirectionStart).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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, d.degree from list_directions d where d.del=0 and d.degree>=0 order by d.degree",
|
||||
null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprayDirectionStart).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// направление опрыскивания кон.
|
||||
spiSprayDirectionEnd = findViewById(R.id.spiSprayDirectionEnd);
|
||||
guiTableDel.add(spiSprayDirectionEnd, "weather_spray_direction_end");
|
||||
((selectDB)spiSprayDirectionEnd).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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, degree from list_directions d where d.del=0 and d.degree>=0 order by d.degree",
|
||||
null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprayDirectionEnd).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// Вид locuststypes
|
||||
spiLocSpecies = findViewById(R.id.spiLocSpecies);
|
||||
guiTableDel.add(spiLocSpecies, "locust_type_id");
|
||||
((selectDB)spiLocSpecies).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.rawQuery(
|
||||
"select lt.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = lt.name AND l.short_name='"
|
||||
+ Tools.getLang() + "' LIMIT 1),lt.name) name from LocustsTypes lt where lt.del=0 order by lt.sort,lt.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiLocSpecies).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
// Возраст личинок (Стадии личинок)
|
||||
spiLocHoppers = findViewById(R.id.spiLocHoppers);
|
||||
guiTableDel.add(spiLocHoppers, "locust_hoppers_id");
|
||||
((selectDB)spiLocHoppers).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.rawQuery(
|
||||
"select lt.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = lt.name AND l.short_name='"
|
||||
+ Tools.getLang() + "' LIMIT 1),lt.name) name from list_age lt where lt.del=0 order by lt.sort,lt.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiLocHoppers).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
// плотность на м2
|
||||
edtLocDensity = (EditText) findViewById(R.id.edtLocDensity);
|
||||
guiTableDel.add(edtLocDensity, "locust_density");
|
||||
|
||||
//Основная цель при обработке
|
||||
spiMainPurpose = findViewById(R.id.spiMainPurpose);
|
||||
guiTableDel.add(spiMainPurpose, "locust_purpose_id");
|
||||
((selectDB)spiMainPurpose).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.rawQuery(
|
||||
"select lt.id, COALESCE((SELECT translation FROM _translations t JOIN _languages l ON t.language_id=l.id WHERE t.del = 0 AND identifier = lt.name AND l.short_name='"
|
||||
+ Tools.getLang() + "' LIMIT 1),lt.name) name from list_purpose lt where lt.del=0 order by lt.sort,lt.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiMainPurpose).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
|
||||
// Вид опрыскивания
|
||||
spiSprPlatform = findViewById(R.id.spiSprPlatform);
|
||||
guiTableDel.add(spiSprPlatform, "spray_platform");
|
||||
((selectDB)spiSprPlatform).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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 sprayers_types d where d.del=0 order by d.sort,d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprPlatform).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// «Авиа» - выпадающий список:«Самолет», «Вертолет», «Дельтаплан».
|
||||
spiSprPlatformA = findViewById(R.id.spiSprPlatformA);
|
||||
guiTableDel.add(spiSprPlatformA, "spray_platform_a");
|
||||
((selectDB)spiSprPlatformA).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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 sprayers d where d.del=0 and d.sprayer_type_id=1 order by d.sort,d.name",
|
||||
null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprPlatformA).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// «Наземное» - выпадающий список:«Трактор», «Машина», «Аэроз.генераторG».
|
||||
spiSprPlatformG = findViewById(R.id.spiSprPlatformG);
|
||||
guiTableDel.add(spiSprPlatformG, "spray_platform_g");
|
||||
((selectDB)spiSprPlatformG).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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 sprayers d where d.del=0 and d.sprayer_type_id=3 order by d.sort,d.name",
|
||||
null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprPlatformG).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// «Ручное» - выпадающий список:«Ранцевый», «Моторный», «Батарейный».
|
||||
spiSprPlatformH = findViewById(R.id.spiSprPlatformH);
|
||||
guiTableDel.add(spiSprPlatformH, "spray_platform_h");
|
||||
((selectDB)spiSprPlatformH).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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 sprayers d where d.del=0 and d.sprayer_type_id=5 order by d.sort,d.name",
|
||||
null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprPlatformH).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// Марка опрыскивателя
|
||||
edtSprManufacturer = (EditText) findViewById(R.id.edtSprManufacturer);
|
||||
guiTableDel.add(edtSprManufacturer, "spray_manufacturer_name");
|
||||
|
||||
// Высота над поверхностью почвы (м)
|
||||
edtSprHeight = (EditText) findViewById(R.id.edtSprHeight);
|
||||
guiTableDel.add(edtSprHeight, "spray_height");
|
||||
|
||||
|
||||
|
||||
|
||||
// Тип обработки
|
||||
spiSprBarrier = findViewById(R.id.spiSprBarrier);
|
||||
guiTableDel.add(spiSprBarrier, "spray_barrier");
|
||||
((selectDB)spiSprBarrier).addField("", "");
|
||||
((selectDB)spiSprBarrier).addField(getString(R.string.Barriers), "1");
|
||||
((selectDB)spiSprBarrier).addField(getString(R.string.Continuous), "0");
|
||||
|
||||
// Интервал между проходами
|
||||
edtSprBarrierSpace = (EditText) findViewById(R.id.edtSprBarrierSpace);
|
||||
guiTableDel.add(edtSprBarrierSpace, "spray_barrier_space");
|
||||
|
||||
// Скорость движения (км/ч)
|
||||
edtSprSpeed = (EditText) findViewById(R.id.edtSprSpeed);
|
||||
guiTableDel.add(edtSprSpeed, "spray_speed");
|
||||
|
||||
// Наземная маркировка(Сиг-нальщики, GPS, Машина, Нет)
|
||||
spiSprMarking = findViewById(R.id.spiSprMarking);
|
||||
guiTableDel.add(spiSprMarking, "spray_marking_id");
|
||||
((selectDB)spiSprMarking).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_markings d where d.del=0 order by d.sort,d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiSprMarking).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// обработанная площадь(га)
|
||||
edtTreatedArea = (EditText) findViewById(R.id.edtTreatedArea);
|
||||
guiTableDel.add(edtTreatedArea, "treated_area");
|
||||
|
||||
// Общий объем использованной рабочей жидкости (л)
|
||||
edtInsUsedVolume = (EditText) findViewById(R.id.edtInsUsedVolume);
|
||||
guiTableDel.add(edtInsUsedVolume, "insecticide_used_volume");
|
||||
|
||||
// Контроль эфективности
|
||||
spiEffectiveness = findViewById(R.id.spiEffectiveness);
|
||||
guiTableDel.add(spiEffectiveness, "efficiency");
|
||||
((selectDB)spiEffectiveness).addField("", "");
|
||||
((selectDB)spiEffectiveness).addField(getString(R.string.Yes), "1");
|
||||
((selectDB)spiEffectiveness).addField(getString(R.string.No), "0");
|
||||
|
||||
//Тип оцениваемого биологического воздействия
|
||||
spiTypeImpact = findViewById(R.id.spiTypeImpact);
|
||||
guiTableDel.add(spiTypeImpact, "efficacy_impact_id");
|
||||
((selectDB)spiTypeImpact).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiTypeImpact).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// Наблюдаемая эфективность обработок (%)
|
||||
edtEffMortality = (EditText) findViewById(R.id.edtEffMortality);
|
||||
guiTableDel.add(edtEffMortality, "efficacy_mortality");
|
||||
|
||||
// Прошло времени после обработки
|
||||
edtEffTime = (EditText) findViewById(R.id.edtEffTime);
|
||||
guiTableDel.add(edtEffTime, "efficacy_passed_time");
|
||||
|
||||
// Метод оценки эфективности обработок
|
||||
spiEffMethod = findViewById(R.id.spiEffMethod);
|
||||
guiTableDel.add(spiEffMethod, "efficacy_mortality_method");
|
||||
((selectDB)spiEffMethod).addField("", "");
|
||||
dboh = new DbOpenHelper(this);
|
||||
cursor = dboh
|
||||
.getReadableDatabase()
|
||||
.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_mortality d where d.del=0 order by d.sort,d.name", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
((selectDB)spiEffMethod).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
|
||||
// Индивидуальные средства защиты
|
||||
cbSafClothingGoggles = (CheckBox) findViewById(R.id.cbSafClothingGoggles);
|
||||
//cbSafClothingGoggles.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingMasks = (CheckBox) findViewById(R.id.cbSafClothingMasks);
|
||||
//cbSafClothingMasks.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingGloves = (CheckBox) findViewById(R.id.cbSafClothingGloves);
|
||||
//cbSafClothingGloves.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingOveralls = (CheckBox) findViewById(R.id.cbSafClothingOveralls);
|
||||
//cbSafClothingOveralls.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingCaps = (CheckBox) findViewById(R.id.cbSafClothingCaps);
|
||||
//cbSafClothingCaps.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingBoots = (CheckBox) findViewById(R.id.cbSafClothingBoots);
|
||||
//cbSafClothingBoots.setOnCheckedChangeListener(cclsl);
|
||||
cbSafClothingAbsent = (CheckBox) findViewById(R.id.cbSafClothingAbsent);
|
||||
//cbSafClothingAbsent.setOnCheckedChangeListener(cclsl);
|
||||
|
||||
edtClothing = (EditText) findViewById(R.id.edtClothing);
|
||||
guiTableDel.add(edtClothing, "safety_clothing");
|
||||
|
||||
edtClothing.addTextChangedListener(new TextWatcher()
|
||||
{
|
||||
public void afterTextChanged(Editable s)
|
||||
{
|
||||
}
|
||||
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after)
|
||||
{
|
||||
}
|
||||
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count)
|
||||
{
|
||||
String str = LocustHealthActivity.this.edtClothing.getText().toString();
|
||||
|
||||
if (str.indexOf("1") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingGoggles.setChecked(true);
|
||||
if (str.indexOf("2") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingMasks.setChecked(true);
|
||||
if (str.indexOf("3") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingGloves.setChecked(true);
|
||||
if (str.indexOf("4") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingOveralls.setChecked(true);
|
||||
if (str.indexOf("5") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingCaps.setChecked(true);
|
||||
if (str.indexOf("6") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingBoots.setChecked(true);
|
||||
if (str.indexOf("7") != -1)
|
||||
LocustHealthActivity.this.cbSafClothingAbsent.setChecked(true);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Защитная одежда читая и в хорошем состоянии
|
||||
spiHlthProtectiveClothingClean = findViewById(R.id.spiHlthProtectiveClothingClean);
|
||||
guiTableHealth.add(spiEffectiveness, "safety_clothing_clean");
|
||||
((selectDB)spiEffectiveness).addField("", "");
|
||||
((selectDB)spiEffectiveness).addField(getString(R.string.Yes), "1");
|
||||
((selectDB)spiEffectiveness).addField(getString(R.string.No), "0");
|
||||
|
||||
|
||||
|
||||
|
||||
Integer user_id = null;
|
||||
/*DbOpenHelper dboh = new DbOpenHelper(this);
|
||||
SQLiteDatabase db = dboh.getReadableDatabase();
|
||||
@ -476,24 +1100,7 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
// edtTimeZone = (EditText) findViewById(R.id.edtTimeZone);
|
||||
// guiTable.add(edtTimeZone,"timezone");
|
||||
//
|
||||
// edtLatCenter = (EditText) findViewById(R.id.edtLatCenter); // Широта
|
||||
// guiTable.add(edtLatCenter, "lat_center");
|
||||
// edtLonCenter = (EditText) findViewById(R.id.edtLonCenter); // Долгота
|
||||
// guiTable.add(edtLonCenter, "lon_center");
|
||||
//
|
||||
// ArrayList<LatLon> latlon = new ArrayList<LatLon>();
|
||||
// if(latlon.size()==0){
|
||||
// latlon.add(new LatLon(0, 0));
|
||||
// }
|
||||
// latlonList = findViewById(R.id.latlonList);
|
||||
// LatLonAdapter adapter = new LatLonAdapter(this, R.layout.list_lat_lon, latlon, this, latlonList);
|
||||
// latlonList.setAdapter(adapter);
|
||||
// adapter.clc=new OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// Tools.setListViewHeightBasedOnItems(LocustHealthActivity.this.latlonList);
|
||||
// }
|
||||
// };
|
||||
|
||||
|
||||
// edtInfestedArea = (EditText) findViewById(R.id.edtInfestedArea); // заселенная площадь(га)
|
||||
// guiTable.add(edtInfestedArea, "infested_area");
|
||||
@ -504,50 +1111,10 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
// spiVegType = findViewById(R.id.spiVegType); // Тип(Дикая, Культурная)
|
||||
// guiTable.add(spiVegType, "vegetation_type_id");
|
||||
// ((selectDB)spiVegType).addField("", "");
|
||||
// dboh = new DbOpenHelper(this);
|
||||
// cursor = dboh
|
||||
// .getReadableDatabase()
|
||||
// .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_vegetation d where d.del=0 order by d.sort, d.name", null);
|
||||
// if (cursor.moveToFirst())
|
||||
// {
|
||||
// do
|
||||
// {
|
||||
// ((selectDB)spiVegType).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
// } while (cursor.moveToNext());
|
||||
// }
|
||||
// cursor.close();
|
||||
// dboh.close();
|
||||
//
|
||||
// edtVegHeight = (EditText) findViewById(R.id.edtVegHeight); // Высота (м)
|
||||
// guiTable.add(edtVegHeight, "vegetation_height");
|
||||
//
|
||||
// spiVegCover = findViewById(R.id.spiVegCover); // Густота растительного покрова(%)
|
||||
// guiTable.add(spiVegCover, "vegetation_cover_id");
|
||||
// ((selectDB)spiVegCover).addField("", "");
|
||||
// dboh = new DbOpenHelper(this);
|
||||
// cursor = dboh
|
||||
// .getReadableDatabase()
|
||||
// .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_cover d where d.del=0 order by d.sort, d.name", null);
|
||||
// if (cursor.moveToFirst())
|
||||
// {
|
||||
// do
|
||||
// {
|
||||
// ((selectDB)spiVegCover).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
// } while (cursor.moveToNext());
|
||||
// }
|
||||
// cursor.close();
|
||||
// dboh.close();
|
||||
//
|
||||
// edtVegCrop = (EditText) findViewById(R.id.edtVegCrop); // Перечисление культур
|
||||
// guiTable.add(edtVegCrop, "vegetation_crop");
|
||||
|
||||
//
|
||||
// spiVegDamage = findViewById(R.id.spiVegDamage); // Повреждения растительного покрова(%)
|
||||
// guiTable.add(spiVegDamage, "vegetation_damage");
|
||||
@ -572,36 +1139,8 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
// edtVegDamageArea = (EditText) findViewById(R.id.edtVegDamageArea); // Площядь повреждения
|
||||
// guiTable.add(edtVegDamageArea, "vegetation_damage_area");
|
||||
//
|
||||
// edtInsName = (EditText) findViewById(R.id.edtInsName); // коммерческое название
|
||||
// guiTable.add(edtInsName, "insecticide_name");
|
||||
// edtInsActiveSubstance = (EditText) findViewById(R.id.edtInsActiveSubstance); // Наименование активного вещества отравы
|
||||
// guiTable.add(edtInsActiveSubstance, "insecticide_active_substance");
|
||||
// edtInsConcentration = (EditText) findViewById(R.id.edtInsConcentration); // концентрация(г д.в./л или%)
|
||||
// guiTable.add(edtInsConcentration, "insecticide_concentration");
|
||||
// //edtInsConcentration.setFilters(new InputFilter[] { new InputFilterMinMax("0", "100") }); потому что текст
|
||||
//
|
||||
// spiInsFormulation = findViewById(R.id.spiInsFormulation); // формуляция(УМО, КЭ, др.)
|
||||
// guiTable.add(spiInsFormulation, "insecticide_formulation_id");
|
||||
// ((selectDB)spiInsFormulation).addField("", "");
|
||||
// // Выбираем страны и заполняем поля
|
||||
// dboh = new DbOpenHelper(this);
|
||||
// cursor = dboh
|
||||
// .getReadableDatabase()
|
||||
// .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_formulation d where d.del=0 order by d.sort, d.name", null);
|
||||
// if (cursor.moveToFirst())
|
||||
// {
|
||||
// do
|
||||
// {
|
||||
// ((selectDB)spiInsFormulation).addField(cursor.getString(cursor.getColumnIndex("name")), cursor.getString(cursor.getColumnIndex("id")));
|
||||
// } while (cursor.moveToNext());
|
||||
// }
|
||||
// cursor.close();
|
||||
// dboh.close();
|
||||
//
|
||||
// edtInsDose = (EditText) findViewById(R.id.edtInsDose); // норма расхода(л/га)
|
||||
// guiTable.add(edtInsDose, "insecticide_dose");
|
||||
|
||||
|
||||
// edtInsRate = (EditText) findViewById(R.id.edtInsRate); // расход рабочей жидкости(л/га)
|
||||
// guiTable.add(edtInsRate, "insecticide_rate");
|
||||
// edtInsUsedVolume = (EditText) findViewById(R.id.edtInsUsedVolume); // Общий объем использованной рабочей жидкости (л)
|
||||
@ -1582,9 +2121,9 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
//
|
||||
//
|
||||
// // Взависимости от параметров создание или редактирование
|
||||
// editData(uid);
|
||||
// adapter.notifyDataSetChanged();
|
||||
// Tools.setListViewHeightBasedOnItems(latlonList);
|
||||
editDataDel(uid);
|
||||
adapter.notifyDataSetChanged();
|
||||
Tools.setListViewHeightBasedOnItems(latlonList);
|
||||
//
|
||||
// //updateAlpha(); movied to onResume
|
||||
//
|
||||
@ -1889,33 +2428,33 @@ public class LocustHealthActivity extends FragmentActivity implements LocationLi
|
||||
/**
|
||||
* Редактирование данных по id если null то создание иначе редактирование
|
||||
*/
|
||||
public void editData(String uid)
|
||||
public void editDataDel(String uid)
|
||||
{
|
||||
// if (uid == null || uid == "")
|
||||
// {
|
||||
// ((fieldDB)edtDate).setValue(String.valueOf((new Date()).getTime()/1000));
|
||||
// edtTimeZone.setText(Tools.getTimezone());
|
||||
// }
|
||||
// guiTable.read(uid);
|
||||
// //Читаю список координат из базы данных
|
||||
// if (uid != null)
|
||||
// {
|
||||
// LatLonAdapter adapter = (LatLonAdapter)latlonList.getAdapter();
|
||||
// ArrayList<LatLon> list = adapter.latlonList;
|
||||
// list.clear();
|
||||
// DbOpenHelper dboh = new DbOpenHelper(this);
|
||||
// Cursor cursor = dboh.getReadableDatabase().rawQuery("select lat,lon from frmlocustdel_locations where frmlocustdel_uid='" + uid + "' order by pos", null);
|
||||
// if (cursor.moveToFirst())
|
||||
// {
|
||||
// do
|
||||
// {
|
||||
// list.add(new LatLon(cursor.getDouble(0), cursor.getDouble(1)));
|
||||
// } while (cursor.moveToNext());
|
||||
// }
|
||||
// cursor.close();
|
||||
// dboh.close();
|
||||
// list.add(new LatLon(0, 0));
|
||||
// }
|
||||
guiTableDel.read(uid);
|
||||
//Читаю список координат из базы данных
|
||||
if (uid != null)
|
||||
{
|
||||
LatLonAdapter adapter = (LatLonAdapter)latlonList.getAdapter();
|
||||
ArrayList<LatLon> list = adapter.latlonList;
|
||||
list.clear();
|
||||
DbOpenHelper dboh = new DbOpenHelper(this);
|
||||
Cursor cursor = dboh.getReadableDatabase().rawQuery("select lat,lon from frmlocustdel_locations where frmlocustdel_uid='" + uid + "' order by pos", null);
|
||||
if (cursor.moveToFirst())
|
||||
{
|
||||
do
|
||||
{
|
||||
list.add(new LatLon(cursor.getDouble(0), cursor.getDouble(1)));
|
||||
} while (cursor.moveToNext());
|
||||
}
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
list.add(new LatLon(0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@ -2,15 +2,18 @@ package kz.istt.locust;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
@ -28,6 +31,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -39,7 +43,7 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
|
||||
public LinearLayout llList;
|
||||
public MyButton btn;
|
||||
public FloatingActionButton btnAdd = null;
|
||||
//public FloatingActionButton btnAdd = null;
|
||||
public Spinner spiList = null;
|
||||
|
||||
private Timer timer = new Timer();
|
||||
@ -102,13 +106,13 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
}
|
||||
});
|
||||
|
||||
btnAdd = (FloatingActionButton) findViewById(R.id.btnAdd);
|
||||
/*btnAdd = (FloatingActionButton) findViewById(R.id.btnAdd);
|
||||
btnAdd.setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(LocustHealthListActivity.this, LocustHealthActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
//Чтоб список обновлялся раз в минуту в соответствии с текущем фильтром (для наглядности отправки данных)
|
||||
timer.scheduleAtFixedRate(new TimerTask()
|
||||
@ -599,16 +603,59 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
switch (spiList.getSelectedItemPosition())
|
||||
{
|
||||
case 0:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select lh.uid, coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain, lh.date from frmlocusthealth lh left join frmlocustdel ld on lh.frmlocustdel_uid=ld.uid where lh.del=0 and lh.filled!=1", null); //Не отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("""
|
||||
select
|
||||
ld.uid,
|
||||
coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain,
|
||||
ld.date,
|
||||
EXISTS(select true from frmlocusthealth where frmlocustdel_uid=ld.uid) as health
|
||||
from
|
||||
frmlocustdel ld
|
||||
where
|
||||
ld.del=0
|
||||
and ld.filled!=1
|
||||
""", null); //Не отправленные
|
||||
break;
|
||||
case 1:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select lh.uid, coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain, lh.date from frmlocusthealth lh left join frmlocustdel ld on lh.frmlocustdel_uid=ld.uid where lh.del=0 and lh.send=0 and lh.filled=1", null); //Не отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("""
|
||||
select
|
||||
ld.uid,
|
||||
coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain,
|
||||
ld.date,
|
||||
EXISTS(select true from frmlocusthealth where frmlocustdel_uid=ld.uid) as health
|
||||
from
|
||||
frmlocustdel ld
|
||||
where
|
||||
ld.del=0
|
||||
and ld.send=0
|
||||
and ld.filled=1
|
||||
""", null); //Не отправленные
|
||||
break;
|
||||
case 2:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select lh.uid, coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain, lh.date from frmlocusthealth lh left join frmlocustdel ld on lh.frmlocustdel_uid=ld.uid where lh.del=0 and lh.send=1", null); //Отправленные
|
||||
cursor = dboh.getReadableDatabase().rawQuery("""
|
||||
select
|
||||
ld.uid,
|
||||
coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain,
|
||||
ld.date,
|
||||
EXISTS(select true from frmlocusthealth where frmlocustdel_uid=ld.uid) as health
|
||||
from
|
||||
frmlocustdel ld
|
||||
where
|
||||
ld.del=0
|
||||
and ld.send=1
|
||||
""", null); //Отправленные
|
||||
break;
|
||||
default:
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select lh.uid, coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain, lh.date from frmlocusthealth lh left join frmlocustdel ld on lh.frmlocustdel_uid=ld.uid where lh.del=0", null); //Все
|
||||
cursor = dboh.getReadableDatabase().rawQuery("""
|
||||
select
|
||||
ld.uid,
|
||||
coalesce(ld.district,'') || ' ' || coalesce(ld.terrain,'') terrain,
|
||||
ld.date,
|
||||
EXISTS(select true from frmlocusthealth where frmlocustdel_uid=ld.uid) as health
|
||||
from
|
||||
frmlocustdel ld
|
||||
where ld.del=0
|
||||
""", null); //Все
|
||||
break;
|
||||
}
|
||||
|
||||
@ -630,19 +677,43 @@ public class LocustHealthListActivity extends AppCompatActivity
|
||||
{
|
||||
do
|
||||
{
|
||||
btn = null;
|
||||
if(cursor.getInt(cursor.getColumnIndex("health"))==0){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //Задаю стиль для кнопки для которой нет анкеты здоровья
|
||||
int buttonPinkStyle = R.style.ButtonPinkTheme;
|
||||
ContextThemeWrapper newContext = new ContextThemeWrapper(this, R.style.ButtonPinkTheme);
|
||||
btn = new MyButton(newContext, null, 0, buttonPinkStyle);
|
||||
}
|
||||
}
|
||||
if(btn==null) {
|
||||
btn = new MyButton(this);
|
||||
}
|
||||
|
||||
btn.setOnClickListener(oclBtn);
|
||||
|
||||
btn.uid = cursor.getString(cursor.getColumnIndex("uid"));
|
||||
|
||||
// Преобразует с учётом временой зоны (пример long dv = 946684800L * 1000L; //2000 ный по гринвичу дало 6 утра)
|
||||
long dv = cursor.getLong(cursor.getColumnIndex("date")) * (long) 1000;// its need to be in milisecond
|
||||
String vv = "";
|
||||
String val = cursor.getString(cursor.getColumnIndex("date"));
|
||||
try {
|
||||
long dv = Long.parseLong(val) * (long) 1000;// its need to be in milisecond
|
||||
Date df = new Date(dv);
|
||||
String vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
if(vv.isEmpty()) {
|
||||
try {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date df = format.parse(val);
|
||||
vv = new SimpleDateFormat("dd.MM.yyyy").format(df);
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
}
|
||||
|
||||
btn.setText(cursor.getString(cursor.getColumnIndex("terrain")) + " (" + vv + ")");
|
||||
|
||||
|
||||
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
|
||||
params.bottomMargin = 2;
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package kz.istt.locust;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
public class MyButton extends Button
|
||||
{
|
||||
public String uid; //Идентификатор записи может быть NULL если она создана на КПК
|
||||
@ -11,4 +15,10 @@ public class MyButton extends Button
|
||||
{
|
||||
super(context);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
MyButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
||||
{
|
||||
super(context,attrs,defStyleAttr,defStyleRes);
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,6 +77,7 @@ public class MySynchronizationOld
|
||||
public static int SyncDays=30;
|
||||
|
||||
private Context _context; //От какого контекста показывать алерты
|
||||
private String android_id;
|
||||
//private boolean _showAlert; //Показывать ли окно подождите пожалуйста (его нельзя создавать если в сервисе)
|
||||
//public ProgressDialog dialog;
|
||||
|
||||
@ -317,7 +318,7 @@ public class MySynchronizationOld
|
||||
cursor.close();
|
||||
dboh.close();
|
||||
if(days!=null && !days.isEmpty() && country_id!=null && !country_id.isEmpty()){
|
||||
return myThread.addRequest(MySynchronizationOld.URL+"/get/?fn=1&r=0&n="+tableName+"&s=" + seq + "&l=1000&days="+days+"&country_id="+country_id,"", null);
|
||||
return myThread.addRequest(MySynchronizationOld.URL+"/get/?fn=1&r=0&n="+tableName+"&s=" + seq + "&l=1000&days="+days+"&country_id="+country_id+"&android_id="+android_id,"", null);
|
||||
}else{
|
||||
return myThread.addRequest(MySynchronizationOld.URL+"/get/?fn=1&r=0&n="+tableName+"&s=" + seq + "&l=1000","", null);
|
||||
}
|
||||
@ -335,7 +336,7 @@ public class MySynchronizationOld
|
||||
|
||||
String xml="";
|
||||
|
||||
String android_id = Settings.Secure.getString(_context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
android_id = Settings.Secure.getString(_context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
|
||||
//Последовательно отправляю изменёные пользователям записи (send=0 и они заполнены)
|
||||
DbOpenHelper dboh = new DbOpenHelper(_context);
|
||||
@ -402,7 +403,7 @@ public class MySynchronizationOld
|
||||
|
||||
//Загружаю формы саранчовых обработок за последние X дней для страны Y
|
||||
dboh = new DbOpenHelper(_context);
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select t.country_id from terminals t where t.del=0 and t.serial='"+ Settings.Secure.getString(_context.getContentResolver(), Settings.Secure.ANDROID_ID)+"';", null);
|
||||
cursor = dboh.getReadableDatabase().rawQuery("select t.country_id from terminals t where t.del=0 and t.serial='"+ android_id +"';", null);
|
||||
if(cursor.moveToFirst())
|
||||
{
|
||||
String country_id = cursor.getString(0);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<!-- Задаем элемент списка и описываем состояние при помощи атрибутов. -->
|
||||
<!-- android:drawable - позволяет указать на XML-файл, который определяет фигуру -->
|
||||
<!-- android:state_focused="true" - указывает использовать данное состояние, когда объект в фокусе -->
|
||||
<item android:drawable="@drawable/button_focused" android:state_focused="true"/>
|
||||
<item android:drawable="@drawable/button_presed" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/button_normal"/>
|
||||
<item android:drawable="@drawable/button_blue_focused" android:state_focused="true"/>
|
||||
<item android:drawable="@drawable/button_blue_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/button_blue_normal"/>
|
||||
</selector>
|
||||
23
app/src/main/res/drawable/button_blue_normal.xml
Normal file
23
app/src/main/res/drawable/button_blue_normal.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<corners android:radius="12px" />
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/button_normal_color_end"
|
||||
android:startColor="@color/button_normal_color_start"
|
||||
android:type="linear" />
|
||||
|
||||
<padding
|
||||
android:bottom="9px"
|
||||
android:left="6px"
|
||||
android:right="6px"
|
||||
android:top="9px" />
|
||||
|
||||
</shape>
|
||||
@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<corners android:radius="12px" />
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/button_normal_color_end"
|
||||
android:startColor="@color/button_normal_color_start"
|
||||
android:type="linear" />
|
||||
|
||||
<padding
|
||||
android:bottom="9px"
|
||||
android:left="6px"
|
||||
android:right="6px"
|
||||
android:top="9px" />
|
||||
|
||||
<!--
|
||||
<solid android:color="#F000" />
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<padding
|
||||
android:bottom="7dp"
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="7dp" />
|
||||
|
||||
<corners
|
||||
android:bottomLeftRadius="5dp"
|
||||
android:bottomRightRadius="5dp"
|
||||
android:topLeftRadius="5dp"
|
||||
android:topRightRadius="5dp" />
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#5b5bcd"
|
||||
android:endColor="#6f6fcf"
|
||||
android:startColor="#4747e0"
|
||||
android:type="linear" />
|
||||
-->
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/button_pink.xml
Normal file
10
app/src/main/res/drawable/button_pink.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Определение списка состояний -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Задаем элемент списка и описываем состояние при помощи атрибутов. -->
|
||||
<!-- android:drawable - позволяет указать на XML-файл, который определяет фигуру -->
|
||||
<!-- android:state_focused="true" - указывает использовать данное состояние, когда объект в фокусе -->
|
||||
<item android:drawable="@drawable/button_pink_focused" android:state_focused="true"/>
|
||||
<item android:drawable="@drawable/button_pink_pressed" android:state_pressed="true"/>
|
||||
<item android:drawable="@drawable/button_pink_normal"/>
|
||||
</selector>
|
||||
27
app/src/main/res/drawable/button_pink_focused.xml
Normal file
27
app/src/main/res/drawable/button_pink_focused.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Корневым элементом должен быть объект share (холс) -->
|
||||
<!-- android:shape - задает форму кнопки. В нашем случаем форма кнопки - прямоугольник -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<!-- Устанавливаем значение радиуса скругления для всех углов прямоугольника -->
|
||||
<corners android:radius="12px" />
|
||||
<!-- Задаем линейный градиент для заливки прямоугольника -->
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="@color/button_focused_color_end"
|
||||
android:startColor="@color/button_focused_color_start"
|
||||
android:type="linear" />
|
||||
<!-- Задаем отступы текста кнопки относительно краев прямоугольника -->
|
||||
<padding
|
||||
android:bottom="9px"
|
||||
android:left="6px"
|
||||
android:right="6px"
|
||||
android:top="9px" />
|
||||
|
||||
|
||||
</shape>
|
||||
24
app/src/main/res/drawable/button_pink_normal.xml
Normal file
24
app/src/main/res/drawable/button_pink_normal.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<corners android:radius="12px" />
|
||||
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:endColor="#E96161"
|
||||
android:startColor="#DF1F1F"
|
||||
android:type="linear" />
|
||||
|
||||
|
||||
<padding
|
||||
android:bottom="9px"
|
||||
android:left="6px"
|
||||
android:right="6px"
|
||||
android:top="9px" />
|
||||
|
||||
</shape>
|
||||
27
app/src/main/res/drawable/button_pink_pressed.xml
Normal file
27
app/src/main/res/drawable/button_pink_pressed.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="#BB000000" />
|
||||
|
||||
<corners android:radius="12px" />
|
||||
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="@color/button_pressed_color_end"
|
||||
android:startColor="@color/button_pressed_color_start"
|
||||
android:type="linear" />
|
||||
|
||||
<padding
|
||||
android:bottom="9px"
|
||||
android:left="6px"
|
||||
android:right="6px"
|
||||
android:top="9px" />
|
||||
<!-- Толщина рамки прямоугольника -->
|
||||
<stroke
|
||||
android:width="2px"
|
||||
android:color="#52B10C" />
|
||||
|
||||
</shape>
|
||||
@ -6,7 +6,6 @@
|
||||
android:background="@drawable/gradient_example"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
tools:context=".LocustHealthActivity">
|
||||
|
||||
<ScrollView
|
||||
@ -19,13 +18,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@drawable/spacer_medium"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle">
|
||||
android:showDividers="middle"
|
||||
android:paddingRight="@dimen/activity_vertical_margin">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="0dp">
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
@ -50,7 +49,9 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/Country">
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/Country"
|
||||
android:background="@color/disable">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiCountry"
|
||||
android:layout_width="match_parent"
|
||||
@ -75,6 +76,8 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Region">
|
||||
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
@ -99,7 +102,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtArea"
|
||||
@ -128,7 +131,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -160,7 +163,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtObserver"
|
||||
@ -192,7 +195,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<dbfields.DateTimeTM
|
||||
@ -330,7 +333,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -349,7 +352,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -409,12 +412,12 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="0dp">
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btnOnMap"
|
||||
style="@style/Widget.MaterialComponents.Button.Icon"
|
||||
@ -433,8 +436,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="0dp">
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
@ -648,6 +650,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Vegetation_type">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiVegType"
|
||||
@ -695,7 +698,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtVegHeight"
|
||||
@ -753,6 +756,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Del_Vegetation_cover">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiVegCover"
|
||||
@ -774,7 +778,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtVegCrop"
|
||||
@ -819,7 +823,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsName"
|
||||
@ -923,7 +927,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsActiveSubstance"
|
||||
@ -952,7 +956,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -983,6 +987,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Formulation">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiInsFormulation"
|
||||
@ -1004,7 +1009,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsDose"
|
||||
@ -1031,6 +1036,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Commercial_product_diluted">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiInsDiluted"
|
||||
@ -1052,7 +1058,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsProportion"
|
||||
@ -1080,7 +1086,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsRate"
|
||||
@ -1147,6 +1153,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Time_start">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiWeaTimeStart"
|
||||
@ -1170,6 +1177,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Time_end">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiWeaTimeEnd"
|
||||
@ -1192,7 +1200,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtWeaTemperatureStart"
|
||||
@ -1220,7 +1228,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtWeaTemperatureEnd"
|
||||
@ -1247,6 +1255,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Wind_direction_start">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiWindDirectionStart"
|
||||
@ -1267,6 +1276,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Wind_direction_end">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiWindDirectionEnd"
|
||||
@ -1287,6 +1297,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Spray_direction_start">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprayDirectionStart"
|
||||
@ -1307,6 +1318,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Spray_direction_end">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprayDirectionEnd"
|
||||
@ -1346,6 +1358,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Species">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiLocSpecies"
|
||||
@ -1369,6 +1382,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Hopper_stages">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiLocHoppers"
|
||||
@ -1413,7 +1427,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -1444,6 +1458,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Main_purpose_of_treatment">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiMainPurpose"
|
||||
@ -1483,6 +1498,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Spray_platform">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprPlatform"
|
||||
@ -1503,6 +1519,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Spray_platform_a">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprPlatformA"
|
||||
@ -1523,6 +1540,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Ground">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprPlatformG"
|
||||
@ -1543,6 +1561,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Spray_platform_h">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprPlatformH"
|
||||
@ -1562,7 +1581,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtSprManufacturer"
|
||||
@ -1590,7 +1609,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtSprHeight"
|
||||
@ -1709,6 +1728,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Type_of_treatment">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprBarrier"
|
||||
@ -1732,7 +1752,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtSprBarrierSpace"
|
||||
@ -1762,7 +1782,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -1790,6 +1810,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Ground_marking">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSprMarking"
|
||||
@ -1813,7 +1834,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
@ -1871,7 +1892,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtInsUsedVolume"
|
||||
@ -2231,6 +2252,7 @@
|
||||
android:layout_weight="1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Control_efficacy_conducted_control_team">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiEffectiveness"
|
||||
@ -2270,6 +2292,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Type_of_assessed_biological_impact">
|
||||
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
@ -2294,10 +2317,11 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtEffMortality"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
@ -2324,7 +2348,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtEffTime"
|
||||
@ -2350,6 +2374,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Method_of_biological_efficiency_estimation">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiEffMethod"
|
||||
@ -2534,12 +2559,17 @@
|
||||
android:textStyle="bold"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:gravity="center">
|
||||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:columnCount="3"
|
||||
android:rowCount="3"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
android:background="@color/disable">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbSafClothingGoggles"
|
||||
@ -2627,7 +2657,9 @@
|
||||
android:hint=""
|
||||
android:visibility="invisible" />
|
||||
</GridLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Поле упразднили в форме борьбы с саранчой, теперь оно в форме здоровья -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -2645,9 +2677,7 @@
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiHlthProtectiveClothingClean"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:focusable="false"/>
|
||||
android:layout_height="wrap_content"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@ -2773,6 +2803,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Operator_accidentally_exposed_to_insecticide_or_feeling_unwell">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiOperatorExposedInsecticide"
|
||||
@ -2792,7 +2823,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtDescription"
|
||||
@ -2867,19 +2898,23 @@
|
||||
android:textStyle="bold"/>
|
||||
<EditText
|
||||
android:id="@+id/edtSafEmptyContainers"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:hint=""
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
|
||||
<GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:columnCount="2"
|
||||
android:rowCount="3"
|
||||
android:background="@color/disable"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
|
||||
<CheckBox
|
||||
@ -2936,6 +2971,7 @@
|
||||
android:enabled="false"
|
||||
android:focusable="false"/>
|
||||
</GridLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -2994,6 +3030,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Effect_on_non_terget_organism">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSafNonTarget"
|
||||
@ -3013,7 +3050,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtSafNonTargetEffect"
|
||||
@ -3134,6 +3171,7 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/disable"
|
||||
android:hint="@string/Other_environmental_or_health_incident_reported_that_might_have_been_caused_by_the_treatment">
|
||||
<dbfields.AutoCompleteTextViewDB
|
||||
android:id="@+id/spiSafIncident"
|
||||
@ -3153,7 +3191,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/transparent"
|
||||
android:background="@color/disable"
|
||||
app:boxBackgroundColor="@color/transparent">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edtSafIncidentEffect"
|
||||
@ -3225,7 +3263,11 @@
|
||||
android:text="@string/Comments_problems"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin">
|
||||
<EditText
|
||||
android:id="@+id/edtComments"
|
||||
android:layout_width="match_parent"
|
||||
@ -3234,8 +3276,8 @@
|
||||
android:inputType="textMultiLine"
|
||||
android:enabled="false"
|
||||
android:focusable="false"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"/>
|
||||
|
||||
android:background="@color/disable"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
<!--com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/btnAdd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -54,6 +54,6 @@
|
||||
app:backgroundTint="@color/button_normal_color_start"
|
||||
app:srcCompat="@android:drawable/ic_input_add"
|
||||
app:tint="@android:color/white"
|
||||
/>
|
||||
/-->
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
@ -106,7 +106,6 @@
|
||||
android:text="@string/title_activity_locust_del"/>
|
||||
|
||||
<Button
|
||||
android:visibility="gone"
|
||||
android:id="@+id/btnLocustHealth"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -6,11 +6,11 @@
|
||||
android:showAsAction="never"
|
||||
android:title="@string/action_add"/>
|
||||
|
||||
<item
|
||||
<!--item
|
||||
android:id="@+id/itemDelete"
|
||||
android:orderInCategory="101"
|
||||
android:showAsAction="never"
|
||||
android:title="@string/action_delete"/>
|
||||
android:title="@string/action_delete"/-->
|
||||
|
||||
<!-- item
|
||||
android:id="@+id/itemExport"
|
||||
|
||||
@ -18,4 +18,6 @@
|
||||
|
||||
<color name="text_title">#000000</color>
|
||||
|
||||
<color name="disable">#40398A3C</color>
|
||||
|
||||
</resources>
|
||||
|
||||
@ -22,13 +22,19 @@
|
||||
</style>
|
||||
|
||||
<style name="MyButtonTheme" parent="@android:style/Widget.Button">
|
||||
<item name="android:background">@drawable/button</item>
|
||||
<item name="android:background">@drawable/button_blue</item>
|
||||
<item name="android:textColor">@color/White</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="ButtonPinkTheme" parent="@android:style/Widget.Button">
|
||||
<item name="android:background">@drawable/button_pink</item>
|
||||
<item name="android:textColor">@color/White</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<style name="MyImageButtonTheme" parent="@android:style/Widget.ImageButton">
|
||||
<item name="android:background">@drawable/button</item>
|
||||
<item name="android:background">@drawable/button_blue</item>
|
||||
<item name="android:textColor">@color/White</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user