From 057397714327b42c55804624cc06c7761d999f84 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 19 May 2015 19:59:09 -0700 Subject: Removing some unused functionalities > Removing obsolete progrard rules > Removing BackgroundAlphaMultiplier from CellLayout, which is always 1 > Removign otiline animation from workspace. This animation never runs, as it is called during startReordeing which always happens when overview mode (workspaceInModalState() is true) Change-Id: I43219e41ea188771bc818988c1bcbd523f28cba6 --- proguard.flags | 18 ---------- src/com/android/launcher3/CellLayout.java | 25 ++++--------- src/com/android/launcher3/Workspace.java | 58 ++----------------------------- 3 files changed, 8 insertions(+), 93 deletions(-) diff --git a/proguard.flags b/proguard.flags index 6eb594825..5e2c384ce 100644 --- a/proguard.flags +++ b/proguard.flags @@ -1,19 +1,3 @@ --keep class com.android.launcher3.Launcher { - public void previousScreen(android.view.View); - public void nextScreen(android.view.View); - public void launchHotSeat(android.view.View); - public void onClickSearchButton(android.view.View); - public void onClickVoiceButton(android.view.View); - public void onClickConfigureButton(android.view.View); - public void onClickAllAppsButton(android.view.View); - public void dismissFirstRunCling(android.view.View); - public void dismissMigrationClingCopyApps(android.view.View); - public void dismissMigrationClingUseDefault(android.view.View); - public void dismissMigrationWorkspaceCling(android.view.View); - public void dismissWorkspaceCling(android.view.View); - public void dismissAllAppsCling(android.view.View); -} - -keep class com.android.launcher3.CellLayout { public float getBackgroundAlpha(); public void setBackgroundAlpha(float); @@ -44,8 +28,6 @@ -keep class com.android.launcher3.Workspace { public float getBackgroundAlpha(); public void setBackgroundAlpha(float); - public float getChildrenOutlineAlpha(); - public void setChildrenOutlineAlpha(float); } -keep class com.android.launcher3.MemoryDumpActivity { diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 57db805d8..48ddfe6bf 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -103,8 +103,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { private float FOREGROUND_ALPHA_DAMPER = 0.65f; private int mForegroundAlpha = 0; private float mBackgroundAlpha; - private float mBackgroundAlphaMultiplier = 1.0f; - private boolean mDrawBackground = true; private Drawable mNormalBackground; private Drawable mActiveGlowBackground; @@ -423,10 +421,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { } } - void disableBackground() { - mDrawBackground = false; - } - void disableDragTarget() { mIsDragTarget = false; } @@ -448,12 +442,16 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { @Override protected void onDraw(Canvas canvas) { + if (!mIsDragTarget) { + return; + } + // When we're large, we are either drawn in a "hover" state (ie when dragging an item to // a neighboring page) or with just a normal background (if backgroundAlpha > 0.0f) // When we're small, we are either drawn normally or in the "accepts drops" state (during // a drag). However, we also drag the mini hover background *over* one of those two // backgrounds - if (mDrawBackground && mBackgroundAlpha > 0.0f) { + if (mBackgroundAlpha > 0.0f) { Drawable bg; if (mIsDragOverlapping) { @@ -463,7 +461,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { bg = mNormalBackground; } - bg.setAlpha((int) (mBackgroundAlpha * mBackgroundAlphaMultiplier * 255)); + bg.setAlpha((int) (mBackgroundAlpha * 255)); bg.setBounds(mBackgroundRect); bg.draw(canvas); } @@ -951,17 +949,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { return mBackgroundAlpha; } - public void setBackgroundAlphaMultiplier(float multiplier) { - if (mBackgroundAlphaMultiplier != multiplier) { - mBackgroundAlphaMultiplier = multiplier; - invalidate(); - } - } - - public float getBackgroundAlphaMultiplier() { - return mBackgroundAlphaMultiplier; - } - public void setBackgroundAlpha(float alpha) { if (mBackgroundAlpha != alpha) { mBackgroundAlpha = alpha; diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 58e5877a6..e645b6570 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -57,6 +57,7 @@ import android.view.accessibility.AccessibilityManager; import android.view.animation.DecelerateInterpolator; import android.view.animation.Interpolator; import android.widget.TextView; + import com.android.launcher3.FolderIcon.FolderRingAnimator; import com.android.launcher3.Launcher.CustomContentCallbacks; import com.android.launcher3.Launcher.LauncherOverlay; @@ -70,6 +71,7 @@ import com.android.launcher3.util.Thunk; import com.android.launcher3.util.WallpaperUtils; import com.android.launcher3.widget.PendingAddShortcutInfo; import com.android.launcher3.widget.PendingAddWidgetInfo; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -86,10 +88,6 @@ public class Workspace extends SmoothPagedView Insettable, UninstallSource, AccessibilityDragSource { private static final String TAG = "Launcher.Workspace"; - private static final int CHILDREN_OUTLINE_FADE_OUT_DELAY = 0; - private static final int CHILDREN_OUTLINE_FADE_OUT_DURATION = 375; - private static final int CHILDREN_OUTLINE_FADE_IN_DURATION = 100; - protected static final int SNAP_OFF_EMPTY_SCREEN_DURATION = 400; protected static final int FADE_EMPTY_SCREEN_DURATION = 150; @@ -98,11 +96,6 @@ public class Workspace extends SmoothPagedView static final boolean MAP_NO_RECURSE = false; static final boolean MAP_RECURSE = true; - // These animators are used to fade the children's outlines - private ObjectAnimator mChildrenOutlineFadeInAnimation; - private ObjectAnimator mChildrenOutlineFadeOutAnimation; - private float mChildrenOutlineAlpha = 0; - private static final long CUSTOM_CONTENT_GESTURE_DELAY = 200; private long mTouchDownTime = -1; private long mCustomContentShowTime = -1; @@ -385,7 +378,6 @@ public class Workspace extends SmoothPagedView updateChildrenLayersEnabled(false); mLauncher.lockScreenOrientation(); mLauncher.onInteractionBegin(); - setChildrenBackgroundAlphaMultipliers(1f); // Prevent any Un/InstallShortcutReceivers from updating the db while we are dragging InstallShortcutReceiver.enableInstallQueue(); post(new Runnable() { @@ -575,7 +567,6 @@ public class Workspace extends SmoothPagedView public void createCustomContentContainer() { CellLayout customScreen = (CellLayout) mLauncher.getLayoutInflater().inflate(R.layout.workspace_screen, this, false); - customScreen.disableBackground(); customScreen.disableDragTarget(); mWorkspaceScreens.put(CUSTOM_CONTENT_SCREEN_ID, customScreen); @@ -1530,45 +1521,12 @@ public class Workspace extends SmoothPagedView } } - void showOutlines() { - if (!workspaceInModalState() && !mIsSwitchingState) { - if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel(); - if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel(); - mChildrenOutlineFadeInAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 1.0f); - mChildrenOutlineFadeInAnimation.setDuration(CHILDREN_OUTLINE_FADE_IN_DURATION); - mChildrenOutlineFadeInAnimation.start(); - } - } - - void hideOutlines() { - if (!workspaceInModalState() && !mIsSwitchingState) { - if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel(); - if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel(); - mChildrenOutlineFadeOutAnimation = LauncherAnimUtils.ofFloat(this, "childrenOutlineAlpha", 0.0f); - mChildrenOutlineFadeOutAnimation.setDuration(CHILDREN_OUTLINE_FADE_OUT_DURATION); - mChildrenOutlineFadeOutAnimation.setStartDelay(CHILDREN_OUTLINE_FADE_OUT_DELAY); - mChildrenOutlineFadeOutAnimation.start(); - } - } - public void showOutlinesTemporarily() { if (!mIsPageMoving && !isTouchActive()) { snapToPage(mCurrentPage); } } - public void setChildrenOutlineAlpha(float alpha) { - mChildrenOutlineAlpha = alpha; - for (int i = 0; i < getChildCount(); i++) { - CellLayout cl = (CellLayout) getChildAt(i); - cl.setBackgroundAlpha(alpha); - } - } - - public float getChildrenOutlineAlpha() { - return mChildrenOutlineAlpha; - } - float backgroundAlphaInterpolator(float r) { float pivotA = 0.1f; float pivotB = 0.4f; @@ -1598,13 +1556,6 @@ public class Workspace extends SmoothPagedView } } - private void setChildrenBackgroundAlphaMultipliers(float a) { - for (int i = 0; i < getChildCount(); i++) { - CellLayout child = (CellLayout) getChildAt(i); - child.setBackgroundAlphaMultiplier(a); - } - } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void enableAccessibleDrag(boolean enable) { @@ -2001,7 +1952,6 @@ public class Workspace extends SmoothPagedView public void onStartReordering() { super.onStartReordering(); - showOutlines(); // Reordering handles its own animations, disable the automatic ones. disableLayoutTransitions(); } @@ -2014,7 +1964,6 @@ public class Workspace extends SmoothPagedView return; } - hideOutlines(); mScreenOrder.clear(); int count = getChildCount(); for (int i = 0; i < count; i++) { @@ -2966,9 +2915,6 @@ public class Workspace extends SmoothPagedView mSpringLoadedDragController.cancel(); - if (!mIsPageMoving) { - hideOutlines(); - } mLauncher.getDragLayer().hidePageHints(); } -- cgit v1.2.3