Finalize all module testing
parent
8e5b35e344
commit
b231c15c59
|
@ -119,10 +119,11 @@ public class DashboardActivity extends AppCompatActivity {
|
|||
Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), false);
|
||||
Preference.setMyStringPref(Helper.project_file, Helper.firstTimeApiCall, getApplicationContext(), "false");
|
||||
|
||||
finish();
|
||||
Intent i = new Intent(DashboardActivity.this, LoginActivity.class);
|
||||
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(i);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public class HseOneActivity extends AppCompatActivity {
|
|||
if (isValidate()) {
|
||||
Intent intent = new Intent(HseOneActivity.this, HseTwoActivity.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -153,8 +154,6 @@ public class HseOneActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(HseOneActivity.this);
|
||||
}
|
||||
|
|
|
@ -16,16 +16,11 @@ 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;
|
||||
|
@ -48,13 +43,13 @@ 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.ObservationForms.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
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.ReportActivityModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
|
@ -85,8 +80,8 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
String paperFilePath = "no_pic";
|
||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
|
||||
private static final int CAMERA_REQUEST_PAPER = 1011;
|
||||
private static final int GALLERY_REQUEST = 2011;
|
||||
private static final int CAMERA_REQUEST_PAPER = 10112;
|
||||
private static final int GALLERY_REQUEST = 20112;
|
||||
|
||||
ImageView imgUpload;
|
||||
|
||||
|
@ -254,17 +249,25 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
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();
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
StorageManager.getInstance().clearHseTrainingModule();
|
||||
Intent intent = new Intent(HseTwoActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -295,7 +298,7 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
HseReportRequest<HseTrainingModel> hseTrainingRequest = new HseReportRequest<>();
|
||||
hseTrainingRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
hseTrainingRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
hseTrainingRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
hseTrainingRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
hseTrainingRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -303,11 +306,12 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
hseTrainingRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
hseTrainingRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
hseTrainingRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
hseTrainingRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, HseTwoActivity.this));
|
||||
hseTrainingRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(hseTrainingRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
|
||||
|
@ -477,7 +481,7 @@ public class HseTwoActivity extends AppCompatActivity implements EasyPermissions
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
|
|
@ -36,12 +36,12 @@ public class InjuryFormFour extends AppCompatActivity {
|
|||
btnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(InjuryFormFour.this,"Reported Submitted",Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(InjuryFormFour.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@ public class InjuryFormOne extends AppCompatActivity {
|
|||
StorageManager.getInstance().getInjuryRecordModel().get(0).setWorkerId(Integer.parseInt(etEmpId.getText().toString()));
|
||||
Intent intent = new Intent(InjuryFormOne.this, InjuryFormTwo.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -171,6 +172,7 @@ public class InjuryFormOne extends AppCompatActivity {
|
|||
layoutEmployeeInfo.setVisibility(View.VISIBLE);
|
||||
layoutDailyWageInfo.setVisibility(View.GONE);
|
||||
workerType = "Employee";
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setWorkerType("Employee/Contractor-Worker");
|
||||
|
||||
txtEmployeeHeading = findViewById(R.id.txt_employee_heading);
|
||||
|
||||
|
@ -203,7 +205,11 @@ public class InjuryFormOne extends AppCompatActivity {
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getEmployeeLiveData().observe(this, employeeInfoResponse -> {
|
||||
|
@ -233,8 +239,6 @@ public class InjuryFormOne extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(InjuryFormOne.this);
|
||||
}
|
||||
|
|
|
@ -48,12 +48,13 @@ 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.ObservationForms.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
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;
|
||||
|
||||
|
@ -80,8 +81,8 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
private static final int CAMERA_REQUEST_PAPER = 1010;
|
||||
private static final int GALLERY_REQUEST = 2010;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnNext;
|
||||
EditText etDescription;
|
||||
|
@ -261,7 +262,7 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
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.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
hseTrainingRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
hseTrainingRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -269,6 +270,7 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
hseTrainingRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
hseTrainingRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
hseTrainingRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
hseTrainingRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, InjuryFormThree.this));
|
||||
hseTrainingRequest.setReportData(reportList);
|
||||
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
|
@ -317,17 +319,25 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
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();
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
StorageManager.getInstance().clearInjuryRecordModule();
|
||||
Intent intent = new Intent(InjuryFormThree.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -344,7 +354,7 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.widget.Button;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.EdgeToEdge;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
@ -45,6 +46,7 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
private AutoCompleteTextView kpiTextview, incidentTypeTextview,
|
||||
injuryTypeTextview, personalIllnessTextview, bodyPartTextview, riskTypeTextview ;
|
||||
String kpi = "";
|
||||
String incidentType = "";
|
||||
private ShiftAdapter shiftAdapter;
|
||||
|
||||
private KpiAdapter kpiAdapter;
|
||||
|
@ -117,9 +119,18 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
HseIncidentType clickedItem = incidentTypeArrayList.get(position);
|
||||
incidentType = clickedItem.getTitle();
|
||||
int selectedId = clickedItem.getId();
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentId(selectedId);
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setIncidentName(clickedItem.getTitle());
|
||||
|
||||
//clear old values
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryId(0);
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryName("");
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryTypeId(0);
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setInjuryTypeName("");
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setBodyPartId(0);
|
||||
StorageManager.getInstance().getInjuryRecordModel().get(0).setBodyPartName("");
|
||||
//Near Miss = 1, Property Damage = 2, Fire = 5, RTA = 6
|
||||
//Personal Illness = 4
|
||||
//Accident = 3
|
||||
|
@ -202,8 +213,12 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(InjuryFormTwo.this, InjuryFormThree.class);
|
||||
startActivity(intent);
|
||||
if (isValidate()) {
|
||||
Intent intent = new Intent(InjuryFormTwo.this, InjuryFormThree.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -273,12 +288,6 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
riskTypeTextview.setAdapter(riskTypeAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
@ -288,9 +297,32 @@ public class InjuryFormTwo extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
if (incidentType.isEmpty()) {
|
||||
message = "Please select incident type.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (kpi.isEmpty()) {
|
||||
message = "Please select KPI.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
private void showPersistData() {
|
||||
kpiTextview.post(() -> kpiTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getKpiName(), false));
|
||||
kpi = StorageManager.getInstance().getInjuryRecordModel().get(0).getKpiName();
|
||||
incidentTypeTextview.post(() -> incidentTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName(), false));
|
||||
incidentType = StorageManager.getInstance().getInjuryRecordModel().get(0).getIncidentName();
|
||||
personalIllnessTextview.post(() -> personalIllnessTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryName(), false));
|
||||
injuryTypeTextview.post(() -> injuryTypeTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getInjuryTypeName(), false));
|
||||
bodyPartTextview.post(() -> bodyPartTextview.setText(StorageManager.getInstance().getInjuryRecordModel().get(0).getBodyPartName(), false));
|
||||
|
|
|
@ -61,12 +61,12 @@ public class ObservationNearMissActivity extends AppCompatActivity {
|
|||
/* if (isValidate()) {
|
||||
|
||||
}*/
|
||||
Toast.makeText(ObservationNearMissActivity.this,"Reported Submitted",Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(ObservationNearMissActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// 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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -300,10 +300,12 @@ public class ObservationOneActivity extends AppCompatActivity implements EasyPer
|
|||
if (observationClass.equalsIgnoreCase("Near Miss")) {
|
||||
Intent intent = new Intent(ObservationOneActivity.this, ObservationNearMissActivity.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
else {
|
||||
Intent intent = new Intent(ObservationOneActivity.this, ObservationTwoActivity.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -353,8 +355,6 @@ public class ObservationOneActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(ObservationOneActivity.this);
|
||||
}
|
||||
|
@ -433,7 +433,7 @@ public class ObservationOneActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
|
|
@ -1,19 +1,10 @@
|
|||
package com.utopiaindustries.hseobservationsapp.activities.ObservationForms;
|
||||
|
||||
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.drawable.ColorDrawable;
|
||||
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;
|
||||
|
@ -33,48 +24,26 @@ 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.lifecycle.ViewModelProvider;
|
||||
|
||||
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.adapters.DepartmentAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.RiskLevelAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseDepartment;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.ObservationModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
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 ObservationTwoActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -197,17 +166,25 @@ public class ObservationTwoActivity extends AppCompatActivity {
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
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();
|
||||
Log.e("Response: ",""+hseSaveResponse);
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
Intent intent = new Intent(ObservationTwoActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -238,7 +215,7 @@ public class ObservationTwoActivity extends AppCompatActivity {
|
|||
HseReportRequest<ObservationModel> observationRequest = new HseReportRequest<>();
|
||||
observationRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
observationRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
observationRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
observationRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
observationRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
observationRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
observationRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -246,6 +223,7 @@ public class ObservationTwoActivity extends AppCompatActivity {
|
|||
observationRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
observationRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
observationRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
observationRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, ObservationTwoActivity.this));
|
||||
observationRequest.setReportData(observationList);
|
||||
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
|
|
|
@ -31,10 +31,11 @@ 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.utils.HSERequestModel;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.ObservationForms.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.ObservationModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.ReportActivityModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
@ -135,18 +136,25 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
StorageManager.getInstance().clearOtherActivityModule();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(OtherHseActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -198,7 +206,7 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
HseReportRequest<ReportActivityModel> reportRequest = new HseReportRequest<>();
|
||||
reportRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
reportRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
reportRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -206,11 +214,12 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, OtherHseActivity.this));
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(reportRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(reportRequest);
|
||||
|
||||
|
|
|
@ -97,6 +97,7 @@ public class PermitOneActivity extends AppCompatActivity {
|
|||
if (isValidate()) {
|
||||
Intent intent = new Intent(PermitOneActivity.this, PermitTwoActivity.class);
|
||||
startActivity(intent);
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -147,8 +148,6 @@ public class PermitOneActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
StorageManager.getInstance().clearObservationModule();
|
||||
super.onBackPressed();
|
||||
|
||||
alertExit(PermitOneActivity.this);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,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.ObservationForms.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.PermitToWorkModel;
|
||||
|
@ -80,8 +83,8 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
private static final int CAMERA_REQUEST_PAPER = 1011;
|
||||
private static final int GALLERY_REQUEST = 2011;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnSubmit;
|
||||
EditText etDescription;
|
||||
|
@ -277,7 +280,7 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
HseReportRequest<PermitToWorkModel> hseTrainingRequest = new HseReportRequest<>();
|
||||
hseTrainingRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
hseTrainingRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
hseTrainingRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
hseTrainingRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
hseTrainingRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
hseTrainingRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -285,11 +288,12 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
hseTrainingRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
hseTrainingRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
hseTrainingRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
hseTrainingRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, PermitTwoActivity.this));
|
||||
hseTrainingRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(hseTrainingRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(hseTrainingRequest);
|
||||
|
||||
|
@ -318,7 +322,7 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
@ -399,18 +403,25 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
StorageManager.getInstance().clearPermitToWorkModule();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(PermitTwoActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -50,9 +50,11 @@ 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.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.HseActivitiesAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
|
@ -83,8 +85,8 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
private static final int CAMERA_REQUEST_PAPER = 1012;
|
||||
private static final int GALLERY_REQUEST = 2012;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnSubmit;
|
||||
private AutoCompleteTextView activitiesTextview;
|
||||
|
@ -286,7 +288,7 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
HseReportRequest<ReportActivityModel> reportRequest = new HseReportRequest<>();
|
||||
reportRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
reportRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
reportRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -294,11 +296,12 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, ProgressiveActivity.this));
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(reportRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(reportRequest);
|
||||
|
||||
|
@ -351,18 +354,25 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getUserSaveLiveData().observe(this, hseSaveResponse -> {
|
||||
if (hseSaveResponse != null && hseSaveResponse.getStatus().equals("success")) {
|
||||
StorageManager.getInstance().getReportActivityModel().clear();
|
||||
Toast.makeText(this, "Reported Submitted", Toast.LENGTH_SHORT).show();
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
StorageManager.getInstance().clearProgressiveActivityModule();
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(ProgressiveActivity.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// 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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -375,7 +385,7 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
|
|
@ -50,9 +50,11 @@ 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.ObservationTwoActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.HseActivitiesAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.adapters.PTWImageAdapter;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
|
@ -83,8 +85,8 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
private static final int CAMERA_REQUEST_PAPER = 1013;
|
||||
private static final int GALLERY_REQUEST = 2013;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnSubmit;
|
||||
EditText etDescription;
|
||||
|
@ -286,18 +288,25 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
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();
|
||||
Log.e("Response: ",""+hseSaveResponse.toString());
|
||||
if (hseSaveResponse != null && hseSaveResponse.getResult().equalsIgnoreCase("success")) {
|
||||
Toast.makeText(this, "Report Submitted Successfully", Toast.LENGTH_SHORT).show();
|
||||
StorageManager.getInstance().clearReportActivityModule();
|
||||
Intent intent = new Intent(WeeklyFormOne.this, DashboardActivity.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
//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);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -310,7 +319,7 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_image, viewGroup, false);
|
||||
builder.setCancelable(false);
|
||||
builder.setCancelable(true);
|
||||
builder.setView(view1);
|
||||
|
||||
dialogCameraBtn = view1.findViewById(R.id.dialog_camera_btn);
|
||||
|
@ -672,7 +681,7 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
HseReportRequest<ReportActivityModel> reportRequest = new HseReportRequest<>();
|
||||
reportRequest.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
reportRequest.setUserId(StorageManager.getInstance().getUserId());
|
||||
reportRequest.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSiteId(StorageManager.getInstance().getSite_id());
|
||||
reportRequest.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
reportRequest.setSupervisorName(StorageManager.getInstance().getSupervisorName());
|
||||
reportRequest.setShift(StorageManager.getInstance().getShift());
|
||||
|
@ -680,11 +689,12 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
reportRequest.setBuildingId(StorageManager.getInstance().getBuildingId());
|
||||
reportRequest.setFloorId(StorageManager.getInstance().getFloorId());
|
||||
reportRequest.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
reportRequest.setCreatedBy(Preference.getMyStringPref(Helper.project_file, Helper.logInUser, WeeklyFormOne.this));
|
||||
reportRequest.setReportData(reportList);
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
/*Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(reportRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
Log.e("RequestModel JSON", jsonRequest);*/
|
||||
|
||||
loginViewModel.saveHSEData(reportRequest);
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ public class RetrofitClient {
|
|||
try {
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient.Builder()
|
||||
.connectTimeout(40, TimeUnit.SECONDS)
|
||||
.readTimeout(40, TimeUnit.SECONDS)
|
||||
.writeTimeout(40, TimeUnit.SECONDS)
|
||||
.connectTimeout(60, TimeUnit.SECONDS)
|
||||
.readTimeout(60, TimeUnit.SECONDS)
|
||||
.writeTimeout(60, TimeUnit.SECONDS)
|
||||
.build();
|
||||
|
||||
retrofit = new Retrofit.Builder()
|
||||
|
|
|
@ -319,7 +319,11 @@ public class HomeFragment extends Fragment {
|
|||
});
|
||||
|
||||
loginViewModel.getErrorMessage().observe(getActivity(), errorResponse -> {
|
||||
Toast.makeText(getActivity(), errorResponse, Toast.LENGTH_SHORT).show();
|
||||
if (errorResponse.isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
Toast.makeText(getActivity(), errorResponse, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
loginViewModel.getUserLiveData().observe(getActivity(), qcResponse -> {
|
||||
|
|
|
@ -6,16 +6,34 @@ import com.google.gson.annotations.SerializedName;
|
|||
|
||||
public class HseSaveResponse {
|
||||
|
||||
@SerializedName("status")
|
||||
@SerializedName("result")
|
||||
@Expose
|
||||
private String status;
|
||||
private String result;
|
||||
@SerializedName("code")
|
||||
@Expose
|
||||
private String code;
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HseSaveResponse{" +
|
||||
"result='" + result + '\'' +
|
||||
", code='" + code + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ public class HseReportRequest<T> {
|
|||
|
||||
private String observation_date;
|
||||
private int userId;
|
||||
private int site_id;
|
||||
private int siteId;
|
||||
private int supervisorId;
|
||||
private String supervisorName;
|
||||
private String shift;
|
||||
|
@ -15,6 +15,7 @@ public class HseReportRequest<T> {
|
|||
private int departmentId;
|
||||
private int buildingId;
|
||||
private int floorId;
|
||||
private String createdBy;
|
||||
|
||||
private List<T> hseReportRecord;
|
||||
|
||||
|
@ -34,12 +35,12 @@ public class HseReportRequest<T> {
|
|||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getSite_id() {
|
||||
return site_id;
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSite_id(int site_id) {
|
||||
this.site_id = site_id;
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getSupervisorId() {
|
||||
|
@ -110,10 +111,18 @@ public class HseReportRequest<T> {
|
|||
this.floorId = floorId;
|
||||
}
|
||||
|
||||
public HseReportRequest(String observation_date, int userId, int site_id, int supervisorId, String supervisorName, String shift, int recordTypeId, int departmentId, int buildingId, int floorId, List<T> reportData) {
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public HseReportRequest(String observation_date, int userId, int site_id, int supervisorId, String supervisorName, String shift, int recordTypeId, int departmentId, int buildingId, int floorId, String createdBy, List<T> reportData) {
|
||||
this.observation_date = observation_date;
|
||||
this.userId = userId;
|
||||
this.site_id = site_id;
|
||||
this.siteId = site_id;
|
||||
this.supervisorId = supervisorId;
|
||||
this.supervisorName = supervisorName;
|
||||
this.shift = shift;
|
||||
|
@ -121,6 +130,7 @@ public class HseReportRequest<T> {
|
|||
this.departmentId = departmentId;
|
||||
this.buildingId = buildingId;
|
||||
this.floorId = floorId;
|
||||
this.createdBy = createdBy;
|
||||
this.hseReportRecord = reportData;
|
||||
}
|
||||
}
|
|
@ -16,6 +16,9 @@ import com.utopiaindustries.hseobservationsapp.models.HseData.HseSaveResponse;
|
|||
import com.utopiaindustries.hseobservationsapp.utils.HSERequestModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.HseReportRequest;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
@ -31,6 +34,7 @@ public class LoginViewModel extends ViewModel {
|
|||
private MutableLiveData<String> errorLiveData;
|
||||
private MutableLiveData<Boolean> isLoading;
|
||||
private ApiService apiService;
|
||||
private final ExecutorService executorService;
|
||||
|
||||
public LoginViewModel() {
|
||||
apiService = ApiServiceFactory.getApiService();
|
||||
|
@ -41,6 +45,7 @@ public class LoginViewModel extends ViewModel {
|
|||
userLoginLiveData = new MutableLiveData<>();
|
||||
errorLiveData = new MutableLiveData<>();
|
||||
isLoading = new MutableLiveData<>();
|
||||
this.executorService = Executors.newFixedThreadPool(4);
|
||||
}
|
||||
|
||||
public LiveData<EmployeeInfoResponse> getEmployeeLiveData()
|
||||
|
@ -166,25 +171,38 @@ public class LoginViewModel extends ViewModel {
|
|||
|
||||
public void saveHSEData(HseReportRequest hseRequestModel) {
|
||||
isLoading.setValue(true);
|
||||
apiService.saveHseReport(hseRequestModel).enqueue(new Callback<HseSaveResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<HseSaveResponse> call, Response<HseSaveResponse> response) {
|
||||
isLoading.setValue(false);
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
//Log.e("onResponse: ", "Successful");
|
||||
userSaveLiveData.setValue(response.body());
|
||||
} else {
|
||||
errorLiveData.setValue(response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<HseSaveResponse> call, Throwable t) {
|
||||
//Log.e("onResponse: ", "Fail");
|
||||
isLoading.setValue(false);
|
||||
errorLiveData.setValue(t.getMessage());
|
||||
// Execute the task in the background
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
apiService.saveHseReport(hseRequestModel).enqueue(new Callback<HseSaveResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<HseSaveResponse> call, Response<HseSaveResponse> response) {
|
||||
isLoading.setValue(false);
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
//Log.e("onResponse: ", "Successful");
|
||||
userSaveLiveData.setValue(response.body());
|
||||
} else {
|
||||
errorLiveData.setValue(response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<HseSaveResponse> call, Throwable t) {
|
||||
Log.e("onResponse: ", "Fail "+t.getMessage());
|
||||
isLoading.setValue(false);
|
||||
errorLiveData.setValue(t.getMessage());
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
errorLiveData.postValue(e.getMessage());
|
||||
}
|
||||
finally {
|
||||
// Hide the loading spinner
|
||||
isLoading.postValue(false);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public LiveData<Boolean> getLoginUser() {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.DashboardActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.HSETrainingForms.HseOneActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.HSETrainingForms.HseTwoActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.InjuryRecordForms.InjuryFormFour">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.InjuryRecordForms.InjuryFormOne">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -91,7 +92,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Employee ID Number *"
|
||||
android:text="ID Number *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.InjuryRecordForms.InjuryFormThree">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.InjuryRecordForms.InjuryFormTwo">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -72,7 +73,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" />
|
||||
|
@ -103,7 +104,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Type Of Incident "
|
||||
android:text="Type Of Incident *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.LoginActivity">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.ObservationForms.ObservationNearMissActivity">
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.ObservationForms.ObservationOneActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.ObservationForms.ObservationThreeActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.ObservationForms.ObservationTwoActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.OtherHSEActivityForms.OtherHseActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.PermitToWorkForms.PermitOneActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.PermitToWorkForms.PermitTwoActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -59,6 +60,37 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
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_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">
|
||||
|
@ -100,36 +132,6 @@
|
|||
android:paddingBottom="10dp"
|
||||
android:scrollbars="horizontal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
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_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" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.ProgressiveActivityForms.ProgressiveActivity">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -45,7 +46,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">
|
||||
|
@ -88,6 +88,38 @@
|
|||
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="Description"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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">
|
||||
|
@ -130,38 +162,6 @@
|
|||
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"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
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" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.SplashActivity">
|
||||
|
||||
<ImageView
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".activities.WeeklyActivityForms.WeeklyFormOne">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
|
@ -87,6 +88,38 @@
|
|||
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="Description *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
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">
|
||||
|
@ -129,38 +162,6 @@
|
|||
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"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
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" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".fragments.DraftFragment">
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".fragments.HomeFragment">
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:background="@color/white"
|
||||
android:padding="12dp">
|
||||
|
||||
<CheckBox
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="Theme.HSEObservationsApp" parent="Base.Theme.HSEObservationsApp" />
|
||||
|
|
Loading…
Reference in New Issue