This commit is contained in:
2023-08-03 21:23:47 +05:30
parent 90452ea748
commit c1b54fa93a
15 changed files with 300 additions and 199 deletions

View File

@@ -1,5 +1,7 @@
package com.ssb.simplitend.patientprofile;
import static com.ssb.simplitend.patientprofile.RegisterCompleteFragment.PROFILE_PROGRESS;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -30,6 +32,8 @@ public class ProfileProgressFragment extends Fragment implements ProfileContract
private ProgressDialog progressDialog;
int profile_progress;
public ProfileProgressFragment() {
// required empty const.
}
@@ -100,30 +104,43 @@ public class ProfileProgressFragment extends Fragment implements ProfileContract
);
binding.proceed.setOnClickListener(v -> {
Navigation.findNavController(v).navigate(R.id.action_profileProgressFragment_to_registerCompleteFragment);
Bundle bundle = new Bundle();
bundle.putInt(PROFILE_PROGRESS, profile_progress);
Navigation.findNavController(v).navigate(R.id.action_profileProgressFragment_to_registerCompleteFragment, bundle);
});
}
@Override
public void onProfileProgressFetched(@NonNull PatientData patientData) {
profile_progress = 0;
if (patientData.isCareGiverLink == 1) {
// TODO: 25-07-2023 look into this
profile_progress++;
}
if (patientData.isPatientReminderData == 1) {
profile_progress++;
binding.medReminderImg.setImageResource(0);
binding.medReminderImg.setBackgroundResource(R.drawable.ic_done);
binding.medReminderImg.setPaddingRelative(15, 15, 15, 15);
}
if (patientData.isPatientMedicalData == 1) {
profile_progress++;
binding.medInfoImg.setImageResource(0);
binding.medInfoImg.setBackgroundResource(R.drawable.ic_done);
binding.medInfoImg.setPadding(15, 15, 15, 15);
}
if (patientData.isPatientRoutineData == 1) {
profile_progress++;
binding.setupRoutineImg.setImageResource(0);
binding.setupRoutineImg.setBackgroundResource(R.drawable.ic_done);
binding.setupRoutineImg.setPadding(15, 15, 15, 15);