.
This commit is contained in:
@@ -11,6 +11,12 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.DataSource;
|
||||
import com.bumptech.glide.load.engine.GlideException;
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.daimajia.androidanimations.library.Techniques;
|
||||
import com.daimajia.androidanimations.library.YoYo;
|
||||
import com.ssb.simplitend.R;
|
||||
@@ -27,7 +33,7 @@ public class RegisterCompleteFragment extends Fragment {
|
||||
|
||||
int profile_progress, is_connect_to_caregiver;
|
||||
|
||||
public RegisterCompleteFragment(){
|
||||
public RegisterCompleteFragment() {
|
||||
// required
|
||||
}
|
||||
|
||||
@@ -36,47 +42,33 @@ public class RegisterCompleteFragment extends Fragment {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
binding = RegisterationDoneFragmentBinding.inflate(inflater, container, false);
|
||||
|
||||
if (getArguments() != null){
|
||||
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);
|
||||
binding.animIv.playAnimation();
|
||||
Glide.with(requireContext())
|
||||
.asGif()
|
||||
.load(R.raw.filling_anim)
|
||||
.listener(new RequestListener<GifDrawable>() {
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<GifDrawable> target, boolean isFirstResource) {
|
||||
return false;
|
||||
}
|
||||
|
||||
binding.animIv.addAnimatorListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(@NonNull Animator animator) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(@NonNull Animator animator) {
|
||||
|
||||
String title = "Your profile is " + (profile_progress * 20) + "% complete!";
|
||||
|
||||
binding.title.setText(title);
|
||||
YoYo.with(Techniques.FadeIn)
|
||||
.duration(100)
|
||||
.playOn(binding.title);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(@NonNull Animator animator) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(@NonNull Animator animator) {
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public boolean onResourceReady(GifDrawable resource, Object model, Target<GifDrawable> target, DataSource dataSource, boolean isFirstResource) {
|
||||
resource.setLoopCount(1);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.into(binding.animIv);
|
||||
|
||||
binding.proceed.setOnClickListener(v -> {
|
||||
|
||||
if (is_connect_to_caregiver == 1){
|
||||
if (is_connect_to_caregiver == 1) {
|
||||
gotoPatientDashBoard();
|
||||
}else {
|
||||
} else {
|
||||
AppUtil.showAlert(requireContext(),
|
||||
"Ask Caregiver to register",
|
||||
"Kindly ask CareGiver to complete registeration.",
|
||||
@@ -97,3 +89,34 @@ public class RegisterCompleteFragment extends Fragment {
|
||||
requireActivity().finish();
|
||||
}
|
||||
}
|
||||
|
||||
//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) {
|
||||
//
|
||||
// String title = "Your profile is " + (profile_progress * 20) + "% complete!";
|
||||
//
|
||||
// binding.title.setText(title);
|
||||
// YoYo.with(Techniques.FadeIn)
|
||||
// .duration(100)
|
||||
// .playOn(binding.title);
|
||||
// }
|
||||
//
|
||||
//@Override
|
||||
//public void onAnimationCancel(@NonNull Animator animator) {
|
||||
//
|
||||
// }
|
||||
//
|
||||
//@Override
|
||||
//public void onAnimationRepeat(@NonNull Animator animator) {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
Reference in New Issue
Block a user