Weekly Activity, Progressive Activity, Other Activity modules working
parent
05f5b337f1
commit
7c8cb2380c
|
@ -63,7 +63,7 @@ public class HseOneActivity extends AppCompatActivity implements EasyPermissions
|
|||
RecyclerView trainingPicRecyclerView;
|
||||
PTWImageAdapter imagePaperAdapter;
|
||||
String paperFilePath = "no_pic";
|
||||
ArrayList<DocumentTypeImageModel> PaperImageList = new ArrayList<>();
|
||||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
|
@ -84,16 +84,16 @@ public class HseOneActivity extends AppCompatActivity implements EasyPermissions
|
|||
compressedImage -> {
|
||||
// Handle the compressed image here, e.g., display it
|
||||
runOnUiThread(() -> {
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
compressedImage
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(compressedImage);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
});
|
||||
},
|
||||
|
@ -132,16 +132,16 @@ public class HseOneActivity extends AppCompatActivity implements EasyPermissions
|
|||
imageBytes -> {
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
imageBytes
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(imageBytes);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
|
||||
});
|
||||
|
|
|
@ -63,7 +63,7 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
RecyclerView picturesRecyclerView;
|
||||
PTWImageAdapter imagePaperAdapter;
|
||||
String paperFilePath = "no_pic";
|
||||
ArrayList<DocumentTypeImageModel> PaperImageList = new ArrayList<>();
|
||||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
|
@ -84,16 +84,16 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
compressedImage -> {
|
||||
// Handle the compressed image here, e.g., display it
|
||||
runOnUiThread(() -> {
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
compressedImage
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(compressedImage);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
});
|
||||
},
|
||||
|
@ -132,16 +132,16 @@ public class InjuryFormThree extends AppCompatActivity implements EasyPermission
|
|||
imageBytes -> {
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
imageBytes
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(imageBytes);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ import com.utopiaindustries.hseobservationsapp.adapters.ObservationSubClassAdapt
|
|||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationSubClass;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ObservationStorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -69,7 +69,7 @@ public class ObservationOneActivity extends AppCompatActivity {
|
|||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (isValidate()) {
|
||||
if (isValidate()) {
|
||||
if (observationClass.equalsIgnoreCase("Near Miss")) {
|
||||
Intent intent = new Intent(ObservationOneActivity.this, ObservationNearMissActivity.class);
|
||||
startActivity(intent);
|
||||
|
@ -79,7 +79,7 @@ public class ObservationOneActivity extends AppCompatActivity {
|
|||
startActivity(intent);
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class ObservationOneActivity extends AppCompatActivity {
|
|||
observationClass = obClassArrayList.get(position).getTitle();
|
||||
HseObservationClass clickedItem = obClassArrayList.get(position);
|
||||
|
||||
ObservationStorageManager.getInstance().setObservationClassId(clickedItem.getId());
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setObservationClassId(clickedItem.getId());
|
||||
|
||||
observationSubTextview.setText(null);
|
||||
|
||||
|
@ -116,7 +116,7 @@ public class ObservationOneActivity extends AppCompatActivity {
|
|||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// Perform action when shiftTextview item is clicked
|
||||
//Toast.makeText(ObservationOneActivity.this, "Item clicked: " + obSubClassArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
ObservationStorageManager.getInstance().setObservationSubClassId(obSubClassArrayList.get(position).getId());
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setObservationSubClassId(obSubClassArrayList.get(position).getId());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,11 +5,16 @@ import android.content.Intent;
|
|||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
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.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
|
@ -27,22 +32,14 @@ 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.LoginActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Helper;
|
||||
import com.utopiaindustries.hseobservationsapp.helper.Preference;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.HSERequestModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ObservationStorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Map;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
|
||||
public class ObservationThreeActivity extends AppCompatActivity {
|
||||
|
@ -50,6 +47,7 @@ public class ObservationThreeActivity extends AppCompatActivity {
|
|||
RadioGroup rg1;
|
||||
ImageView imgBack;
|
||||
Button btnSubmit, btnDraft;
|
||||
EditText etDescription;
|
||||
|
||||
LoginViewModel loginViewModel;
|
||||
|
||||
|
@ -73,13 +71,30 @@ public class ObservationThreeActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
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().getObservationsModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
rg1.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
|
||||
{
|
||||
public void onCheckedChanged(RadioGroup group, int checkedId) {
|
||||
if (checkedId == R.id.rb_open) {
|
||||
ObservationStorageManager.getInstance().setObservationStatus(true);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setObservationStatus(true);
|
||||
} else if (checkedId == R.id.rb_closed) {
|
||||
ObservationStorageManager.getInstance().setObservationStatus(false);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setObservationStatus(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -110,6 +125,9 @@ public class ObservationThreeActivity extends AppCompatActivity {
|
|||
|
||||
rg1 = findViewById(R.id.rg1);
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
etDescription = findViewById(R.id.et_description);
|
||||
etDescription.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
etDescription.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
btnSubmit = findViewById(R.id.btn_submit);
|
||||
btnDraft = findViewById(R.id.btn_draft);
|
||||
|
@ -164,19 +182,19 @@ public class ObservationThreeActivity extends AppCompatActivity {
|
|||
alertDialog.dismiss();
|
||||
|
||||
// byte[] reportBytes = convertReportToByteArray();
|
||||
HSERequestModel requestModel = new HSERequestModel();
|
||||
requestModel.setSite_id(ObservationStorageManager.getInstance().getSiteId());
|
||||
requestModel.setSupervisorId(ObservationStorageManager.getInstance().getSupervisorId());
|
||||
requestModel.setObservation_date(ObservationStorageManager.getInstance().getReportDate());
|
||||
requestModel.setShift(ObservationStorageManager.getInstance().getShiftName());
|
||||
requestModel.setRecordTypeId(ObservationStorageManager.getInstance().getRecordTypeId());
|
||||
requestModel.setHseReportObservationRecord(ObservationStorageManager.getInstance());
|
||||
/*HSERequestModel requestModel = new HSERequestModel();
|
||||
requestModel.setSite_id(StorageManager.getInstance().getSite_id());
|
||||
requestModel.setSupervisorId(StorageManager.getInstance().getSupervisorId());
|
||||
requestModel.setObservation_date(StorageManager.getInstance().getObservation_date());
|
||||
requestModel.setShift(StorageManager.getInstance().getShift());
|
||||
requestModel.setRecordTypeId(StorageManager.getInstance().getRecordTypeId());
|
||||
requestModel.setObservationModel(StorageManager.getInstance().getObservationsModel());*/
|
||||
|
||||
// gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
//String jsonRequest = gson.toJson(requestModel);
|
||||
// Log.e("RequestModel JSON", requestModel.toString());
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(StorageManager.getInstance());
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
|
||||
loginViewModel.saveHSEData(requestModel);
|
||||
//loginViewModel.saveHSEData(requestModel);
|
||||
|
||||
|
||||
}
|
||||
|
@ -200,7 +218,7 @@ public class ObservationThreeActivity extends AppCompatActivity {
|
|||
ByteArrayOutputStream byteArrayOutputStream = null;
|
||||
ObjectOutputStream objectOutputStream = null;
|
||||
try {
|
||||
ObservationStorageManager observationStorageManager = ObservationStorageManager.getInstance();
|
||||
StorageManager observationStorageManager = StorageManager.getInstance();
|
||||
// convert into byte array
|
||||
byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
objectOutputStream = new ObjectOutputStream( byteArrayOutputStream );
|
||||
|
|
|
@ -42,7 +42,7 @@ 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.utils.ObservationStorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -81,6 +81,8 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
String filePathBefore = "no_pic";
|
||||
String filePathAfter = "no_pic";
|
||||
String departmentName = "";
|
||||
String riskLevel = "";
|
||||
|
||||
String imgType = "";
|
||||
|
||||
|
@ -107,7 +109,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
List<byte[]> tempList = new ArrayList<>();
|
||||
tempList.add(compressedImage);
|
||||
ObservationStorageManager.getInstance().setBeforePictures(tempList);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setBeforePictures(tempList);
|
||||
});
|
||||
},
|
||||
error -> {
|
||||
|
@ -135,7 +137,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
List<byte[]> tempList = new ArrayList<>();
|
||||
tempList.add(compressedImage);
|
||||
ObservationStorageManager.getInstance().setAfterPictures(tempList);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setAfterPictures(tempList);
|
||||
});
|
||||
},
|
||||
error -> {
|
||||
|
@ -179,7 +181,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
List<byte[]> tempList = new ArrayList<>();
|
||||
tempList.add(compressedImage);
|
||||
ObservationStorageManager.getInstance().setBeforePictures(tempList);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setBeforePictures(tempList);
|
||||
});
|
||||
},
|
||||
error -> {
|
||||
|
@ -208,7 +210,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
|
||||
List<byte[]> tempList = new ArrayList<>();
|
||||
tempList.add(compressedImage);
|
||||
ObservationStorageManager.getInstance().setAfterPictures(tempList);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setAfterPictures(tempList);
|
||||
});
|
||||
},
|
||||
error -> {
|
||||
|
@ -251,8 +253,11 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(ObservationTwoActivity.this, ObservationThreeActivity.class);
|
||||
startActivity(intent);
|
||||
if (isValidate()) {
|
||||
Intent intent = new Intent(ObservationTwoActivity.this, ObservationThreeActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -276,6 +281,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
imgBefore.setImageResource(R.drawable.icon_image);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).getBeforePictures().clear();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -283,13 +289,15 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
imgAfter.setImageResource(R.drawable.icon_image);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).getAfterPictures().clear();
|
||||
}
|
||||
});
|
||||
|
||||
departmentTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
ObservationStorageManager.getInstance().setDepartmentId(departmentArrayList.get(position).getId());
|
||||
departmentName = departmentArrayList.get(position).getTitle();
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setDepartmentId(departmentArrayList.get(position).getId());
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -298,7 +306,8 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
ObservationStorageManager.getInstance().setRiskLevel(riskLevelArrayList.get(position));
|
||||
riskLevel = riskLevelArrayList.get(position);
|
||||
StorageManager.getInstance().getObservationsModel().get(0).setRiskLevel(riskLevelArrayList.get(position));
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -323,7 +332,7 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
if (!departmentArrayList_temp.isEmpty()) {
|
||||
|
||||
List<HseDepartment> filteredUnitItems = departmentArrayList_temp.stream()
|
||||
.filter(item -> Objects.equals(item.getSiteId(), ObservationStorageManager.getInstance().getSiteId()))
|
||||
.filter(item -> Objects.equals(item.getSiteId(), StorageManager.getInstance().getSite_id()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
departmentArrayList.clear();
|
||||
|
@ -563,4 +572,25 @@ public class ObservationTwoActivity extends AppCompatActivity implements EasyPer
|
|||
public void onRationaleDenied(int requestCode) {
|
||||
|
||||
}
|
||||
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
if (riskLevel.isEmpty()) {
|
||||
message = "Please select Risk level description.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (departmentName.isEmpty()) {
|
||||
message = "Please select Department.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
}
|
|
@ -1,23 +1,48 @@
|
|||
package com.utopiaindustries.hseobservationsapp.activities.OtherHSEActivityForms;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.os.Bundle;
|
||||
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;
|
||||
|
||||
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.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.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
public class OtherHseActivity extends AppCompatActivity {
|
||||
|
||||
Button btnSubmit;
|
||||
EditText etActivityName, etDescription;
|
||||
|
||||
LoginViewModel loginViewModel;
|
||||
ImageView imgBack;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -32,10 +57,85 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
|
||||
initializeLayouts();
|
||||
|
||||
imgBack.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
etActivityName.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().getReportActivityModel().get(0).setActivityName(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
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().getReportActivityModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
btnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(OtherHseActivity.this,"Reported Submitted",Toast.LENGTH_SHORT).show();
|
||||
if (isValidate()) {
|
||||
alertReportSubmit(OtherHseActivity.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
etActivityName = findViewById(R.id.et_activityName);
|
||||
etDescription = findViewById(R.id.et_description);
|
||||
etDescription.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
etDescription.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
btnSubmit = findViewById(R.id.btn_submit);
|
||||
|
||||
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(OtherHseActivity.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);
|
||||
|
@ -45,9 +145,84 @@ public class OtherHseActivity extends AppCompatActivity {
|
|||
});
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
btnSubmit = findViewById(R.id.btn_submit);
|
||||
if (etDescription.getText().toString().isEmpty()) {
|
||||
message = "Please enter description.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (etActivityName.getText().toString().isEmpty()) {
|
||||
message = "Please enter activity Name.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(StorageManager.getInstance());
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
|
||||
//loginViewModel.saveHSEData(requestModel);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
dialogCancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
//Toast.makeText(con, "Cancel", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
RecyclerView ptwRecyclerView;
|
||||
PTWImageAdapter imagePaperAdapter;
|
||||
String paperFilePath = "no_pic";
|
||||
ArrayList<DocumentTypeImageModel> PaperImageList = new ArrayList<>();
|
||||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
|
@ -88,16 +88,16 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
compressedImage -> {
|
||||
// Handle the compressed image here, e.g., display it
|
||||
runOnUiThread(() -> {
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
compressedImage
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(compressedImage);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
});
|
||||
},
|
||||
|
@ -136,16 +136,16 @@ public class PermitTwoActivity extends AppCompatActivity implements EasyPermissi
|
|||
imageBytes -> {
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
imageBytes
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(imageBytes);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
|
||||
});
|
||||
|
|
|
@ -16,10 +16,17 @@ 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.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -40,8 +47,13 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.utopiaindustries.hseobservationsapp.R;
|
||||
import com.utopiaindustries.hseobservationsapp.activities.DashboardActivity;
|
||||
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.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -63,13 +75,20 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
RecyclerView picturesRecyclerView;
|
||||
PTWImageAdapter imagePaperAdapter;
|
||||
String paperFilePath = "no_pic";
|
||||
ArrayList<DocumentTypeImageModel> PaperImageList = new ArrayList<>();
|
||||
ArrayList<byte[]> PaperImageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnSubmit;
|
||||
private AutoCompleteTextView activitiesTextview;
|
||||
|
||||
private HseActivitiesAdapter hseActivitiesAdapter;
|
||||
private ArrayList<HseActivity> hseActivityArrayList = new ArrayList<>();
|
||||
String activityName = "";
|
||||
EditText etDescription;
|
||||
LoginViewModel loginViewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -84,16 +103,16 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
compressedImage -> {
|
||||
// Handle the compressed image here, e.g., display it
|
||||
runOnUiThread(() -> {
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
compressedImage
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(compressedImage);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
});
|
||||
},
|
||||
|
@ -132,16 +151,16 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
imageBytes -> {
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
imageBytes
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
PaperImageList.add(imageBytes);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
|
||||
});
|
||||
|
@ -202,6 +221,33 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
activitiesTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// Perform action when shiftTextview item is clicked
|
||||
//Toast.makeText(ObservationOneActivity.this, "Item clicked: " + obSubClassArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
activityName = hseActivityArrayList.get(position).getTitle();
|
||||
StorageManager.getInstance().getProgressiveActivityModel().get(0).setActivityName(hseActivityArrayList.get(position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
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().getReportActivityModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeLayouts() {
|
||||
|
@ -209,9 +255,17 @@ public class ProgressiveActivity extends AppCompatActivity implements EasyPermis
|
|||
imgUpload = findViewById(R.id.img_upload);
|
||||
imgBack = findViewById(R.id.img_back);
|
||||
btnSubmit = findViewById(R.id.btn_submit);
|
||||
|
||||
activitiesTextview = findViewById(R.id.activities_textview);
|
||||
picturesRecyclerView = findViewById(R.id.picturesRecyclerView);
|
||||
|
||||
etDescription = findViewById(R.id.et_description);
|
||||
etDescription.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
etDescription.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
hseActivityArrayList.addAll(Helper.getList(Helper.hseActivities, this, HseActivity.class));
|
||||
hseActivitiesAdapter = new HseActivitiesAdapter(this, hseActivityArrayList);
|
||||
activitiesTextview.setAdapter(hseActivitiesAdapter);
|
||||
|
||||
imagePaperAdapter = new PTWImageAdapter(PaperImageList, this, "");
|
||||
picturesRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
picturesRecyclerView.setAdapter(imagePaperAdapter);
|
||||
|
|
|
@ -16,10 +16,18 @@ 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.AdapterView;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -34,16 +42,28 @@ 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.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.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -65,13 +85,20 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
RecyclerView picturesRecyclerView;
|
||||
PTWImageAdapter imagePaperAdapter;
|
||||
String paperFilePath = "no_pic";
|
||||
ArrayList<DocumentTypeImageModel> PaperImageList = new ArrayList<>();
|
||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
String docTypeId = "";
|
||||
String docTypeTitle = "";
|
||||
private static final int CAMERA_REQUEST_PAPER = 101;
|
||||
private static final int GALLERY_REQUEST = 201;
|
||||
ImageView imgUpload, imgBack;
|
||||
Button btnSubmit;
|
||||
EditText etDescription;
|
||||
LoginViewModel loginViewModel;
|
||||
private AutoCompleteTextView activitiesTextview;
|
||||
|
||||
private HseActivitiesAdapter hseActivitiesAdapter;
|
||||
private ArrayList<HseActivity> hseActivityArrayList = new ArrayList<>();
|
||||
String activityName = "";
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -86,16 +113,16 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
compressedImage -> {
|
||||
// Handle the compressed image here, e.g., display it
|
||||
runOnUiThread(() -> {
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
compressedImage
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
int position = imageList.size();
|
||||
imageList.add(compressedImage);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
});
|
||||
},
|
||||
|
@ -134,16 +161,16 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
imageBytes -> {
|
||||
this.runOnUiThread(() -> {
|
||||
|
||||
DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
/*DocumentTypeImageModel documentImage = new DocumentTypeImageModel(
|
||||
docTypeId,
|
||||
docTypeTitle,
|
||||
imageBytes
|
||||
);
|
||||
);*/
|
||||
|
||||
//Log.e("doc-image: ",""+ documentImage);
|
||||
|
||||
int position = PaperImageList.size();
|
||||
PaperImageList.add(documentImage);
|
||||
int position = imageList.size();
|
||||
imageList.add(imageBytes);
|
||||
imagePaperAdapter.notifyItemInserted(position);
|
||||
|
||||
});
|
||||
|
@ -192,15 +219,40 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
}
|
||||
});
|
||||
|
||||
activitiesTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// Perform action when shiftTextview item is clicked
|
||||
//Toast.makeText(ObservationOneActivity.this, "Item clicked: " + obSubClassArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
activityName = hseActivityArrayList.get(position).getTitle();
|
||||
StorageManager.getInstance().getReportActivityModel().get(0).setActivityName(hseActivityArrayList.get(position).getTitle());
|
||||
}
|
||||
});
|
||||
|
||||
btnSubmit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Toast.makeText(WeeklyFormOne.this,"Reported Submitted",Toast.LENGTH_SHORT).show();
|
||||
Intent intent = new Intent(WeeklyFormOne.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);
|
||||
if (isValidate()) {
|
||||
StorageManager.getInstance().getReportActivityModel().get(0).setPictures(imageList);
|
||||
alertReportSubmit(WeeklyFormOne.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().getReportActivityModel().get(0).setDescription(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -211,11 +263,47 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
imgBack = findViewById(R.id.img_back);
|
||||
btnSubmit = findViewById(R.id.btn_submit);
|
||||
|
||||
activitiesTextview = findViewById(R.id.activities_textview);
|
||||
|
||||
etDescription = findViewById(R.id.et_description);
|
||||
etDescription.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
etDescription.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
picturesRecyclerView = findViewById(R.id.picturesRecyclerView);
|
||||
|
||||
imagePaperAdapter = new PTWImageAdapter(PaperImageList, this, "");
|
||||
hseActivityArrayList.addAll(Helper.getList(Helper.hseActivities, this, HseActivity.class));
|
||||
hseActivitiesAdapter = new HseActivitiesAdapter(this, hseActivityArrayList);
|
||||
activitiesTextview.setAdapter(hseActivitiesAdapter);
|
||||
|
||||
imagePaperAdapter = new PTWImageAdapter(imageList, this, "");
|
||||
picturesRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
|
||||
picturesRecyclerView.setAdapter(imagePaperAdapter);
|
||||
|
||||
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(WeeklyFormOne.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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
|
@ -540,4 +628,84 @@ public class WeeklyFormOne extends AppCompatActivity implements EasyPermissions.
|
|||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public boolean isValidate() {
|
||||
boolean returnValue = true;
|
||||
String message = "";
|
||||
|
||||
if (etDescription.getText().toString().isEmpty()) {
|
||||
message = "Please enter description.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (activityName.isEmpty()) {
|
||||
message = "Please enter activity Name.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (!returnValue) {
|
||||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||
String jsonRequest = gson.toJson(StorageManager.getInstance());
|
||||
Log.e("RequestModel JSON", jsonRequest);
|
||||
|
||||
//loginViewModel.saveHSEData(requestModel);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
dialogCancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
alertDialog.dismiss();
|
||||
//Toast.makeText(con, "Cancel", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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.HseActivity;
|
||||
import com.utopiaindustries.hseobservationsapp.models.HseData.HseObservationClass;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HseActivitiesAdapter extends ArrayAdapter<HseActivity> {
|
||||
|
||||
private final Context context;
|
||||
private final List<HseActivity> items;
|
||||
|
||||
public HseActivitiesAdapter(Context context, List<HseActivity> 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);
|
||||
}
|
||||
|
||||
HseActivity item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -31,11 +31,11 @@ import java.util.List;
|
|||
|
||||
public class PTWImageAdapter extends RecyclerView.Adapter<PTWImageAdapter.ImageViewHolder> {
|
||||
|
||||
List<DocumentTypeImageModel> imageList;
|
||||
List<byte[]> imageList;
|
||||
private Context context;
|
||||
String classType;
|
||||
|
||||
public PTWImageAdapter(List<DocumentTypeImageModel> imageList, Context context, String classType) {
|
||||
public PTWImageAdapter(List<byte[]> imageList, Context context, String classType) {
|
||||
this.imageList = imageList;
|
||||
this.context = context;
|
||||
this.classType = classType;
|
||||
|
@ -59,7 +59,7 @@ public class PTWImageAdapter extends RecyclerView.Adapter<PTWImageAdapter.ImageV
|
|||
.into(holder.imageView);*/
|
||||
|
||||
//holder.docTypeTitle.setText(imageList.get(position).getDocumentTypeName());
|
||||
byte[] imageData = imageList.get(position).getImage();
|
||||
byte[] imageData = imageList.get(position);
|
||||
|
||||
// Load the image using Glide
|
||||
Bitmap bitmap = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);
|
||||
|
|
|
@ -38,7 +38,7 @@ 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.utils.ObservationStorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.hseobservationsapp.viewmodels.LoginViewModel;
|
||||
|
||||
|
@ -109,7 +109,7 @@ public class HomeFragment extends Fragment {
|
|||
siteName = siteArrayList.get(position).getTitle();
|
||||
Site clickedItem = siteArrayList.get(position);
|
||||
supervisorTextView.setText(null);
|
||||
ObservationStorageManager.getInstance().setSiteId(clickedItem.getId());
|
||||
StorageManager.getInstance().setSite_id(clickedItem.getId());
|
||||
|
||||
if (!supervisorArrayList_temp.isEmpty()) {
|
||||
List<Supervisor> filteredUnitItems = supervisorArrayList_temp.stream()
|
||||
|
@ -130,7 +130,8 @@ public class HomeFragment extends Fragment {
|
|||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
// Perform action when supervisorTextView item is clicked
|
||||
//Toast.makeText(getActivity(), "Item clicked: " + supervisorArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
ObservationStorageManager.getInstance().setSupervisorId(supervisorArrayList.get(position).getId());
|
||||
supervisorName = supervisorArrayList.get(position).getName();
|
||||
StorageManager.getInstance().setSupervisorId(supervisorArrayList.get(position).getId());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -140,7 +141,7 @@ public class HomeFragment extends Fragment {
|
|||
// Perform action when shiftTextview item is clicked
|
||||
//Toast.makeText(getActivity(), "Item clicked: " + shiftArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
shiftName = shiftArrayList.get(position).getTitle();
|
||||
ObservationStorageManager.getInstance().setShiftName(shiftName);
|
||||
StorageManager.getInstance().setShift(shiftName);
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -151,7 +152,7 @@ public class HomeFragment extends Fragment {
|
|||
// Perform action when formTextview item is clicked
|
||||
// Toast.makeText(getActivity(), "Item clicked: " + formArrayList.get(position).getTitle(), Toast.LENGTH_SHORT).show();
|
||||
selectedOption = recordTypeArrayList.get(position).getId();
|
||||
ObservationStorageManager.getInstance().setRecordTypeId(selectedOption);
|
||||
StorageManager.getInstance().setRecordTypeId(selectedOption);
|
||||
|
||||
}
|
||||
});
|
||||
|
@ -159,7 +160,7 @@ public class HomeFragment extends Fragment {
|
|||
btnNext.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// if (isValidate()) {
|
||||
if (isValidate()) {
|
||||
switch (selectedOption) {
|
||||
case 1:
|
||||
startActivity(new Intent(getActivity(), ObservationOneActivity.class));
|
||||
|
@ -187,7 +188,7 @@ public class HomeFragment extends Fragment {
|
|||
// Toast.makeText(getActivity(), "No option selected", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -357,7 +358,7 @@ public class HomeFragment extends Fragment {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||
String selectedDate = dateFormat.format(selectedCalendar.getTime());
|
||||
txtDate.setText(selectedDate);
|
||||
ObservationStorageManager.getInstance().setReportDate(selectedDate);
|
||||
StorageManager.getInstance().setObservation_date(selectedDate);
|
||||
}
|
||||
},
|
||||
year, month, day
|
||||
|
@ -379,6 +380,16 @@ public class HomeFragment extends Fragment {
|
|||
returnValue = false;
|
||||
}
|
||||
|
||||
if (supervisorName.isEmpty()) {
|
||||
message = "Please select supervisor.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (siteName.isEmpty()) {
|
||||
message = "Please select site.";
|
||||
returnValue = false;
|
||||
}
|
||||
|
||||
if (txtDate.getText().toString().isEmpty()) {
|
||||
message = "Please select date.";
|
||||
returnValue = false;
|
||||
|
|
|
@ -29,4 +29,9 @@ public class HseActivity {
|
|||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.ObservationModel;
|
||||
import com.utopiaindustries.hseobservationsapp.utils.StorageManager.StorageManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HSERequestModel {
|
||||
|
||||
private long id;
|
||||
|
@ -11,11 +16,7 @@ public class HSERequestModel {
|
|||
private String createdBy;
|
||||
private String createdAt;
|
||||
private long recordTypeId;
|
||||
private ObservationStorageManager hseReportObservationRecord;
|
||||
/*private HseReportInjuryRecord hseReportInjuryRecord;
|
||||
private HseReportActivityRecord hseReportActivityRecord;
|
||||
private HseReportSafetyTrainingRecord hseReportSafetyTrainingRecord;
|
||||
private HseReportPermitToWorkRecord hseReportPermitToWorkRecord;*/
|
||||
private List<ObservationModel> observationModel;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
|
@ -89,12 +90,12 @@ public class HSERequestModel {
|
|||
this.recordTypeId = recordTypeId;
|
||||
}
|
||||
|
||||
public ObservationStorageManager getHseReportObservationRecord() {
|
||||
return hseReportObservationRecord;
|
||||
public List<ObservationModel> getObservationModel() {
|
||||
return observationModel;
|
||||
}
|
||||
|
||||
public void setHseReportObservationRecord(ObservationStorageManager hseReportObservationRecord) {
|
||||
this.hseReportObservationRecord = hseReportObservationRecord;
|
||||
public void setObservationModel(List<ObservationModel> observationModel) {
|
||||
this.observationModel = observationModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -109,7 +110,7 @@ public class HSERequestModel {
|
|||
", createdBy='" + createdBy + '\'' +
|
||||
", createdAt='" + createdAt + '\'' +
|
||||
", recordTypeId=" + recordTypeId +
|
||||
", hseReportObservationRecord=" + hseReportObservationRecord +
|
||||
", observationModel=" + observationModel +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,244 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class HseReportActivityStorageManager {
|
||||
private static HseReportActivityStorageManager instance;
|
||||
// private ArrayList<byte[]> imageListPaper;
|
||||
|
||||
private String reportDate;
|
||||
private int userId;
|
||||
private int siteId;
|
||||
private int supervisorId;
|
||||
private String supervisorName;
|
||||
private String shiftName;
|
||||
private int recordTypeId;
|
||||
private String recordTypeName;
|
||||
|
||||
private int observationClassId;
|
||||
private String hseObservationName;
|
||||
|
||||
private int observationSubClassId;
|
||||
private String hseObservationSubClassName;
|
||||
|
||||
private int departmentId;
|
||||
private String departmentName;
|
||||
|
||||
private List<byte[]> beforePictures;
|
||||
private List<byte[]> afterPictures;
|
||||
|
||||
private String riskLevel;
|
||||
private boolean observationStatus;
|
||||
private String description;
|
||||
|
||||
private HseReportActivityStorageManager() {
|
||||
|
||||
}
|
||||
|
||||
public static HseReportActivityStorageManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new HseReportActivityStorageManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public String getReportDate() {
|
||||
return reportDate;
|
||||
}
|
||||
|
||||
public void setReportDate(String reportDate) {
|
||||
this.reportDate = reportDate;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getSupervisorId() {
|
||||
return supervisorId;
|
||||
}
|
||||
|
||||
public void setSupervisorId(int supervisorId) {
|
||||
this.supervisorId = supervisorId;
|
||||
}
|
||||
|
||||
public String getSupervisorName() {
|
||||
return supervisorName;
|
||||
}
|
||||
|
||||
public void setSupervisorName(String supervisorName) {
|
||||
this.supervisorName = supervisorName;
|
||||
}
|
||||
|
||||
public String getShiftName() {
|
||||
return shiftName;
|
||||
}
|
||||
|
||||
public void setShiftName(String shiftName) {
|
||||
this.shiftName = shiftName;
|
||||
}
|
||||
|
||||
public int getRecordTypeId() {
|
||||
return recordTypeId;
|
||||
}
|
||||
|
||||
public void setRecordTypeId(int recordTypeId) {
|
||||
this.recordTypeId = recordTypeId;
|
||||
}
|
||||
|
||||
public String getRecordTypeName() {
|
||||
return recordTypeName;
|
||||
}
|
||||
|
||||
public void setRecordTypeName(String recordTypeName) {
|
||||
this.recordTypeName = recordTypeName;
|
||||
}
|
||||
|
||||
public int getObservationClassId() {
|
||||
return observationClassId;
|
||||
}
|
||||
|
||||
public void setObservationClassId(int observationClassId) {
|
||||
this.observationClassId = observationClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationName() {
|
||||
return hseObservationName;
|
||||
}
|
||||
|
||||
public void setHseObservationName(String hseObservationName) {
|
||||
this.hseObservationName = hseObservationName;
|
||||
}
|
||||
|
||||
public int getObservationSubClassId() {
|
||||
return observationSubClassId;
|
||||
}
|
||||
|
||||
public void setObservationSubClassId(int observationSubClassId) {
|
||||
this.observationSubClassId = observationSubClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationSubClassName() {
|
||||
return hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public void setHseObservationSubClassName(String hseObservationSubClassName) {
|
||||
this.hseObservationSubClassName = hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(int departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public List<byte[]> getBeforePictures() {
|
||||
return beforePictures;
|
||||
}
|
||||
|
||||
public void setBeforePictures(List<byte[]> beforePictures) {
|
||||
this.beforePictures = beforePictures;
|
||||
}
|
||||
|
||||
public List<byte[]> getAfterPictures() {
|
||||
return afterPictures;
|
||||
}
|
||||
|
||||
public void setAfterPictures(List<byte[]> afterPictures) {
|
||||
this.afterPictures = afterPictures;
|
||||
}
|
||||
|
||||
public String getRiskLevel() {
|
||||
return riskLevel;
|
||||
}
|
||||
|
||||
public void setRiskLevel(String riskLevel) {
|
||||
this.riskLevel = riskLevel;
|
||||
}
|
||||
|
||||
public boolean getObservationStatus() {
|
||||
return observationStatus;
|
||||
}
|
||||
|
||||
public void setObservationStatus(boolean observationStatus) {
|
||||
this.observationStatus = observationStatus;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void clearAllData() {
|
||||
|
||||
reportDate = null;
|
||||
userId = 0;
|
||||
siteId = 0;
|
||||
supervisorId = 0;
|
||||
supervisorName = null;
|
||||
shiftName = null;
|
||||
recordTypeId = 0;
|
||||
recordTypeName = null;
|
||||
observationClassId = 0;
|
||||
hseObservationName = null;
|
||||
observationSubClassId = 0;
|
||||
hseObservationSubClassName = null;
|
||||
departmentId = 0;
|
||||
departmentName = null;
|
||||
beforePictures = null;
|
||||
afterPictures = null;
|
||||
riskLevel = null;
|
||||
observationStatus = false;
|
||||
description = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ObservationStorageManager{" +
|
||||
"reportDate='" + reportDate + '\'' +
|
||||
", userId=" + userId +
|
||||
", siteId=" + siteId +
|
||||
", supervisorId=" + supervisorId +
|
||||
", supervisorName='" + supervisorName + '\'' +
|
||||
", shiftName='" + shiftName + '\'' +
|
||||
", recordTypeId=" + recordTypeId +
|
||||
", recordTypeName='" + recordTypeName + '\'' +
|
||||
", observationClassId=" + observationClassId +
|
||||
", hseObservationName='" + hseObservationName + '\'' +
|
||||
", observationSubClassId=" + observationSubClassId +
|
||||
", hseObservationSubClassName='" + hseObservationSubClassName + '\'' +
|
||||
", departmentId=" + departmentId +
|
||||
", departmentName='" + departmentName + '\'' +
|
||||
", beforePicture=" + beforePictures +
|
||||
", afterPicture=" + afterPictures +
|
||||
", riskLevel='" + riskLevel + '\'' +
|
||||
", observationStatus='" + observationStatus + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -1,244 +0,0 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ObservationStorageManager {
|
||||
private static ObservationStorageManager instance;
|
||||
// private ArrayList<byte[]> imageListPaper;
|
||||
|
||||
private String reportDate;
|
||||
private int userId;
|
||||
private int siteId;
|
||||
private int supervisorId;
|
||||
private String supervisorName;
|
||||
private String shiftName;
|
||||
private int recordTypeId;
|
||||
private String recordTypeName;
|
||||
|
||||
private int observationClassId;
|
||||
private String hseObservationName;
|
||||
|
||||
private int observationSubClassId;
|
||||
private String hseObservationSubClassName;
|
||||
|
||||
private int departmentId;
|
||||
private String departmentName;
|
||||
|
||||
private List<byte[]> beforePictures;
|
||||
private List<byte[]> afterPictures;
|
||||
|
||||
private String riskLevel;
|
||||
private boolean observationStatus;
|
||||
private String description;
|
||||
|
||||
private ObservationStorageManager() {
|
||||
|
||||
}
|
||||
|
||||
public static ObservationStorageManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ObservationStorageManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public String getReportDate() {
|
||||
return reportDate;
|
||||
}
|
||||
|
||||
public void setReportDate(String reportDate) {
|
||||
this.reportDate = reportDate;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getSupervisorId() {
|
||||
return supervisorId;
|
||||
}
|
||||
|
||||
public void setSupervisorId(int supervisorId) {
|
||||
this.supervisorId = supervisorId;
|
||||
}
|
||||
|
||||
public String getSupervisorName() {
|
||||
return supervisorName;
|
||||
}
|
||||
|
||||
public void setSupervisorName(String supervisorName) {
|
||||
this.supervisorName = supervisorName;
|
||||
}
|
||||
|
||||
public String getShiftName() {
|
||||
return shiftName;
|
||||
}
|
||||
|
||||
public void setShiftName(String shiftName) {
|
||||
this.shiftName = shiftName;
|
||||
}
|
||||
|
||||
public int getRecordTypeId() {
|
||||
return recordTypeId;
|
||||
}
|
||||
|
||||
public void setRecordTypeId(int recordTypeId) {
|
||||
this.recordTypeId = recordTypeId;
|
||||
}
|
||||
|
||||
public String getRecordTypeName() {
|
||||
return recordTypeName;
|
||||
}
|
||||
|
||||
public void setRecordTypeName(String recordTypeName) {
|
||||
this.recordTypeName = recordTypeName;
|
||||
}
|
||||
|
||||
public int getObservationClassId() {
|
||||
return observationClassId;
|
||||
}
|
||||
|
||||
public void setObservationClassId(int observationClassId) {
|
||||
this.observationClassId = observationClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationName() {
|
||||
return hseObservationName;
|
||||
}
|
||||
|
||||
public void setHseObservationName(String hseObservationName) {
|
||||
this.hseObservationName = hseObservationName;
|
||||
}
|
||||
|
||||
public int getObservationSubClassId() {
|
||||
return observationSubClassId;
|
||||
}
|
||||
|
||||
public void setObservationSubClassId(int observationSubClassId) {
|
||||
this.observationSubClassId = observationSubClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationSubClassName() {
|
||||
return hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public void setHseObservationSubClassName(String hseObservationSubClassName) {
|
||||
this.hseObservationSubClassName = hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(int departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public List<byte[]> getBeforePictures() {
|
||||
return beforePictures;
|
||||
}
|
||||
|
||||
public void setBeforePictures(List<byte[]> beforePictures) {
|
||||
this.beforePictures = beforePictures;
|
||||
}
|
||||
|
||||
public List<byte[]> getAfterPictures() {
|
||||
return afterPictures;
|
||||
}
|
||||
|
||||
public void setAfterPictures(List<byte[]> afterPictures) {
|
||||
this.afterPictures = afterPictures;
|
||||
}
|
||||
|
||||
public String getRiskLevel() {
|
||||
return riskLevel;
|
||||
}
|
||||
|
||||
public void setRiskLevel(String riskLevel) {
|
||||
this.riskLevel = riskLevel;
|
||||
}
|
||||
|
||||
public boolean getObservationStatus() {
|
||||
return observationStatus;
|
||||
}
|
||||
|
||||
public void setObservationStatus(boolean observationStatus) {
|
||||
this.observationStatus = observationStatus;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void clearAllData() {
|
||||
|
||||
reportDate = null;
|
||||
userId = 0;
|
||||
siteId = 0;
|
||||
supervisorId = 0;
|
||||
supervisorName = null;
|
||||
shiftName = null;
|
||||
recordTypeId = 0;
|
||||
recordTypeName = null;
|
||||
observationClassId = 0;
|
||||
hseObservationName = null;
|
||||
observationSubClassId = 0;
|
||||
hseObservationSubClassName = null;
|
||||
departmentId = 0;
|
||||
departmentName = null;
|
||||
beforePictures = null;
|
||||
afterPictures = null;
|
||||
riskLevel = null;
|
||||
observationStatus = false;
|
||||
description = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ObservationStorageManager{" +
|
||||
"reportDate='" + reportDate + '\'' +
|
||||
", userId=" + userId +
|
||||
", siteId=" + siteId +
|
||||
", supervisorId=" + supervisorId +
|
||||
", supervisorName='" + supervisorName + '\'' +
|
||||
", shiftName='" + shiftName + '\'' +
|
||||
", recordTypeId=" + recordTypeId +
|
||||
", recordTypeName='" + recordTypeName + '\'' +
|
||||
", observationClassId=" + observationClassId +
|
||||
", hseObservationName='" + hseObservationName + '\'' +
|
||||
", observationSubClassId=" + observationSubClassId +
|
||||
", hseObservationSubClassName='" + hseObservationSubClassName + '\'' +
|
||||
", departmentId=" + departmentId +
|
||||
", departmentName='" + departmentName + '\'' +
|
||||
", beforePicture=" + beforePictures +
|
||||
", afterPicture=" + afterPictures +
|
||||
", riskLevel='" + riskLevel + '\'' +
|
||||
", observationStatus='" + observationStatus + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils.StorageManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ObservationModel {
|
||||
|
||||
private int observationClassId;
|
||||
private String hseObservationName;
|
||||
|
||||
private int observationSubClassId;
|
||||
private String hseObservationSubClassName;
|
||||
|
||||
private int departmentId;
|
||||
private String departmentName;
|
||||
|
||||
private List<byte[]> beforePictures;
|
||||
private List<byte[]> afterPictures;
|
||||
|
||||
private String riskLevel;
|
||||
private boolean observationStatus;
|
||||
private String description;
|
||||
|
||||
public int getObservationClassId() {
|
||||
return observationClassId;
|
||||
}
|
||||
|
||||
public void setObservationClassId(int observationClassId) {
|
||||
this.observationClassId = observationClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationName() {
|
||||
return hseObservationName;
|
||||
}
|
||||
|
||||
public void setHseObservationName(String hseObservationName) {
|
||||
this.hseObservationName = hseObservationName;
|
||||
}
|
||||
|
||||
public int getObservationSubClassId() {
|
||||
return observationSubClassId;
|
||||
}
|
||||
|
||||
public void setObservationSubClassId(int observationSubClassId) {
|
||||
this.observationSubClassId = observationSubClassId;
|
||||
}
|
||||
|
||||
public String getHseObservationSubClassName() {
|
||||
return hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public void setHseObservationSubClassName(String hseObservationSubClassName) {
|
||||
this.hseObservationSubClassName = hseObservationSubClassName;
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(int departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public List<byte[]> getBeforePictures() {
|
||||
return beforePictures;
|
||||
}
|
||||
|
||||
public void setBeforePictures(List<byte[]> beforePictures) {
|
||||
this.beforePictures = beforePictures;
|
||||
}
|
||||
|
||||
public List<byte[]> getAfterPictures() {
|
||||
return afterPictures;
|
||||
}
|
||||
|
||||
public void setAfterPictures(List<byte[]> afterPictures) {
|
||||
this.afterPictures = afterPictures;
|
||||
}
|
||||
|
||||
public String getRiskLevel() {
|
||||
return riskLevel;
|
||||
}
|
||||
|
||||
public void setRiskLevel(String riskLevel) {
|
||||
this.riskLevel = riskLevel;
|
||||
}
|
||||
|
||||
public boolean isObservationStatus() {
|
||||
return observationStatus;
|
||||
}
|
||||
|
||||
public void setObservationStatus(boolean observationStatus) {
|
||||
this.observationStatus = observationStatus;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ObservationModel{" +
|
||||
"observationClassId=" + observationClassId +
|
||||
", hseObservationName='" + hseObservationName + '\'' +
|
||||
", observationSubClassId=" + observationSubClassId +
|
||||
", hseObservationSubClassName='" + hseObservationSubClassName + '\'' +
|
||||
", departmentId=" + departmentId +
|
||||
", departmentName='" + departmentName + '\'' +
|
||||
", beforePictures=" + beforePictures.size() +
|
||||
", afterPictures=" + afterPictures.size() +
|
||||
", riskLevel='" + riskLevel + '\'' +
|
||||
", observationStatus=" + observationStatus +
|
||||
", description='" + description + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils.StorageManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ReportActivityModel {
|
||||
|
||||
private String activityName;
|
||||
private String description;
|
||||
private List<byte[]> pictures;
|
||||
|
||||
public String getActivityName() {
|
||||
return activityName;
|
||||
}
|
||||
|
||||
public void setActivityName(String activityName) {
|
||||
this.activityName = activityName;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<byte[]> getPictures() {
|
||||
return pictures;
|
||||
}
|
||||
|
||||
public void setPictures(List<byte[]> pictures) {
|
||||
this.pictures = pictures;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
package com.utopiaindustries.hseobservationsapp.utils.StorageManager;
|
||||
|
||||
import com.utopiaindustries.hseobservationsapp.activities.ProgressiveActivityForms.ProgressiveActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StorageManager {
|
||||
private static StorageManager instance;
|
||||
// private ArrayList<byte[]> imageListPaper;
|
||||
|
||||
private String observation_date;
|
||||
private int userId;
|
||||
private int site_id;
|
||||
private int supervisorId;
|
||||
private String supervisorName;
|
||||
private String shift;
|
||||
private int recordTypeId;
|
||||
private String recordTypeName;
|
||||
|
||||
private List<ObservationModel> observationsModel;
|
||||
private List<ReportActivityModel> reportActivityModel;
|
||||
private List<ReportActivityModel> progressiveActivityModel;
|
||||
|
||||
|
||||
private StorageManager() {
|
||||
|
||||
}
|
||||
|
||||
public static StorageManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new StorageManager();
|
||||
instance.initialize();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
observationsModel = new ArrayList<>();
|
||||
observationsModel.add(new ObservationModel());
|
||||
|
||||
reportActivityModel = new ArrayList<>();
|
||||
reportActivityModel.add(new ReportActivityModel());
|
||||
|
||||
progressiveActivityModel = new ArrayList<>();
|
||||
progressiveActivityModel.add(new ReportActivityModel());
|
||||
}
|
||||
|
||||
public String getObservation_date() {
|
||||
return observation_date;
|
||||
}
|
||||
|
||||
public void setObservation_date(String observation_date) {
|
||||
this.observation_date = observation_date;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getSite_id() {
|
||||
return site_id;
|
||||
}
|
||||
|
||||
public void setSite_id(int site_id) {
|
||||
this.site_id = site_id;
|
||||
}
|
||||
|
||||
public int getSupervisorId() {
|
||||
return supervisorId;
|
||||
}
|
||||
|
||||
public void setSupervisorId(int supervisorId) {
|
||||
this.supervisorId = supervisorId;
|
||||
}
|
||||
|
||||
public String getSupervisorName() {
|
||||
return supervisorName;
|
||||
}
|
||||
|
||||
public void setSupervisorName(String supervisorName) {
|
||||
this.supervisorName = supervisorName;
|
||||
}
|
||||
|
||||
public String getShift() {
|
||||
return shift;
|
||||
}
|
||||
|
||||
public void setShift(String shift) {
|
||||
this.shift = shift;
|
||||
}
|
||||
|
||||
public int getRecordTypeId() {
|
||||
return recordTypeId;
|
||||
}
|
||||
|
||||
public void setRecordTypeId(int recordTypeId) {
|
||||
this.recordTypeId = recordTypeId;
|
||||
}
|
||||
|
||||
public String getRecordTypeName() {
|
||||
return recordTypeName;
|
||||
}
|
||||
|
||||
public void setRecordTypeName(String recordTypeName) {
|
||||
this.recordTypeName = recordTypeName;
|
||||
}
|
||||
|
||||
public List<ObservationModel> getObservationsModel() {
|
||||
return observationsModel;
|
||||
}
|
||||
|
||||
public void setObservationsModel(List<ObservationModel> observationsModel) {
|
||||
this.observationsModel = observationsModel;
|
||||
}
|
||||
|
||||
public List<ReportActivityModel> getReportActivityModel() {
|
||||
return reportActivityModel;
|
||||
}
|
||||
|
||||
public void setReportActivityModel(List<ReportActivityModel> reportActivityModel) {
|
||||
this.reportActivityModel = reportActivityModel;
|
||||
}
|
||||
|
||||
public List<ReportActivityModel> getProgressiveActivityModel() {
|
||||
return progressiveActivityModel;
|
||||
}
|
||||
|
||||
public void setProgressiveActivityModel(List<ReportActivityModel> progressiveActivityModel) {
|
||||
this.progressiveActivityModel = progressiveActivityModel;
|
||||
}
|
||||
|
||||
public void clearAllData() {
|
||||
|
||||
observation_date = null;
|
||||
userId = 0;
|
||||
site_id = 0;
|
||||
supervisorId = 0;
|
||||
supervisorName = null;
|
||||
shift = null;
|
||||
recordTypeId = 0;
|
||||
recordTypeName = null;
|
||||
|
||||
observationsModel.clear();
|
||||
reportActivityModel.clear();
|
||||
progressiveActivityModel.clear();
|
||||
}
|
||||
}
|
|
@ -45,75 +45,75 @@
|
|||
android:id="@+id/scrollView2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btn_next"
|
||||
app:layout_constraintBottom_toTopOf="@+id/btn_submit"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:padding="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Name Of Activity *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_no_of_employees"
|
||||
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="Activity Name"
|
||||
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="5dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Name Of Activity *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
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"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
<EditText
|
||||
android:id="@+id/et_activityName"
|
||||
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="Activity Name"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="text"
|
||||
android:padding="13dp"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<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" />
|
||||
<TextView
|
||||
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"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rg1" />
|
||||
|
||||
</LinearLayout>
|
||||
<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>
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:hint="@string/select_activities"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -136,7 +136,7 @@
|
|||
android:layout_marginTop="10dp"
|
||||
android:gravity="left"
|
||||
android:padding="5dp"
|
||||
android:text="Description"
|
||||
android:text="Description *"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold"
|
||||
|
@ -147,9 +147,9 @@
|
|||
android:id="@+id/et_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:gravity="top|start"
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
android:textSize="@dimen/_13sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView2"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -59,7 +57,7 @@
|
|||
android:layout_marginStart="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="left"
|
||||
android:hint="MM-dd-yyyy"
|
||||
android:hint="yyyy-MM-dd"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_13sdp" />
|
||||
|
|
Loading…
Reference in New Issue