Loading src/com/android/launcher3/allapps/AllAppsContainerView.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -459,6 +459,16 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc lp.leftMargin = bgPadding.left; lp.leftMargin = bgPadding.left; lp.rightMargin = bgPadding.right; lp.rightMargin = bgPadding.right; // Clip the view to the left and right edge of the background to // to prevent shadows from rendering beyond the edges final Rect newClipBounds = new Rect( bgPadding.left, 0, getWidth() - bgPadding.right, getHeight() ); setClipBounds(newClipBounds); DeviceProfile grid = mLauncher.getDeviceProfile(); DeviceProfile grid = mLauncher.getDeviceProfile(); if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { if (!grid.isVerticalBarLayout()) { if (!grid.isVerticalBarLayout()) { Loading src/com/android/launcher3/allapps/HeaderElevationController.java +24 −3 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.launcher3.allapps; import android.annotation.TargetApi; import android.annotation.TargetApi; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Outline; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.os.Build; Loading Loading @@ -82,11 +83,31 @@ public abstract class HeaderElevationController extends RecyclerView.OnScrollLis public ControllerVL(View header) { public ControllerVL(View header) { mHeader = header; mHeader = header; mHeader.setOutlineProvider(ViewOutlineProvider.BOUNDS); Resources res = mHeader.getContext().getResources(); Resources res = header.getContext().getResources(); mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation); mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation); mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation); mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation); // We need to provide a custom outline so the shadow only appears on the bottom edge. // The top, left and right edges are all extended out, and the shadow is clipped // by the parent. final ViewOutlineProvider vop = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { final View parent = (View) mHeader.getParent(); final int left = parent.getLeft(); // Use the parent to account for offsets final int top = view.getTop(); final int right = left + view.getWidth(); final int bottom = view.getBottom(); outline.setRect( left - (int) mMaxElevation, top - (int) mMaxElevation, right + (int) mMaxElevation, bottom); } }; mHeader.setOutlineProvider(vop); } } @Override @Override Loading Loading
src/com/android/launcher3/allapps/AllAppsContainerView.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -459,6 +459,16 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc lp.leftMargin = bgPadding.left; lp.leftMargin = bgPadding.left; lp.rightMargin = bgPadding.right; lp.rightMargin = bgPadding.right; // Clip the view to the left and right edge of the background to // to prevent shadows from rendering beyond the edges final Rect newClipBounds = new Rect( bgPadding.left, 0, getWidth() - bgPadding.right, getHeight() ); setClipBounds(newClipBounds); DeviceProfile grid = mLauncher.getDeviceProfile(); DeviceProfile grid = mLauncher.getDeviceProfile(); if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { if (!grid.isVerticalBarLayout()) { if (!grid.isVerticalBarLayout()) { Loading
src/com/android/launcher3/allapps/HeaderElevationController.java +24 −3 Original line number Original line Diff line number Diff line Loading @@ -2,6 +2,7 @@ package com.android.launcher3.allapps; import android.annotation.TargetApi; import android.annotation.TargetApi; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Outline; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.os.Build; Loading Loading @@ -82,11 +83,31 @@ public abstract class HeaderElevationController extends RecyclerView.OnScrollLis public ControllerVL(View header) { public ControllerVL(View header) { mHeader = header; mHeader = header; mHeader.setOutlineProvider(ViewOutlineProvider.BOUNDS); Resources res = mHeader.getContext().getResources(); Resources res = header.getContext().getResources(); mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation); mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation); mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation); mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation); // We need to provide a custom outline so the shadow only appears on the bottom edge. // The top, left and right edges are all extended out, and the shadow is clipped // by the parent. final ViewOutlineProvider vop = new ViewOutlineProvider() { @Override public void getOutline(View view, Outline outline) { final View parent = (View) mHeader.getParent(); final int left = parent.getLeft(); // Use the parent to account for offsets final int top = view.getTop(); final int right = left + view.getWidth(); final int bottom = view.getBottom(); outline.setRect( left - (int) mMaxElevation, top - (int) mMaxElevation, right + (int) mMaxElevation, bottom); } }; mHeader.setOutlineProvider(vop); } } @Override @Override Loading