Merge "Using background outline provider as the final provider for reveal animation" into ub-launcher3-burnaby
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index 85f58a1..476ebd1 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -58,6 +58,7 @@
import com.android.launcher3.Workspace.ItemOperator;
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate.AccessibilityDragSource;
import com.android.launcher3.util.Thunk;
+import com.android.launcher3.util.UiThreadCircularReveal;
import java.util.ArrayList;
import java.util.Collections;
@@ -467,6 +468,7 @@
prepareReveal();
centerAboutIcon();
+ AnimatorSet anim = LauncherAnimUtils.createAnimatorSet();
int width = getPaddingLeft() + getPaddingRight() + mContent.getDesiredWidth();
int height = getFolderHeight();
@@ -477,7 +479,7 @@
PropertyValuesHolder tx = PropertyValuesHolder.ofFloat("translationX", transX, 0);
PropertyValuesHolder ty = PropertyValuesHolder.ofFloat("translationY", transY, 0);
- Animator drift = LauncherAnimUtils.ofPropertyValuesHolder(this, tx, ty);
+ Animator drift = ObjectAnimator.ofPropertyValuesHolder(this, tx, ty);
drift.setDuration(mMaterialExpandDuration);
drift.setStartDelay(mMaterialExpandStagger);
drift.setInterpolator(new LogDecelerateInterpolator(100, 0));
@@ -486,20 +488,19 @@
int ry = (int) Math.max(Math.max(height - getPivotY(), 0), getPivotY());
float radius = (float) Math.hypot(rx, ry);
- AnimatorSet anim = LauncherAnimUtils.createAnimatorSet();
- Animator reveal = LauncherAnimUtils.createCircularReveal(this, (int) getPivotX(),
+ Animator reveal = UiThreadCircularReveal.createCircularReveal(this, (int) getPivotX(),
(int) getPivotY(), 0, radius);
reveal.setDuration(mMaterialExpandDuration);
reveal.setInterpolator(new LogDecelerateInterpolator(100, 0));
mContentWrapper.setAlpha(0f);
- Animator iconsAlpha = LauncherAnimUtils.ofFloat(mContentWrapper, "alpha", 0f, 1f);
+ Animator iconsAlpha = ObjectAnimator.ofFloat(mContentWrapper, "alpha", 0f, 1f);
iconsAlpha.setDuration(mMaterialExpandDuration);
iconsAlpha.setStartDelay(mMaterialExpandStagger);
iconsAlpha.setInterpolator(new AccelerateInterpolator(1.5f));
mFooter.setAlpha(0f);
- Animator textAlpha = LauncherAnimUtils.ofFloat(mFooter, "alpha", 0f, 1f);
+ Animator textAlpha = ObjectAnimator.ofFloat(mFooter, "alpha", 0f, 1f);
textAlpha.setDuration(mMaterialExpandDuration);
textAlpha.setStartDelay(mMaterialExpandStagger);
textAlpha.setInterpolator(new AccelerateInterpolator(1.5f));
diff --git a/src/com/android/launcher3/util/UiThreadCircularReveal.java b/src/com/android/launcher3/util/UiThreadCircularReveal.java
index c7324fb..c8e1df2 100644
--- a/src/com/android/launcher3/util/UiThreadCircularReveal.java
+++ b/src/com/android/launcher3/util/UiThreadCircularReveal.java
@@ -15,11 +15,15 @@
public class UiThreadCircularReveal {
public static ValueAnimator createCircularReveal(View v, int x, int y, float r0, float r1) {
+ return createCircularReveal(v, x, y, r0, r1, ViewOutlineProvider.BACKGROUND);
+ }
+
+ public static ValueAnimator createCircularReveal(View v, int x, int y, float r0, float r1,
+ final ViewOutlineProvider originalProvider) {
ValueAnimator va = ValueAnimator.ofFloat(0f, 1f);
final View revealView = v;
final RevealOutlineProvider outlineProvider = new RevealOutlineProvider(x, y, r0, r1);
- final ViewOutlineProvider originalProvider = revealView.getOutlineProvider();
final float elevation = v.getElevation();
va.addListener(new AnimatorListenerAdapter() {