|
@@ -4,11 +4,10 @@ import android.animation.Animator;
|
|
|
import android.animation.AnimatorListenerAdapter;
|
|
import android.animation.AnimatorListenerAdapter;
|
|
|
import android.animation.ValueAnimator;
|
|
import android.animation.ValueAnimator;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
-import android.view.animation.AccelerateDecelerateInterpolator;
|
|
|
|
|
|
|
+import android.view.animation.DecelerateInterpolator;
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.NonNull;
|
|
|
import androidx.lifecycle.LiveData;
|
|
import androidx.lifecycle.LiveData;
|
|
|
-import androidx.lifecycle.MutableLiveData;
|
|
|
|
|
|
|
|
|
|
import com.atmob.app.lib.base.BaseDialog;
|
|
import com.atmob.app.lib.base.BaseDialog;
|
|
|
import com.datarecovery.master.R;
|
|
import com.datarecovery.master.R;
|
|
@@ -45,23 +44,23 @@ public class ScanProgressDialog extends BaseDialog<DialogScanProgressBinding> {
|
|
|
|
|
|
|
|
private void startProgress() {
|
|
private void startProgress() {
|
|
|
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 99);
|
|
ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 99);
|
|
|
- valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
|
|
|
|
|
|
+ valueAnimator.setInterpolator(new DecelerateInterpolator());
|
|
|
valueAnimator.addUpdateListener(animation -> {
|
|
valueAnimator.addUpdateListener(animation -> {
|
|
|
float value = (float) valueAnimator.getAnimatedValue();
|
|
float value = (float) valueAnimator.getAnimatedValue();
|
|
|
binding.setPercentageValue(value);
|
|
binding.setPercentageValue(value);
|
|
|
});
|
|
});
|
|
|
- valueAnimator.setDuration(1000 * 60 * 3);
|
|
|
|
|
|
|
+ valueAnimator.setDuration(1000 * 60 * 5);
|
|
|
valueAnimator.start();
|
|
valueAnimator.start();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void detectedFinish() {
|
|
public void detectedFinish() {
|
|
|
|
|
+ float limit = 100 - binding.getPercentageValue();
|
|
|
ValueAnimator valueAnimator = ValueAnimator.ofFloat(binding.getPercentageValue(), 100);
|
|
ValueAnimator valueAnimator = ValueAnimator.ofFloat(binding.getPercentageValue(), 100);
|
|
|
- valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
|
|
|
|
|
valueAnimator.addUpdateListener(animation -> {
|
|
valueAnimator.addUpdateListener(animation -> {
|
|
|
float value = (float) valueAnimator.getAnimatedValue();
|
|
float value = (float) valueAnimator.getAnimatedValue();
|
|
|
binding.setPercentageValue(value);
|
|
binding.setPercentageValue(value);
|
|
|
});
|
|
});
|
|
|
- valueAnimator.setDuration(2000);
|
|
|
|
|
|
|
+ valueAnimator.setDuration((int) limit * 100L);
|
|
|
valueAnimator.start();
|
|
valueAnimator.start();
|
|
|
valueAnimator.addListener(new AnimatorListenerAdapter() {
|
|
valueAnimator.addListener(new AnimatorListenerAdapter() {
|
|
|
@Override
|
|
@Override
|