|
|
@@ -1,14 +1,16 @@
|
|
|
package kr.co.zumo.app.lifeplus.helper;
|
|
|
|
|
|
+import android.animation.Animator;
|
|
|
import android.animation.ObjectAnimator;
|
|
|
import android.app.Activity;
|
|
|
+import android.graphics.drawable.StateListDrawable;
|
|
|
import android.support.annotation.IntRange;
|
|
|
import android.support.constraint.ConstraintLayout;
|
|
|
import android.support.design.widget.AppBarLayout;
|
|
|
import android.support.design.widget.CoordinatorLayout;
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
import android.support.v7.widget.Toolbar;
|
|
|
-import android.graphics.drawable.StateListDrawable;
|
|
|
+import android.util.Log;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.ProgressBar;
|
|
|
@@ -132,7 +134,21 @@ public class ActionBarHelper extends Helper {
|
|
|
*/
|
|
|
public void setProgress(@IntRange(from = 0, to = 100) int percent) {
|
|
|
if (null != progressBar) {
|
|
|
+ ObjectAnimator progressAnimator = ObjectAnimator.ofInt(progressBar, "progress", progressBar.getProgress(), percent);
|
|
|
+ progressAnimator.setDuration(300);
|
|
|
+ progressBar.setLayerType(View.LAYER_TYPE_HARDWARE, null);
|
|
|
progressBar.setProgress(percent);
|
|
|
+
|
|
|
+ progressAnimator.addListener(new AnimatorManager.SimpleListener() {
|
|
|
+ @Override
|
|
|
+ public void onAnimationEnd(Animator animation) {
|
|
|
+ super.onAnimationEnd(animation);
|
|
|
+ progressBar.setLayerType(View.LAYER_TYPE_NONE, null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ progressAnimator.start();
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|