Chaniging all-apps scrim

> Converting the scrim to View, to better avoid overdraw
> Overview and Spring loaded state have different scrim alpha
> When going from overview to all-apps, there is a color scrim drawn over the overview panel.
  The slef color is merged with this color to prevent overdraw, and the remaining screen is drawn
  with a cut-out round rect path

Bug: 79111591
Change-Id: I26801fde13dd6adb4b06110bbe8087e35cc31847
This commit is contained in:
Sunny Goyal
2018-05-04 13:19:29 -07:00
parent 729020d186
commit 927447e71d
18 changed files with 390 additions and 240 deletions
@@ -26,9 +26,8 @@ import com.android.launcher3.R;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.uioverrides.AllAppsScrim;
import com.android.launcher3.graphics.ViewScrim;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.ScrimView;
/**
* Handles AllApps view transition.
@@ -57,7 +56,7 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
};
private AllAppsContainerView mAppsView;
private AllAppsScrim mAllAppsScrim;
private ScrimView mScrimView;
private final Launcher mLauncher;
private final boolean mIsDarkTheme;
@@ -117,7 +116,7 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
*/
public void setProgress(float progress) {
mProgress = progress;
mAllAppsScrim.onVerticalProgress(progress);
mScrimView.setProgress(progress);
float shiftCurrent = progress * mShiftRange;
mAppsView.setTranslationY(shiftCurrent);
@@ -209,8 +208,7 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
public void setupViews(AllAppsContainerView appsView) {
mAppsView = appsView;
mAllAppsScrim = (AllAppsScrim) ViewScrim.get(mAppsView);
mAllAppsScrim.reInitUi();
mScrimView = mLauncher.findViewById(R.id.scrim_view);
}
/**
@@ -220,8 +218,8 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
mScrollRangeDelta = delta;
mShiftRange = mLauncher.getDeviceProfile().heightPx - mScrollRangeDelta;
if (mAllAppsScrim != null) {
mAllAppsScrim.reInitUi();
if (mScrimView != null) {
mScrimView.reInitUi();
}
}