Launcher state management cleanup
> Removing Widgets and related states
> Fixing different durations being used when opening/closing all-apps
> Removing some unnecessary object allocations when changing state without animation
> Differentiating widget bootm sheel and full sheet in logs
Bug: 67678570
Change-Id: Ic169528736d04ee0b38564b4f96595ba066eabda
diff --git a/src/com/android/launcher3/LauncherAnimUtils.java b/src/com/android/launcher3/LauncherAnimUtils.java
index cfb9b57..02f05c3 100644
--- a/src/com/android/launcher3/LauncherAnimUtils.java
+++ b/src/com/android/launcher3/LauncherAnimUtils.java
@@ -30,6 +30,16 @@
import java.util.WeakHashMap;
public class LauncherAnimUtils {
+ /**
+ * Durations for various state animations. These are not defined in resources to allow
+ * easier access from static classes and enums
+ */
+ public static final int ALL_APPS_TRANSITION_MS = 320;
+ public static final int OVERVIEW_TRANSITION_MS = 250;
+ public static final int SPRING_LOADED_TRANSITION_MS = 150;
+ public static final int SPRING_LOADED_EXIT_SHORT_TIMEOUT = 500;
+ public static final int SPRING_LOADED_EXIT_NEXT_FRAME = 0;
+
static WeakHashMap<Animator, Object> sAnimators = new WeakHashMap<Animator, Object>();
static Animator.AnimatorListener sEndAnimListener = new Animator.AnimatorListener() {
public void onAnimationStart(Animator animation) {
@@ -141,4 +151,18 @@
drawable.setAlpha(alpha);
}
};
+
+ public static final Property<View, Float> SCALE_PROPERTY =
+ new Property<View, Float>(Float.class, "scale") {
+ @Override
+ public Float get(View view) {
+ return view.getScaleX();
+ }
+
+ @Override
+ public void set(View view, Float scale) {
+ view.setScaleX(scale);
+ view.setScaleY(scale);
+ }
+ };
}