.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.ssb.simplitend.patientprofile;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -15,14 +16,16 @@ import com.daimajia.androidanimations.library.YoYo;
|
||||
import com.ssb.simplitend.R;
|
||||
import com.ssb.simplitend.apputils.AppUtil;
|
||||
import com.ssb.simplitend.databinding.RegisterationDoneFragmentBinding;
|
||||
import com.ssb.simplitend.patient_dashboard.DashBoardActivity;
|
||||
|
||||
public class RegisterCompleteFragment extends Fragment {
|
||||
|
||||
public RegisterationDoneFragmentBinding binding;
|
||||
|
||||
public static final String PROFILE_PROGRESS = "profile_progress";
|
||||
public static final String IS_CONNECTED_TO_CG = "is_connect_to_cg";
|
||||
|
||||
int profile_progress;
|
||||
int profile_progress, is_connect_to_caregiver;
|
||||
|
||||
public RegisterCompleteFragment(){
|
||||
// required
|
||||
@@ -35,6 +38,7 @@ public class RegisterCompleteFragment extends Fragment {
|
||||
|
||||
if (getArguments() != null){
|
||||
profile_progress = getArguments().getInt(PROFILE_PROGRESS, 20);
|
||||
is_connect_to_caregiver = getArguments().getInt(IS_CONNECTED_TO_CG, 0);
|
||||
}
|
||||
|
||||
binding.animIv.setAnimation(R.raw.done_anim_2);
|
||||
@@ -69,15 +73,27 @@ public class RegisterCompleteFragment extends Fragment {
|
||||
});
|
||||
|
||||
binding.proceed.setOnClickListener(v -> {
|
||||
AppUtil.showAlert(requireContext(),
|
||||
"Ask Caregiver to register",
|
||||
"Kindly ask CareGiver to complete registeration.",
|
||||
"OK",
|
||||
((dialogInterface, i) -> {
|
||||
|
||||
}), null, null);
|
||||
if (is_connect_to_caregiver == 1){
|
||||
gotoPatientDashBoard();
|
||||
}else {
|
||||
AppUtil.showAlert(requireContext(),
|
||||
"Ask Caregiver to register",
|
||||
"Kindly ask CareGiver to complete registeration.",
|
||||
"OK",
|
||||
((dialogInterface, i) -> {
|
||||
|
||||
}), null, null);
|
||||
}
|
||||
});
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
private void gotoPatientDashBoard() {
|
||||
Intent intent = new Intent(requireActivity(), DashBoardActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user