parent
1eabc8672e
commit
e531cf7982
|
@ -1,21 +1,10 @@
|
|||
package com.utopiaindustries.hseobservationsapp.activities.HSETrainingForms;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.media.ExifInterface;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -32,50 +21,20 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.PermitToWorkForms.PermitOneActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.PermitToWorkForms.PermitTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.BuildingsAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.DepartmentAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.FloorsAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.SafetyTrainingAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseBuilding;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseDepartment;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseFloor;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseSafetyTrainingTopic;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import pub.devrel.easypermissions.AfterPermissionGranted;
|
||||
import pub.devrel.easypermissions.AppSettingsDialog;
|
||||
import pub.devrel.easypermissions.EasyPermissions;
|
||||
|
||||
public class HseOneActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -192,6 +151,14 @@ public class HseOneActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(HseOneActivity.this);
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
btnNext = findViewById(R.id.btn_next);
|
||||
|
@ -231,7 +198,7 @@ public class HseOneActivity extends AppCompatActivity {
|
|||
|
||||
alertDialog.dismiss();
|
||||
|
||||
StorageManager.getInstance().getHseTrainingModel().clear();
|
||||
StorageManager.getInstance().clearHseTrainingModule();
|
||||
finish();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,32 +3,47 @@ package com.utopiaindustries.hseobservationsapp.activities.InjuryRecordForms;
|
|||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ShiftAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
public class InjuryFormOne extends AppCompatActivity {
|
||||
|
||||
private int year, month, day;
|
||||
private Calendar calendar;
|
||||
TextView txtDate;
|
||||
private ImageView imgCalendar;
|
||||
Button btnNext;
|
||||
Button btnNext, btnFetch;
|
||||
LoginViewModel loginViewModel;
|
||||
EditText etEmpId, etEmployeeName, etEmployeeDesignation, etEmployeeTenure, etDate, etEmployeeType;
|
||||
ImageView imgBack;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -43,50 +58,153 @@ public class InjuryFormOne extends AppCompatActivity {
|
|||
|
||||
initializeLayouts();
|
||||
|
||||
imgCalendar.setOnClickListener(new View.OnClickListener() {
|
||||
imgBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
showDatePickerDialog(InjuryFormOne.this);
|
||||
alertExit(InjuryFormOne.this);
|
||||
}
|
||||
});
|
||||
|
||||
btnFetch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (etEmpId.getText().toString().isEmpty()) {
|
||||
Toast.makeText(InjuryFormOne.this, "Please enter employee id", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
loginViewModel.getEmployeeData(etEmpId.getText().toString());
|
||||
}
|
||||
});
|
||||
|
||||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(InjuryFormOne.this, InjuryFormTwo.class);
|
||||
startActivity(intent);
|
||||
if (isValidate()) {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setEmployeeId(Integer.parseInt(etEmpId.getText().toString()));
|
||||
Intent intent = new Intent(InjuryFormOne.this, InjuryFormTwo.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void alertExit(Context con) {
|
||||
ViewGroup viewGroup = findViewById(android.R.id.content);
|
||||
|
||||
TextView dialogOkBtn, dialogCancelBtn;
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_exit, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogOkBtn = view1.findViewById(R.id.dialogOkBtn);
|
||||
dialogCancelBtn = view1.findViewById(R.id.dialogCancelBtn);
|
||||
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
dialogOkBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
|
||||
StorageManager.getInstance().clearInjuryRecordModule();
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
dialogCancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
|
||||
calendar = Calendar.getInstance();
|
||||
year = calendar.get(Calendar.YEAR);
|
||||
month = calendar.get(Calendar.MONTH);
|
||||
day = calendar.get(Calendar.DAY_OF_MONTH);
|
||||
txtDate = findViewById(R.id.txt_date);
|
||||
imgCalendar = findViewById(R.id.img_calendar);
|
||||
btnNext = findViewById(R.id.btn_next);
|
||||
btnFetch = findViewById(R.id.btn_fetch);
|
||||
etEmpId = findViewById(R.id.et_employee_id_number);
|
||||
etEmployeeName = findViewById(R.id.et_employee_name);
|
||||
etEmployeeDesignation = findViewById(R.id.et_employee_designation);
|
||||
etEmployeeTenure = findViewById(R.id.et_employee_tenure);
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
etEmployeeType = findViewById(R.id.et_employee_type);
|
||||
etDate = findViewById(R.id.et_date);
|
||||
|
||||
loginViewModel = new ViewModelProvider(this).get(LoginViewModel.class);
|
||||
|
||||
loginViewModel.getLoadingState().observe(this, isLoading -> {
|
||||
|
||||
if (isLoading != null && isLoading) {
|
||||
showProgressDialog();
|
||||
} else {
|
||||
dismissProgressDialog();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
|
||||
loginViewModel.getEmployeeLiveData().observe(this, employeeInfoResponse -> {
|
||||
if (employeeInfoResponse != null) {
|
||||
Log.e("Employee-Info: ",""+employeeInfoResponse.toString());
|
||||
|
||||
etEmployeeName.setText(employeeInfoResponse.getFullName());
|
||||
etEmployeeDesignation.setText(employeeInfoResponse.getPositionTitle());
|
||||
etEmployeeTenure.setText(employeeInfoResponse.getEmployeeTenure());
|
||||
etDate.setText(employeeInfoResponse.getJoiningDate());
|
||||
etEmployeeType.setText(employeeInfoResponse.getWorkerType());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showDatePickerDialog(Context context) {
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(
|
||||
context,
|
||||
new DatePickerDialog.OnDateSetListener() {
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
|
||||
// Month is 0-indexed, so we add 1
|
||||
Calendar selectedCalendar = Calendar.getInstance();
|
||||
selectedCalendar.set(year, monthOfYear, dayOfMonth);
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy", Locale.getDefault());
|
||||
String selectedDate = dateFormat.format(selectedCalendar.getTime());
|
||||
txtDate.setText(selectedDate);
|
||||
}
|
||||
},
|
||||
year, month, day
|
||||
);
|
||||
datePickerDialog.show();
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(InjuryFormOne.this);
|
||||
}
|
||||
|
||||
public void showProgressDialog() {
|
||||
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show(getSupportFragmentManager(), "progressDialog");
|
||||
}
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
ProgressDialogFragment progressDialog = (ProgressDialogFragment)
|
||||
getSupportFragmentManager().findFragmentByTag("progressDialog");
|
||||
if (progressDialog != null) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
if (etEmpId.getText().toString().isEmpty()) {
|
||||
message = "Employee ID is required.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
|
@ -16,10 +16,16 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -34,14 +40,22 @@ import androidx.core.content.FileProvider;
|
|||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.PermitToWorkForms.PermitTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.InjuryRecordModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.PermitToWorkModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -70,6 +84,8 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
private static final int GALLERY_REQUEST = 201;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnNext;
|
||||
EditText etDescription;
|
||||
LoginViewModel loginViewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -193,10 +209,89 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(InjuryFormThree.this, InjuryFormFour.class);
|
||||
startActivity(intent);
|
||||
if (isValidate()) {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setPictures(PaperImageList);
|
||||
// Toast.makeText(PermitTwoActivity.this,"Reported Submitted",Toast.LENGTH_SHORT).show();
|
||||
alertReportSubmit(InjuryFormThree.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
etDescription.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void alertReportSubmit(Context con) {
|
||||
ViewGroup viewGroup = findViewById(android.R.id.content);
|
||||
|
||||
TextView dialogOkBtn, dialogCancelBtn;
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_report_submission, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogOkBtn = view1.findViewById(R.id.dialogOkBtn);
|
||||
dialogCancelBtn = view1.findViewById(R.id.dialogCancelBtn);
|
||||
|
||||
AlertDialog alertDialog = builder.create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
dialogOkBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
|
||||
List<InjuryRecordModel> reportList = StorageManager.getInstance().getInjuryRecordModel();
|
||||
HseReportRequest<InjuryRecordModel> hseTrainingRequest = new HseReportRequest<>();
|
||||
hseTrainingRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
hseTrainingRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
hseTrainingRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
hseTrainingRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
hseTrainingRequest.setShift(StorageManager.getInstance().getShift());
|
||||
hseTrainingRequest.setDepartmentId(StorageManager.getInstance().getDepartmentId());
|
||||
hseTrainingRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
hseTrainingRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
hseTrainingRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
hseTrainingRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(hseTrainingRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
|
||||
//loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
dialogCancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
//Toast.makeText(con, "Cancel", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
|
@ -204,9 +299,38 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
imgUpload = findViewById(R.id.img_upload);
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
btnNext = findViewById(R.id.btn_next);
|
||||
etDescription = findViewById(R.id.et_description);
|
||||
etDescription.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
etDescription.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
picturesRecyclerView = findViewById(R.id.picturesRecyclerView);
|
||||
|
||||
loginViewModel = new ViewModelProvider(this).get(LoginViewModel.class);
|
||||
|
||||
loginViewModel.getLoadingState().observe(this, isLoading -> {
|
||||
|
||||
if (isLoading != null && isLoading) {
|
||||
showProgressDialog();
|
||||
} else {
|
||||
dismissProgressDialog();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
});
|
||||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(InjuryFormThree.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||
}
|
||||
});
|
||||
|
||||
imagePaperAdapter = new PTWImageAdapter(PaperImageList, this, "");
|
||||
picturesRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
picturesRecyclerView.setAdapter(imagePaperAdapter);
|
||||
|
@ -534,4 +658,58 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
if (etDescription.getText().toString().isEmpty()) {
|
||||
message = "Please enter description.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public void showProgressDialog() {
|
||||
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show(getSupportFragmentManager(), "progressDialog");
|
||||
}
|
||||
|
||||
public void dismissProgressDialog() {
|
||||
ProgressDialogFragment progressDialog = (ProgressDialogFragment)
|
||||
getSupportFragmentManager().findFragmentByTag("progressDialog");
|
||||
if (progressDialog != null) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (StorageManager.getInstance().getInjuryRecordModel() != null &&
|
||||
!StorageManager.getInstance().getInjuryRecordModel().isEmpty()) {
|
||||
showPersistData();
|
||||
}
|
||||
}
|
||||
|
||||
private void showPersistData() {
|
||||
etDescription.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getDescription());
|
||||
|
||||
if (StorageManager.getInstance().getInjuryRecordModel().get(0).getPictures() != null
|
||||
&& !StorageManager.getInstance().getInjuryRecordModel().get(0).getPictures().isEmpty()) {
|
||||
PaperImageList.clear();
|
||||
PaperImageList.addAll(StorageManager.getInstance().getInjuryRecordModel().get(0).getPictures());
|
||||
imagePaperAdapter = new PTWImageAdapter(PaperImageList, this, "");
|
||||
picturesRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
picturesRecyclerView.setAdapter(imagePaperAdapter);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,12 @@ package com.utopiaindustries.hseobservationsapp.activities.InjuryRecordForms;
|
|||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
@ -12,10 +17,58 @@ import androidx.core.view.ViewCompat;
|
|||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.ObservationOneActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.BodyPartAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.IncidentTypeAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.InjuryTypeAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PersonalIllnessAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ShiftAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuredBodyPart;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjury;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationSubClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class InjuryFormTwo extends AppCompatActivity {
|
||||
|
||||
TextView headingIllness;
|
||||
Button btnNext;
|
||||
ImageView imgBack;
|
||||
private AutoCompleteTextView kpiTextview, incidentTypeTextview,
|
||||
injuryTypeTextview, personalIllnessTextview, bodyPartTextview, riskTypeTextview ;
|
||||
String kpi = "";
|
||||
private ShiftAdapter shiftAdapter;
|
||||
private ArrayList<Shift> kpiArrayList = new ArrayList<>();
|
||||
|
||||
private ArrayList<HseIncidentType> incidentTypeArrayList = new ArrayList<>();
|
||||
private IncidentTypeAdapter incidentTypeAdapter;
|
||||
|
||||
|
||||
private ArrayList<Shift> riskTypeArrayList = new ArrayList<>();
|
||||
private ShiftAdapter riskTypeAdapter;
|
||||
|
||||
private ArrayList<HseInjury> personalIllnessArrayList_temp = new ArrayList<>();
|
||||
private ArrayList<HseInjury> personalIllnessArrayList = new ArrayList<>();
|
||||
private PersonalIllnessAdapter personalIllnessAdapter;
|
||||
|
||||
private ArrayList<Shift> injuryTypeArrayList = new ArrayList<>();
|
||||
//private InjuryTypeAdapter injuryTypeAdapter;
|
||||
private ShiftAdapter injuryTypeAdapter;
|
||||
|
||||
private ArrayList<HseInjuredBodyPart> bodyPartArrayList = new ArrayList<>();
|
||||
private BodyPartAdapter bodyPartAdapter;
|
||||
|
||||
String hseInjury = "";
|
||||
LinearLayout layoutAccident, layoutInjury, layoutBodyParts;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -28,8 +81,122 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
return insets;
|
||||
});
|
||||
|
||||
//Type of injury --- Type of incidents
|
||||
//Near Miss, Property Damage, Fire, RTA -- risk type dropdown(Major, minor)
|
||||
|
||||
//Pictures, description
|
||||
//--------------------------------
|
||||
|
||||
//Personal illness -- Type of personal illness dropdown, risk dropdown(major minor),
|
||||
|
||||
// pictuers, description
|
||||
//---------------------------------
|
||||
|
||||
//Accident -- Type of Accident, injury Type, body part dropdowns, risk dropdown(major minor),
|
||||
|
||||
// pictuers, description
|
||||
//-----------------------------------
|
||||
|
||||
initializeLayouts();
|
||||
|
||||
imgBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
kpiTextview.setOnItemClickListener((v, position, id, item) -> {
|
||||
kpi = kpiArrayList.get(id).getTitle();
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setKpi(kpi);
|
||||
});
|
||||
|
||||
incidentTypeTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
HseIncidentType clickedItem = incidentTypeArrayList.get(position);
|
||||
int selectedId = clickedItem.getId();
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeId(selectedId);
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentTypeName(clickedItem.getTitle());
|
||||
//Near Miss = 1, Property Damage = 2, Fire = 5, RTA = 6
|
||||
//Personal Illness = 4
|
||||
//Accident = 3
|
||||
//
|
||||
switch (selectedId) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 5:
|
||||
case 6:
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
layoutAccident.setVisibility(View.GONE);
|
||||
layoutInjury.setVisibility(View.GONE);
|
||||
layoutBodyParts.setVisibility(View.GONE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
headingIllness.setText("Type Of Accident *");
|
||||
layoutAccident.setVisibility(View.VISIBLE);
|
||||
layoutInjury.setVisibility(View.VISIBLE);
|
||||
layoutBodyParts.setVisibility(View.VISIBLE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
layoutAccident.setVisibility(View.VISIBLE);
|
||||
layoutInjury.setVisibility(View.GONE);
|
||||
layoutBodyParts.setVisibility(View.GONE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
|
||||
}
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
|
||||
if (!personalIllnessArrayList_temp.isEmpty()) {
|
||||
|
||||
List<HseInjury> filteredUnitItems = personalIllnessArrayList_temp.stream()
|
||||
.filter(item -> Objects.equals(item.getIncidentId(), clickedItem.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
personalIllnessArrayList.clear();
|
||||
personalIllnessArrayList.addAll(filteredUnitItems);
|
||||
personalIllnessAdapter = new PersonalIllnessAdapter(InjuryFormTwo.this, filteredUnitItems);
|
||||
personalIllnessTextview.setAdapter(personalIllnessAdapter);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
personalIllnessTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
hseInjury = personalIllnessArrayList.get(position).getTitle();
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setAccidentTypeId(personalIllnessArrayList.get(position).getId());
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setAccidentTypeName(personalIllnessArrayList.get(position).getTitle());
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
riskTypeTextview.setOnItemClickListener((v, position, id, item) -> {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setRiskTypeName(riskTypeArrayList.get(id).getTitle());
|
||||
});
|
||||
|
||||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -37,10 +204,171 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
injuryTypeTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryTypeId(injuryTypeArrayList.get(position).getId());
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryTypeName(injuryTypeArrayList.get(position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
bodyPartTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setBodyPartId(bodyPartArrayList.get(position).getId());
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setBodyPartName(bodyPartArrayList.get(position).getTitle());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
|
||||
headingIllness = findViewById(R.id.heading_illness);
|
||||
btnNext = findViewById(R.id.btn_next);
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
kpiTextview = findViewById(R.id.kpi_textview);
|
||||
injuryTypeTextview = findViewById(R.id.injury_type_textview);
|
||||
incidentTypeTextview = findViewById(R.id.incident_type_textview);
|
||||
riskTypeTextview = findViewById(R.id.risk_type_textview);
|
||||
personalIllnessTextview = findViewById(R.id.personal_illness_textview);
|
||||
bodyPartTextview = findViewById(R.id.body_part_textview);
|
||||
|
||||
layoutAccident = findViewById(R.id.layout_accident);
|
||||
layoutInjury = findViewById(R.id.layout_injury);
|
||||
layoutBodyParts = findViewById(R.id.layout_body_parts);
|
||||
|
||||
showLayouts();
|
||||
|
||||
//kpi -----------
|
||||
kpiArrayList.add(new Shift(1, "First Aid Case"));
|
||||
kpiArrayList.add(new Shift(2, "Reportable Injury"));
|
||||
kpiArrayList.add(new Shift(3, "LTI"));
|
||||
kpiArrayList.add(new Shift(4, "Fire Accident"));
|
||||
kpiArrayList.add(new Shift(5, "Causality/Fatality"));
|
||||
|
||||
shiftAdapter = new ShiftAdapter(this, kpiArrayList);
|
||||
kpiTextview.setAdapter(shiftAdapter);
|
||||
|
||||
//incident type ------------
|
||||
incidentTypeArrayList.addAll(Helper.getList(Helper.hseIncidentTypes, this, HseIncidentType.class));
|
||||
incidentTypeAdapter = new IncidentTypeAdapter(this, incidentTypeArrayList);
|
||||
incidentTypeTextview.setAdapter(incidentTypeAdapter);
|
||||
|
||||
//personal illness -----------
|
||||
personalIllnessArrayList_temp.addAll(Helper.getList(Helper.hseInjuries, this, HseInjury.class));
|
||||
|
||||
//Injury Type
|
||||
//injuryTypeArrayList.addAll(Helper.getList(Helper.hseInjuries, this, HseInjury.class));
|
||||
injuryTypeArrayList.add(new Shift(1, "Cut Injury"));
|
||||
injuryTypeArrayList.add(new Shift(2, "Muscle Injury"));
|
||||
injuryTypeArrayList.add(new Shift(3, "Fracture"));
|
||||
injuryTypeArrayList.add(new Shift(4, "Electric Shock"));
|
||||
injuryTypeArrayList.add(new Shift(5, "Burn Injury"));
|
||||
injuryTypeArrayList.add(new Shift(6, "Entanglement"));
|
||||
injuryTypeArrayList.add(new Shift(7, "Others"));
|
||||
injuryTypeAdapter = new ShiftAdapter(this, injuryTypeArrayList);
|
||||
injuryTypeTextview.setAdapter(injuryTypeAdapter);
|
||||
|
||||
//body part
|
||||
bodyPartArrayList.addAll(Helper.getList(Helper.hseInjuredBodyPart, this, HseInjuredBodyPart.class));
|
||||
bodyPartAdapter = new BodyPartAdapter(this, bodyPartArrayList);
|
||||
bodyPartTextview.setAdapter(bodyPartAdapter);
|
||||
|
||||
//risk type
|
||||
riskTypeArrayList.add(new Shift(1, "Major"));
|
||||
riskTypeArrayList.add(new Shift(2, "Minor"));
|
||||
|
||||
riskTypeAdapter = new ShiftAdapter(this, riskTypeArrayList);
|
||||
riskTypeTextview.setAdapter(riskTypeAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
if (StorageManager.getInstance().getInjuryRecordModel() != null && !StorageManager.getInstance().getInjuryRecordModel().isEmpty()) {
|
||||
showPersistData();
|
||||
}
|
||||
}
|
||||
|
||||
private void showPersistData() {
|
||||
kpiTextview.post(() -> kpiTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getKpi(), false));
|
||||
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeName(), false));
|
||||
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName(), false));
|
||||
injuryTypeTextview.post(() -> injuryTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryTypeName(), false));
|
||||
bodyPartTextview.post(() -> bodyPartTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getBodyPartName(), false));
|
||||
riskTypeTextview.post(() -> riskTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getRiskTypeName(), false));
|
||||
|
||||
showLayouts();
|
||||
|
||||
if (!personalIllnessArrayList_temp.isEmpty()) {
|
||||
|
||||
List<HseInjury> filteredUnitItems = personalIllnessArrayList_temp.stream()
|
||||
.filter(item -> Objects.equals(item.getIncidentId(), StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentTypeId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
personalIllnessArrayList.clear();
|
||||
personalIllnessArrayList.addAll(filteredUnitItems);
|
||||
personalIllnessAdapter = new PersonalIllnessAdapter(InjuryFormTwo.this, filteredUnitItems);
|
||||
personalIllnessTextview.setAdapter(personalIllnessAdapter);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void showLayouts() {
|
||||
if (StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName() != null
|
||||
&& !StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName().isEmpty()) {
|
||||
switch (StorageManager.getInstance().getInjuryRecordModel().get(0).getAccidentTypeName()) {
|
||||
case "Near Miss":
|
||||
case "Property Damage":
|
||||
case "RTA":
|
||||
case "Fire":
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
layoutAccident.setVisibility(View.GONE);
|
||||
layoutInjury.setVisibility(View.GONE);
|
||||
layoutBodyParts.setVisibility(View.GONE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
|
||||
break;
|
||||
|
||||
case "Accident":
|
||||
headingIllness.setText("Type Of Accident *");
|
||||
layoutAccident.setVisibility(View.VISIBLE);
|
||||
layoutInjury.setVisibility(View.VISIBLE);
|
||||
layoutBodyParts.setVisibility(View.VISIBLE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
break;
|
||||
|
||||
case "Personal Illness":
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
layoutAccident.setVisibility(View.VISIBLE);
|
||||
layoutInjury.setVisibility(View.GONE);
|
||||
layoutBodyParts.setVisibility(View.GONE);
|
||||
|
||||
personalIllnessTextview.setText(null);
|
||||
injuryTypeTextview.setText(null);
|
||||
bodyPartTextview.setText(null);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
headingIllness.setText("Type of Personal illness *");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,11 +18,8 @@ import androidx.core.view.WindowInsetsCompat;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.PermitToWorkForms.PermitTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationClassAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
|
@ -351,6 +351,14 @@ public class ObservationOneActivity extends AppCompatActivity implements EasyPer
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(ObservationOneActivity.this);
|
||||
}
|
||||
|
||||
public void alertExit(Context con) {
|
||||
ViewGroup viewGroup = findViewById(android.R.id.content);
|
||||
|
||||
|
@ -373,7 +381,7 @@ public class ObservationOneActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
alertDialog.dismiss();
|
||||
|
||||
StorageManager.getInstance().getObservationsModel().clear();
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
finish();
|
||||
|
||||
}
|
||||
|
|
|
@ -145,6 +145,14 @@ public class PermitOneActivity extends AppCompatActivity {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(PermitOneActivity.this);
|
||||
}
|
||||
|
||||
public void alertExit(Context con) {
|
||||
ViewGroup viewGroup = findViewById(android.R.id.content);
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import android.net.Uri;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
|
@ -26,7 +25,6 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ScrollView;
|
||||
|
@ -43,23 +41,17 @@ import androidx.core.content.FileProvider;
|
|||
import androidx.core.graphics.Insets;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.ObservationThreeActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseTrainingModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.PermitToWorkModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
|
|
@ -50,12 +50,9 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.GsonBuilder;
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.PermitToWorkForms.PermitTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.WeeklyActivityForms.WeeklyFormOne;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.HseActivitiesAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
|
|
|
@ -50,17 +50,10 @@ import com.google.gson.Gson;
|
|||
import com.google.gson.GsonBuilder;
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.InjuryRecordForms.InjuryFormFour;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.InjuryRecordForms.InjuryFormThree;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.ObservationThreeActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.OtherHSEActivityForms.OtherHseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.HseActivitiesAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.ReportActivityModel;
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.utopiaindustries.hseobservationsapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjuredBodyPart;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BodyPartAdapter extends ArrayAdapter<HseInjuredBodyPart> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseInjuredBodyPart> items;
|
||||
|
||||
public BodyPartAdapter(Context context, List<HseInjuredBodyPart> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseInjuredBodyPart item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,6 @@ import android.widget.TextView;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseDepartment;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
package com.utopiaindustries.hseobservationsapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class IncidentTypeAdapter extends ArrayAdapter<HseIncidentType> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseIncidentType> items;
|
||||
|
||||
public IncidentTypeAdapter(Context context, List<HseIncidentType> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseIncidentType item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.utopiaindustries.hseobservationsapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InjuryTypeAdapter extends ArrayAdapter<HseIncidentType> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseIncidentType> items;
|
||||
|
||||
public InjuryTypeAdapter(Context context, List<HseIncidentType> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseIncidentType item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,6 @@ import android.widget.TextView;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.widget.TextView;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationSubClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -9,9 +9,7 @@ import android.util.Log;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -22,7 +20,6 @@ import com.bumptech.glide.Glide;
|
|||
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.DocumentTypeImageModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.FullScreenImageDialog;
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.utopiaindustries.hseobservationsapp.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseIncidentType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseInjury;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PersonalIllnessAdapter extends ArrayAdapter<HseInjury> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseInjury> items;
|
||||
|
||||
public PersonalIllnessAdapter(Context context, List<HseInjury> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
HseInjury item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import android.widget.ArrayAdapter;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -8,8 +8,7 @@ import android.widget.ArrayAdapter;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.LocationSite;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import android.widget.TextView;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Site;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package com.utopiaindustries.hseobservationsapp.apiservice;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.EmployeeInfoResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseSaveResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.QualityControl;
|
||||
import com.utopiaindustries.hseobservationsapp.models.QualityControlResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.QualitySaveResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.HSERequestModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
|
||||
import retrofit2.Call;
|
||||
|
@ -16,14 +13,14 @@ import retrofit2.http.Query;
|
|||
|
||||
public interface ApiService {
|
||||
|
||||
/*@GET("rest/uic/inspection-report")
|
||||
Call<List<Container>> fetchAllReports(
|
||||
@Query("username") String username
|
||||
);*/
|
||||
|
||||
@GET("rest/uic/hse/get-hse-report-data")
|
||||
Call<HseResponse> getHseData();
|
||||
|
||||
@GET("rest/uic/hse/get-hse-employee-by-id")
|
||||
Call<EmployeeInfoResponse> getEmployeeData(
|
||||
@Query("employee-id") String empId
|
||||
);
|
||||
|
||||
@POST("rest/uic/hse/save-hse-report")
|
||||
Call<HseSaveResponse> saveHseReport(
|
||||
@Body HseReportRequest request
|
||||
|
|
|
@ -43,7 +43,7 @@ import com.utopiaindustries.hseobservationsapp.models.HseData.HseFloor;
|
|||
import com.utopiaindustries.hseobservationsapp.models.HseData.RecordType;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Site;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Supervisor;
|
||||
import com.utopiaindustries.hseobservationsapp.models.Shift;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.Shift;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
|
|
@ -1,177 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Department {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("companyId")
|
||||
@Expose
|
||||
private Integer companyId;
|
||||
@SerializedName("functionId")
|
||||
@Expose
|
||||
private Integer functionId;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("organization")
|
||||
@Expose
|
||||
private String organization;
|
||||
@SerializedName("code")
|
||||
@Expose
|
||||
private Integer code;
|
||||
@SerializedName("email")
|
||||
@Expose
|
||||
private Object email;
|
||||
@SerializedName("isActive")
|
||||
@Expose
|
||||
private Boolean isActive;
|
||||
@SerializedName("sections")
|
||||
@Expose
|
||||
private Object sections;
|
||||
@SerializedName("hierarchyString")
|
||||
@Expose
|
||||
private Object hierarchyString;
|
||||
@SerializedName("costCenters")
|
||||
@Expose
|
||||
private Object costCenters;
|
||||
@SerializedName("locationSites")
|
||||
@Expose
|
||||
private Object locationSites;
|
||||
@SerializedName("departmentLocationSites")
|
||||
@Expose
|
||||
private Object departmentLocationSites;
|
||||
@SerializedName("utilitySubMeterDepartments")
|
||||
@Expose
|
||||
private List<Object> utilitySubMeterDepartments;
|
||||
@SerializedName("capitalizedTitle")
|
||||
@Expose
|
||||
private String capitalizedTitle;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(Integer companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Integer getFunctionId() {
|
||||
return functionId;
|
||||
}
|
||||
|
||||
public void setFunctionId(Integer functionId) {
|
||||
this.functionId = functionId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
|
||||
public void setOrganization(String organization) {
|
||||
this.organization = organization;
|
||||
}
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public Object getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(Object email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Boolean getIsActive() {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void setIsActive(Boolean isActive) {
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
public Object getSections() {
|
||||
return sections;
|
||||
}
|
||||
|
||||
public void setSections(Object sections) {
|
||||
this.sections = sections;
|
||||
}
|
||||
|
||||
public Object getHierarchyString() {
|
||||
return hierarchyString;
|
||||
}
|
||||
|
||||
public void setHierarchyString(Object hierarchyString) {
|
||||
this.hierarchyString = hierarchyString;
|
||||
}
|
||||
|
||||
public Object getCostCenters() {
|
||||
return costCenters;
|
||||
}
|
||||
|
||||
public void setCostCenters(Object costCenters) {
|
||||
this.costCenters = costCenters;
|
||||
}
|
||||
|
||||
public Object getLocationSites() {
|
||||
return locationSites;
|
||||
}
|
||||
|
||||
public void setLocationSites(Object locationSites) {
|
||||
this.locationSites = locationSites;
|
||||
}
|
||||
|
||||
public Object getDepartmentLocationSites() {
|
||||
return departmentLocationSites;
|
||||
}
|
||||
|
||||
public void setDepartmentLocationSites(Object departmentLocationSites) {
|
||||
this.departmentLocationSites = departmentLocationSites;
|
||||
}
|
||||
|
||||
public List<Object> getUtilitySubMeterDepartments() {
|
||||
return utilitySubMeterDepartments;
|
||||
}
|
||||
|
||||
public void setUtilitySubMeterDepartments(List<Object> utilitySubMeterDepartments) {
|
||||
this.utilitySubMeterDepartments = utilitySubMeterDepartments;
|
||||
}
|
||||
|
||||
public String getCapitalizedTitle() {
|
||||
return capitalizedTitle;
|
||||
}
|
||||
|
||||
public void setCapitalizedTitle(String capitalizedTitle) {
|
||||
this.capitalizedTitle = capitalizedTitle;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
public class DocumentTypeImageModel {
|
||||
|
||||
private String docTypeId;
|
||||
private String documentTypeName;
|
||||
private byte[] image;
|
||||
|
||||
public DocumentTypeImageModel(String docTypeId, String documentTypeName, byte[] image) {
|
||||
this.docTypeId = docTypeId;
|
||||
this.documentTypeName = documentTypeName;
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getDocTypeId() {
|
||||
return docTypeId;
|
||||
}
|
||||
public void setDocTypeId(String docTypeId) {
|
||||
this.docTypeId = docTypeId;
|
||||
}
|
||||
public String getDocumentTypeName() {
|
||||
return documentTypeName;
|
||||
}
|
||||
public void setDocumentTypeName(String documentTypeName) {
|
||||
this.documentTypeName = documentTypeName;
|
||||
}
|
||||
public byte[] getImage() {
|
||||
return image;
|
||||
}
|
||||
public void setImage(byte[] image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DocumentTypeImageModel{" +
|
||||
"docTypeId='" + docTypeId + '\'' +
|
||||
", documentTypeName='" + documentTypeName + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FormType {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
|
||||
public FormType(Integer id, String title) {
|
||||
this.id = id;
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models.HseData;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class EmployeeInfoResponse {
|
||||
|
||||
@SerializedName("workerType")
|
||||
@Expose
|
||||
private String workerType;
|
||||
@SerializedName("positionTitle")
|
||||
@Expose
|
||||
private String positionTitle;
|
||||
@SerializedName("fullName")
|
||||
@Expose
|
||||
private String fullName;
|
||||
@SerializedName("joiningDate")
|
||||
@Expose
|
||||
private String joiningDate;
|
||||
@SerializedName("employeeTenure")
|
||||
@Expose
|
||||
private String employeeTenure;
|
||||
|
||||
public String getWorkerType() {
|
||||
return workerType;
|
||||
}
|
||||
|
||||
public void setWorkerType(String workerType) {
|
||||
this.workerType = workerType;
|
||||
}
|
||||
|
||||
public String getPositionTitle() {
|
||||
return positionTitle;
|
||||
}
|
||||
|
||||
public void setPositionTitle(String positionTitle) {
|
||||
this.positionTitle = positionTitle;
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
public void setFullName(String fullName) {
|
||||
this.fullName = fullName;
|
||||
}
|
||||
|
||||
public String getJoiningDate() {
|
||||
return joiningDate;
|
||||
}
|
||||
|
||||
public void setJoiningDate(String joiningDate) {
|
||||
this.joiningDate = joiningDate;
|
||||
}
|
||||
|
||||
public String getEmployeeTenure() {
|
||||
return employeeTenure;
|
||||
}
|
||||
|
||||
public void setEmployeeTenure(String employeeTenure) {
|
||||
this.employeeTenure = employeeTenure;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EmployeeInfoResponse{" +
|
||||
"workerType='" + workerType + '\'' +
|
||||
", positionTitle='" + positionTitle + '\'' +
|
||||
", fullName='" + fullName + '\'' +
|
||||
", joiningDate='" + joiningDate + '\'' +
|
||||
", employeeTenure='" + employeeTenure + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -29,4 +29,9 @@ public class HseIncidentType {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,4 +29,9 @@ public class HseInjuredBodyPart {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,4 +40,9 @@ public class HseInjury {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
package com.utopiaindustries.hseobservationsapp.models.HseData;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
|
@ -1,24 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
public class Item {
|
||||
|
||||
private final String name;
|
||||
private int selectedOption; // Index of the selected dropdown option
|
||||
|
||||
public Item(String name, int selectedOption) {
|
||||
this.name = name;
|
||||
this.selectedOption = selectedOption;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSelectedOption() {
|
||||
return selectedOption;
|
||||
}
|
||||
|
||||
public void setSelectedOption(int selectedOption) {
|
||||
this.selectedOption = selectedOption;
|
||||
}
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemModel {
|
||||
|
||||
private int processId;
|
||||
private int stepId;
|
||||
private double rating;
|
||||
private String percentage;
|
||||
private String remarks;
|
||||
private int selectedOption;
|
||||
private byte[] imageByteArray;
|
||||
private List<byte[]> files;
|
||||
|
||||
public ItemModel() {
|
||||
}
|
||||
|
||||
public ItemModel(int processId, int stepId, double rating, String percentage, String remarks, int selectedOption, byte[] imageByteArray, List<byte[]> imageArrayList) {
|
||||
this.processId = processId;
|
||||
this.stepId = stepId;
|
||||
this.rating = rating;
|
||||
this.percentage = percentage;
|
||||
this.remarks = remarks;
|
||||
this.selectedOption = selectedOption;
|
||||
this.imageByteArray = imageByteArray;
|
||||
this.files = imageArrayList;
|
||||
}
|
||||
|
||||
public int getProcessId() {
|
||||
return processId;
|
||||
}
|
||||
|
||||
public void setProcessId(int processId) {
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public int getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(int stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getPercentage() {
|
||||
return percentage;
|
||||
}
|
||||
|
||||
public void setPercentage(String percentage) {
|
||||
this.percentage = percentage;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public int getSelectedOption() {
|
||||
return selectedOption;
|
||||
}
|
||||
|
||||
public void setSelectedOption(int selectedOption) {
|
||||
this.selectedOption = selectedOption;
|
||||
}
|
||||
|
||||
public double getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
public void setRating(double rating) {
|
||||
this.rating = rating;
|
||||
}
|
||||
|
||||
public byte[] getImageUri() {
|
||||
return imageByteArray;
|
||||
}
|
||||
|
||||
public void setImageUri(byte[] imageUri) {
|
||||
this.imageByteArray = imageUri;
|
||||
}
|
||||
|
||||
public List<byte[]> getImageArrayList() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setImageArrayList(List<byte[]> imageArrayList) {
|
||||
this.files = imageArrayList;
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LocationFloor {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("siteId")
|
||||
@Expose
|
||||
private Integer siteId;
|
||||
@SerializedName("unitId")
|
||||
@Expose
|
||||
private Integer unitId;
|
||||
@SerializedName("stores")
|
||||
@Expose
|
||||
private Object stores;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(Integer siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public Integer getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(Integer unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public Object getStores() {
|
||||
return stores;
|
||||
}
|
||||
|
||||
public void setStores(Object stores) {
|
||||
this.stores = stores;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LocationSite {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("shortTitle")
|
||||
@Expose
|
||||
private String shortTitle;
|
||||
@SerializedName("address")
|
||||
@Expose
|
||||
private String address;
|
||||
@SerializedName("hasColony")
|
||||
@Expose
|
||||
private Boolean hasColony;
|
||||
@SerializedName("units")
|
||||
@Expose
|
||||
private Object units;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getShortTitle() {
|
||||
return shortTitle;
|
||||
}
|
||||
|
||||
public void setShortTitle(String shortTitle) {
|
||||
this.shortTitle = shortTitle;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public Boolean getHasColony() {
|
||||
return hasColony;
|
||||
}
|
||||
|
||||
public void setHasColony(Boolean hasColony) {
|
||||
this.hasColony = hasColony;
|
||||
}
|
||||
|
||||
public Object getUnits() {
|
||||
return units;
|
||||
}
|
||||
|
||||
public void setUnits(Object units) {
|
||||
this.units = units;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LocationUnit {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("siteId")
|
||||
@Expose
|
||||
private Integer siteId;
|
||||
@SerializedName("floors")
|
||||
@Expose
|
||||
private Object floors;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(Integer siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public Object getFloors() {
|
||||
return floors;
|
||||
}
|
||||
|
||||
public void setFloors(Object floors) {
|
||||
this.floors = floors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class QualityControl {
|
||||
|
||||
private String generatedBy;
|
||||
private int siteId;
|
||||
private int unitId;
|
||||
private int departmentId;
|
||||
private int floorId;
|
||||
private List<ItemModel> qualityControlItemList;
|
||||
|
||||
public QualityControl(String generatedBy, int siteId, int unitId, int departmentId, int floorId, List<ItemModel> qualityControlItemList) {
|
||||
this.generatedBy = generatedBy;
|
||||
this.siteId = siteId;
|
||||
this.unitId = unitId;
|
||||
this.departmentId = departmentId;
|
||||
this.floorId = floorId;
|
||||
this.qualityControlItemList = qualityControlItemList;
|
||||
}
|
||||
|
||||
public String getGeneratedBy() {
|
||||
return generatedBy;
|
||||
}
|
||||
|
||||
public void setGeneratedBy(String generatedBy) {
|
||||
this.generatedBy = generatedBy;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(int unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(int departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public int getFloorId() {
|
||||
return floorId;
|
||||
}
|
||||
|
||||
public void setFloorId(int floorId) {
|
||||
this.floorId = floorId;
|
||||
}
|
||||
|
||||
public List<ItemModel> getQualityControlItemList() {
|
||||
return qualityControlItemList;
|
||||
}
|
||||
|
||||
public void setQualityControlItemList(List<ItemModel> qualityControlItemList) {
|
||||
this.qualityControlItemList = qualityControlItemList;
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class QualityControlProcess {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("name")
|
||||
@Expose
|
||||
private String name;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class QualityControlProcessStep {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("description")
|
||||
@Expose
|
||||
private String description;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class QualityControlResponse {
|
||||
|
||||
@SerializedName("locationUnits")
|
||||
@Expose
|
||||
private List<LocationUnit> locationUnits;
|
||||
@SerializedName("locationFloors")
|
||||
@Expose
|
||||
private List<LocationFloor> locationFloors;
|
||||
@SerializedName("qualityControlProcessSteps")
|
||||
@Expose
|
||||
private List<QualityControlProcessStep> qualityControlProcessSteps;
|
||||
@SerializedName("locationSites")
|
||||
@Expose
|
||||
private List<LocationSite> locationSites;
|
||||
@SerializedName("departments")
|
||||
@Expose
|
||||
private List<Department> departments;
|
||||
@SerializedName("qualityControlProcessList")
|
||||
@Expose
|
||||
private List<QualityControlProcess> qualityControlProcessList;
|
||||
|
||||
public List<LocationUnit> getLocationUnits() {
|
||||
return locationUnits;
|
||||
}
|
||||
|
||||
public void setLocationUnits(List<LocationUnit> locationUnits) {
|
||||
this.locationUnits = locationUnits;
|
||||
}
|
||||
|
||||
|
||||
public List<LocationFloor> getLocationFloors() {
|
||||
return locationFloors;
|
||||
}
|
||||
|
||||
public void setLocationFloors(List<LocationFloor> locationFloors) {
|
||||
this.locationFloors = locationFloors;
|
||||
}
|
||||
|
||||
public List<QualityControlProcessStep> getQualityControlProcessSteps() {
|
||||
return qualityControlProcessSteps;
|
||||
}
|
||||
|
||||
public void setQualityControlProcessSteps(List<QualityControlProcessStep> qualityControlProcessSteps) {
|
||||
this.qualityControlProcessSteps = qualityControlProcessSteps;
|
||||
}
|
||||
|
||||
public List<LocationSite> getLocationSites() {
|
||||
return locationSites;
|
||||
}
|
||||
|
||||
public void setLocationSites(List<LocationSite> locationSites) {
|
||||
this.locationSites = locationSites;
|
||||
}
|
||||
|
||||
public List<Department> getDepartments() {
|
||||
return departments;
|
||||
}
|
||||
|
||||
public void setDepartments(List<Department> departments) {
|
||||
this.departments = departments;
|
||||
}
|
||||
|
||||
public List<QualityControlProcess> getQualityControlProcessList() {
|
||||
return qualityControlProcessList;
|
||||
}
|
||||
|
||||
public void setQualityControlProcessList(List<QualityControlProcess> qualityControlProcessList) {
|
||||
this.qualityControlProcessList = qualityControlProcessList;
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class QualitySaveResponse implements Serializable {
|
||||
|
||||
@SerializedName("overAllPercentage")
|
||||
@Expose
|
||||
private String overAllPercentage;
|
||||
|
||||
@SerializedName("status")
|
||||
@Expose
|
||||
private String status;
|
||||
|
||||
@SerializedName("message")
|
||||
@Expose
|
||||
private String message;
|
||||
|
||||
@SerializedName("Cutting")
|
||||
@Expose
|
||||
private String Cutting;
|
||||
|
||||
@SerializedName("Stiching")
|
||||
@Expose
|
||||
private String Stiching;
|
||||
|
||||
@SerializedName("Checking")
|
||||
@Expose
|
||||
private String Checking;
|
||||
|
||||
@SerializedName("Packing")
|
||||
@Expose
|
||||
private String Packing;
|
||||
|
||||
@SerializedName("Sub Store")
|
||||
@Expose
|
||||
private String Sub_Store;
|
||||
|
||||
@SerializedName("code")
|
||||
@Expose
|
||||
private String ReportId;
|
||||
|
||||
public String getOverAllPercentage() {
|
||||
return overAllPercentage;
|
||||
}
|
||||
|
||||
public void setOverAllPercentage(String overAllPercentage) {
|
||||
this.overAllPercentage = overAllPercentage;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getCutting() {
|
||||
return Cutting;
|
||||
}
|
||||
|
||||
public void setCutting(String cutting) {
|
||||
Cutting = cutting;
|
||||
}
|
||||
|
||||
public String getStiching() {
|
||||
return Stiching;
|
||||
}
|
||||
|
||||
public void setStiching(String stiching) {
|
||||
Stiching = stiching;
|
||||
}
|
||||
|
||||
public String getChecking() {
|
||||
return Checking;
|
||||
}
|
||||
|
||||
public void setChecking(String checking) {
|
||||
Checking = checking;
|
||||
}
|
||||
|
||||
public String getPacking() {
|
||||
return Packing;
|
||||
}
|
||||
|
||||
public void setPacking(String packing) {
|
||||
Packing = packing;
|
||||
}
|
||||
|
||||
public String getSub_Store() {
|
||||
return Sub_Store;
|
||||
}
|
||||
|
||||
public void setSub_Store(String sub_Store) {
|
||||
Sub_Store = sub_Store;
|
||||
}
|
||||
|
||||
public String getReportId() {
|
||||
return ReportId;
|
||||
}
|
||||
|
||||
public void setReportId(String reportId) {
|
||||
ReportId = reportId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,159 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils.StorageManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InjuryRecordModel {
|
||||
private int employeeId;
|
||||
private String Kpi;
|
||||
|
||||
private int incidentTypeId;
|
||||
private String incidentTypeName;
|
||||
|
||||
private int accidentTypeId;
|
||||
private String accidentTypeName;
|
||||
|
||||
private int injuryTypeId;
|
||||
private String injuryTypeName;
|
||||
|
||||
private int bodyPartId;
|
||||
private String bodyPartName;
|
||||
|
||||
private int riskTypeId;
|
||||
private String riskTypeName;
|
||||
|
||||
private String description;
|
||||
|
||||
private List<byte[]> pictures;
|
||||
|
||||
public int getEmployeeId() {
|
||||
return employeeId;
|
||||
}
|
||||
|
||||
public void setEmployeeId(int employeeId) {
|
||||
this.employeeId = employeeId;
|
||||
}
|
||||
|
||||
public String getKpi() {
|
||||
return Kpi;
|
||||
}
|
||||
|
||||
public void setKpi(String kpi) {
|
||||
Kpi = kpi;
|
||||
}
|
||||
|
||||
public int getBodyPartId() {
|
||||
return bodyPartId;
|
||||
}
|
||||
|
||||
public void setBodyPartId(int bodyPartId) {
|
||||
this.bodyPartId = bodyPartId;
|
||||
}
|
||||
|
||||
public String getBodyPartName() {
|
||||
return bodyPartName;
|
||||
}
|
||||
|
||||
public void setBodyPartName(String bodyPartName) {
|
||||
this.bodyPartName = bodyPartName;
|
||||
}
|
||||
|
||||
public int getInjuryTypeId() {
|
||||
return injuryTypeId;
|
||||
}
|
||||
|
||||
public void setInjuryTypeId(int injuryTypeId) {
|
||||
this.injuryTypeId = injuryTypeId;
|
||||
}
|
||||
|
||||
public String getInjuryTypeName() {
|
||||
return injuryTypeName;
|
||||
}
|
||||
|
||||
public void setInjuryTypeName(String injuryTypeName) {
|
||||
this.injuryTypeName = injuryTypeName;
|
||||
}
|
||||
|
||||
public List<byte[]> getPictures() {
|
||||
return pictures;
|
||||
}
|
||||
|
||||
public void setPictures(List<byte[]> pictures) {
|
||||
this.pictures = pictures;
|
||||
}
|
||||
|
||||
public int getIncidentTypeId() {
|
||||
return incidentTypeId;
|
||||
}
|
||||
|
||||
public void setIncidentTypeId(int incidentTypeId) {
|
||||
this.incidentTypeId = incidentTypeId;
|
||||
}
|
||||
|
||||
public String getIncidentTypeName() {
|
||||
return incidentTypeName;
|
||||
}
|
||||
|
||||
public void setIncidentTypeName(String incidentTypeName) {
|
||||
this.incidentTypeName = incidentTypeName;
|
||||
}
|
||||
|
||||
public int getAccidentTypeId() {
|
||||
return accidentTypeId;
|
||||
}
|
||||
|
||||
public void setAccidentTypeId(int accidentTypeId) {
|
||||
this.accidentTypeId = accidentTypeId;
|
||||
}
|
||||
|
||||
public String getAccidentTypeName() {
|
||||
return accidentTypeName;
|
||||
}
|
||||
|
||||
public void setAccidentTypeName(String accidentTypeName) {
|
||||
this.accidentTypeName = accidentTypeName;
|
||||
}
|
||||
|
||||
public int getRiskTypeId() {
|
||||
return riskTypeId;
|
||||
}
|
||||
|
||||
public void setRiskTypeId(int riskTypeId) {
|
||||
this.riskTypeId = riskTypeId;
|
||||
}
|
||||
|
||||
public String getRiskTypeName() {
|
||||
return riskTypeName;
|
||||
}
|
||||
|
||||
public void setRiskTypeName(String riskTypeName) {
|
||||
this.riskTypeName = riskTypeName;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InjuryRecordModel{" +
|
||||
"employeeId=" + employeeId +
|
||||
", Kpi='" + Kpi + '\'' +
|
||||
", incidentTypeId=" + incidentTypeId +
|
||||
", incidentTypeName='" + incidentTypeName + '\'' +
|
||||
", accidentTypeId=" + accidentTypeId +
|
||||
", accidentTypeName='" + accidentTypeName + '\'' +
|
||||
", injuryTypeId=" + injuryTypeId +
|
||||
", injuryTypeName='" + injuryTypeName + '\'' +
|
||||
", bodyPartId=" + bodyPartId +
|
||||
", bodyPartName='" + bodyPartName + '\'' +
|
||||
", riskTypeId=" + riskTypeId +
|
||||
", riskTypeName='" + riskTypeName + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", pictures=" + pictures +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ public class StorageManager {
|
|||
private List<ReportActivityModel> progressiveActivityModel;
|
||||
private List<PermitToWorkModel> permitToWorkModel;
|
||||
private List<HseTrainingModel> hseTrainingModel;
|
||||
private List<InjuryRecordModel> injuryRecordModel;
|
||||
|
||||
|
||||
private StorageManager() {
|
||||
|
@ -57,6 +58,9 @@ public class StorageManager {
|
|||
|
||||
hseTrainingModel = new ArrayList<>();
|
||||
hseTrainingModel.add(new HseTrainingModel());
|
||||
|
||||
injuryRecordModel = new ArrayList<>();
|
||||
injuryRecordModel.add(new InjuryRecordModel());
|
||||
}
|
||||
|
||||
public String getObservation_date() {
|
||||
|
@ -203,7 +207,13 @@ public class StorageManager {
|
|||
this.hseTrainingModel = hseTrainingModel;
|
||||
}
|
||||
|
||||
public List<InjuryRecordModel> getInjuryRecordModel() {
|
||||
return injuryRecordModel;
|
||||
}
|
||||
|
||||
public void setInjuryRecordModel(List<InjuryRecordModel> injuryRecordModel) {
|
||||
this.injuryRecordModel = injuryRecordModel;
|
||||
}
|
||||
|
||||
public void clearObservationModule() {
|
||||
if (observationsModel != null) {
|
||||
|
@ -244,4 +254,12 @@ public class StorageManager {
|
|||
reportActivityModel.add(new ReportActivityModel());
|
||||
}
|
||||
|
||||
public void clearInjuryRecordModule() {
|
||||
if (injuryRecordModel != null) {
|
||||
injuryRecordModel.clear();
|
||||
}
|
||||
|
||||
injuryRecordModel.add(new InjuryRecordModel());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel;
|
|||
|
||||
import com.utopiaindustries.hseobservationsapp.apiservice.ApiService;
|
||||
import com.utopiaindustries.hseobservationsapp.apiservice.ApiServiceFactory;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.EmployeeInfoResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseSaveResponse;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.HSERequestModel;
|
||||
|
@ -15,9 +16,11 @@ import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportReq
|
|||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.http.PUT;
|
||||
|
||||
public class LoginViewModel extends ViewModel {
|
||||
|
||||
private MutableLiveData<EmployeeInfoResponse> employeeLiveData;
|
||||
private MutableLiveData<HseResponse> userLiveData;
|
||||
private MutableLiveData<HseSaveResponse> userSaveLiveData;
|
||||
private MutableLiveData<Boolean> userLoginLiveData;
|
||||
|
@ -28,12 +31,18 @@ public class LoginViewModel extends ViewModel {
|
|||
public LoginViewModel() {
|
||||
apiService = ApiServiceFactory.getApiService();
|
||||
userLiveData = new MutableLiveData<>();
|
||||
employeeLiveData = new MutableLiveData<>();
|
||||
userSaveLiveData = new MutableLiveData<>();
|
||||
userLoginLiveData = new MutableLiveData<>();
|
||||
errorLiveData = new MutableLiveData<>();
|
||||
isLoading = new MutableLiveData<>();
|
||||
}
|
||||
|
||||
public LiveData<EmployeeInfoResponse> getEmployeeLiveData()
|
||||
{
|
||||
return employeeLiveData;
|
||||
}
|
||||
|
||||
public LiveData<HseResponse> getUserLiveData() {
|
||||
return userLiveData;
|
||||
}
|
||||
|
@ -75,6 +84,29 @@ public class LoginViewModel extends ViewModel {
|
|||
});
|
||||
}
|
||||
|
||||
public void getEmployeeData(String empId) {
|
||||
isLoading.setValue(true);
|
||||
apiService.getEmployeeData(empId).enqueue(new Callback<EmployeeInfoResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<EmployeeInfoResponse> call, Response<EmployeeInfoResponse> response) {
|
||||
isLoading.setValue(false);
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
//Log.e("onResponse: ", "Successful");
|
||||
employeeLiveData.setValue(response.body());
|
||||
} else {
|
||||
errorLiveData.setValue(response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<EmployeeInfoResponse> call, Throwable t) {
|
||||
//Log.e("onResponse: ", "Fail");
|
||||
isLoading.setValue(false);
|
||||
errorLiveData.setValue(t.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void getHSEData() {
|
||||
isLoading.setValue(true);
|
||||
apiService.getHseData().enqueue(new Callback<HseResponse>() {
|
||||
|
|
|
@ -56,6 +56,52 @@
|
|||
android:padding="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee ID Number *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="1"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_employee_id_number"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.5"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Employees ID Number"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="number"
|
||||
android:padding="13dp"
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_fetch"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:textSize="@dimen/_12sdp"
|
||||
android:text="Fetch Emp Data"
|
||||
android:textColor="@color/white"
|
||||
android:background="@drawable/rounded_btn_login" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_description"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -63,7 +109,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee Name *"
|
||||
android:text="Employee Name "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -79,8 +125,9 @@
|
|||
android:hint="No Of Employees"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:enabled="false"
|
||||
android:padding="13dp"
|
||||
android:textSize="15sp" />
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -88,12 +135,27 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee Type *"
|
||||
android:text="Employee Type "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
<EditText
|
||||
android:id="@+id/et_employee_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Employee Type"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:enabled="false"
|
||||
android:padding="13dp"
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<!--<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/safety_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -106,12 +168,12 @@
|
|||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/safety_textview"
|
||||
android:id="@+id/employee_type_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>-->
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -119,32 +181,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee ID Number *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_employee_id_number"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Employees ID Number"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:padding="13dp"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Designation of the Employee *"
|
||||
android:text="Designation of the Employee "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -160,8 +197,9 @@
|
|||
android:hint="Employee Designation"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:enabled="false"
|
||||
android:padding="13dp"
|
||||
android:textSize="15sp" />
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
@ -169,66 +207,51 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Date Of Joining *"
|
||||
android:text="Date Of Joining "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="left"
|
||||
android:hint="yyyy-MM-dd"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_calendar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:src="@drawable/icon_calendar" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee Tenure(Months) *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/tenure_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
<EditText
|
||||
android:id="@+id/et_date"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:hint="@string/select_employee_tenure"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Employee Designation"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:enabled="false"
|
||||
android:padding="13dp"
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/tenure_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee Tenure(Months) "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_employee_tenure"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Employee Tenure"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:enabled="false"
|
||||
android:padding="13dp"
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Injury Form First"
|
||||
android:text="Injury Form Third"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_15sdp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/toolbar"
|
||||
|
@ -57,40 +57,39 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Severity *"
|
||||
android:text="Description *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/severity_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_department"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/department_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:gravity="top|start"
|
||||
android:hint="Write Description Here"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textMultiLine"
|
||||
android:lines="5"
|
||||
android:maxLines="5"
|
||||
android:minLines="5"
|
||||
android:padding="10dp"
|
||||
android:textSize="@dimen/_12sdp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ptw_heading"
|
||||
|
@ -138,30 +137,7 @@
|
|||
android:paddingBottom="10dp"
|
||||
android:scrollbars="horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Description *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:hint="Description"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:padding="13dp"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
@ -172,7 +148,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/rounded_btn_login"
|
||||
android:text="Next"
|
||||
android:text="Submit"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:layout_editor_absoluteX="5dp" />
|
||||
|
|
|
@ -45,6 +45,15 @@
|
|||
android:id="@+id/scrollView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:scrollbarFadeDuration="0"
|
||||
android:scrollbarThumbVertical="@android:color/darker_gray"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btn_next"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@ -53,8 +62,8 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:padding="5dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_description"
|
||||
|
@ -63,7 +72,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="KPI *"
|
||||
android:text="KPI "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -94,118 +103,172 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Type Of Injury *"
|
||||
android:text="Type Of Incident "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/injury_input"
|
||||
android:id="@+id/incident_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_injury"
|
||||
android:hint="@string/select_incident"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/injury_textview"
|
||||
android:id="@+id/incident_type_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_accident"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_illness"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Type of Personal illness "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/personal_illness_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_illness_type"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/personal_illness_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_injury"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Type of Injury "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/injury_type_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_injury"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/injury_type_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_body_parts"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Body Parts "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/body_part_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_body_part"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/body_part_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Type Of Injury *"
|
||||
android:text="Risk Type "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/injury_type_input"
|
||||
android:id="@+id/risk_type_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_injury"
|
||||
android:hint="@string/select_risk_type"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/injury_type_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Parts Of Body *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/body_parts_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_body_parts"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/body_parts_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Department Name *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/department_input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_department"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/department_textview"
|
||||
android:id="@+id/risk_type_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
android:id="@+id/scrollView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btn_next"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar">
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
<string name="select_floors">Select Floor</string>
|
||||
|
||||
<string name="select_department">Select Department</string>
|
||||
<string name="select_risk_type">Select Risk Type</string>
|
||||
<string name="select_illness_type">Select Type</string>
|
||||
|
||||
<string name="select_risk">Select Risk Level</string>
|
||||
<string name="select_location">Select Location</string>
|
||||
|
@ -32,12 +34,16 @@
|
|||
|
||||
<string name="select_kpi">Select KPI</string>
|
||||
<string name="select_injury">Select Injury Type</string>
|
||||
<string name="select_incident">Select Incident Type</string>
|
||||
<string name="select_body_part">Select Body Part</string>
|
||||
|
||||
<string name="select_body_parts">Select Body parts</string>
|
||||
<string name="select_action">Select Action</string>
|
||||
<string name="select_status">Select Status</string>
|
||||
<string name="select_activities">Select Activities</string>
|
||||
|
||||
<string name="select_accident_type">Select Accident Type</string>
|
||||
|
||||
<string name="rationale_camera">This app require permission for camera.</string>
|
||||
<string name="rationale_gallery">This app require permission for accessing gallery.</string>
|
||||
</resources>
|
Loading…
Reference in New Issue