Convert AnimationUtils functions to extension functions.

This commit is contained in:
Isira Seneviratne 2021-01-16 09:02:01 +05:30
parent 0af89267ef
commit 0f66853a9a
25 changed files with 568 additions and 687 deletions

View file

@ -31,7 +31,7 @@ import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.ktx.ViewUtils;
import java.lang.annotation.Retention;
import java.util.ArrayList;
@ -128,7 +128,7 @@ public class CollapsibleView extends LinearLayout {
if (currentAnimator != null && currentAnimator.isRunning()) {
currentAnimator.cancel();
}
currentAnimator = AnimationUtils.animateHeight(this, ANIMATION_DURATION, 0);
currentAnimator = ViewUtils.animateHeight(this, ANIMATION_DURATION, 0);
setCurrentState(COLLAPSED);
}
@ -151,7 +151,7 @@ public class CollapsibleView extends LinearLayout {
if (currentAnimator != null && currentAnimator.isRunning()) {
currentAnimator.cancel();
}
currentAnimator = AnimationUtils.animateHeight(this, ANIMATION_DURATION, this.targetHeight);
currentAnimator = ViewUtils.animateHeight(this, ANIMATION_DURATION, this.targetHeight);
setCurrentState(EXPANDED);
}