Files
SimpliTend/app/src/main/java/com/ssb/simplitend/patientprofile/RegisterCompleteFragment.java

84 lines
2.4 KiB
Java
Raw Normal View History

2023-07-31 20:36:26 +05:30
package com.ssb.simplitend.patientprofile;
import android.animation.Animator;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.ssb.simplitend.R;
import com.ssb.simplitend.apputils.AppUtil;
import com.ssb.simplitend.databinding.RegisterationDoneFragmentBinding;
public class RegisterCompleteFragment extends Fragment {
public RegisterationDoneFragmentBinding binding;
2023-08-03 21:23:47 +05:30
public static final String PROFILE_PROGRESS = "profile_progress";
int profile_progress;
2023-07-31 20:36:26 +05:30
public RegisterCompleteFragment(){
// required
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
binding = RegisterationDoneFragmentBinding.inflate(inflater, container, false);
2023-08-03 21:23:47 +05:30
if (getArguments() != null){
profile_progress = getArguments().getInt(PROFILE_PROGRESS, 20);
}
2023-07-31 20:36:26 +05:30
binding.animIv.setAnimation(R.raw.done_anim_2);
binding.animIv.playAnimation();
binding.animIv.addAnimatorListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(@NonNull Animator animator) {
}
@Override
public void onAnimationEnd(@NonNull Animator animator) {
2023-08-03 21:23:47 +05:30
String title = "Your profile is " + (profile_progress * 20) + "% complete!";
binding.title.setText(title);
2023-07-31 20:36:26 +05:30
YoYo.with(Techniques.FadeIn)
.duration(100)
.playOn(binding.title);
}
@Override
public void onAnimationCancel(@NonNull Animator animator) {
}
@Override
public void onAnimationRepeat(@NonNull Animator animator) {
}
});
binding.proceed.setOnClickListener(v -> {
AppUtil.showAlert(requireContext(),
"Ask Caregiver to register",
"Kindly ask CareGiver to complete registeration.",
"OK",
((dialogInterface, i) -> {
}), null, null);
});
return binding.getRoot();
}
}