Snap for 9103015 from fafa374dcc to udc-release
Change-Id: I0b3958fc8241b6d09743d20e60bce72d0012b79a
This commit is contained in:
commit
428f0eb656
4 files changed
+28
-20
No files matched your search
@@ -2063,7 +2063,6 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
|
||||
if (handleTaskAppeared(appearedTaskTargets)) {
|
||||
mRecentsAnimationController.finish(false /* toRecents */,
|
||||
null /* onFinishComplete */);
|
||||
mActivityInterface.onLaunchTaskSuccess();
|
||||
ActiveGestureLog.INSTANCE.addLog(
|
||||
/* event= */ "finishRecentsAnimation",
|
||||
/* extras= */ false,
|
||||
|
||||
@@ -183,14 +183,6 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
|
||||
|
||||
public abstract void onLaunchTaskFailed();
|
||||
|
||||
public void onLaunchTaskSuccess() {
|
||||
ACTIVITY_TYPE activity = getCreatedActivity();
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
activity.getStateManager().moveToRestState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes any overlays.
|
||||
*/
|
||||
|
||||
@@ -88,6 +88,9 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
||||
public static final float PULL_MULTIPLIER = .02f;
|
||||
public static final float FLING_VELOCITY_MULTIPLIER = 1200f;
|
||||
|
||||
// Render the header protection at all times to debug clipping issues.
|
||||
private static final boolean DEBUG_HEADER_PROTECTION = false;
|
||||
|
||||
private final Paint mHeaderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
private final Rect mInsets = new Rect();
|
||||
|
||||
@@ -129,7 +132,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
||||
private final int mScrimColor;
|
||||
private final int mHeaderProtectionColor;
|
||||
protected final float mHeaderThreshold;
|
||||
private int mHeaderBottomAdjustment;
|
||||
private ScrimView mScrimView;
|
||||
private int mHeaderColor;
|
||||
private int mTabsProtectionAlpha;
|
||||
@@ -142,8 +144,6 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
||||
mScrimColor = Themes.getAttrColor(context, R.attr.allAppsScrimColor);
|
||||
mHeaderThreshold = getResources().getDimensionPixelSize(
|
||||
R.dimen.dynamic_grid_cell_border_spacing);
|
||||
mHeaderBottomAdjustment = getResources().getDimensionPixelSize(
|
||||
R.dimen.all_apps_header_bottom_adjustment);
|
||||
mHeaderProtectionColor = Themes.getAttrColor(context, R.attr.allappsHeaderProtectionColor);
|
||||
|
||||
mWorkManager = new WorkProfileManager(
|
||||
@@ -728,17 +728,29 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
|
||||
if (!mHeader.isHeaderProtectionSupported()) {
|
||||
return;
|
||||
}
|
||||
mHeaderPaint.setColor(mHeaderColor);
|
||||
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
|
||||
if (DEBUG_HEADER_PROTECTION) {
|
||||
mHeaderPaint.setColor(Color.MAGENTA);
|
||||
mHeaderPaint.setAlpha(255);
|
||||
} else {
|
||||
mHeaderPaint.setColor(mHeaderColor);
|
||||
mHeaderPaint.setAlpha((int) (getAlpha() * Color.alpha(mHeaderColor)));
|
||||
}
|
||||
if (mHeaderPaint.getColor() != mScrimColor && mHeaderPaint.getColor() != 0) {
|
||||
int bottom = getHeaderBottom();
|
||||
FloatingHeaderView headerView = getFloatingHeaderView();
|
||||
if (!mUsingTabs) {
|
||||
bottom += getFloatingHeaderView().getPaddingBottom() - mHeaderBottomAdjustment;
|
||||
// Add protection which is otherwise added when tabs scroll up.
|
||||
bottom += headerView.getTabsAdditionalPaddingTop();
|
||||
}
|
||||
canvas.drawRect(0, 0, canvas.getWidth(), bottom, mHeaderPaint);
|
||||
int tabsHeight = getFloatingHeaderView().getPeripheralProtectionHeight();
|
||||
int tabsHeight = headerView.getPeripheralProtectionHeight();
|
||||
if (mTabsProtectionAlpha > 0 && tabsHeight != 0) {
|
||||
mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha));
|
||||
if (DEBUG_HEADER_PROTECTION) {
|
||||
mHeaderPaint.setColor(Color.BLUE);
|
||||
mHeaderPaint.setAlpha(255);
|
||||
} else {
|
||||
mHeaderPaint.setAlpha((int) (getAlpha() * mTabsProtectionAlpha));
|
||||
}
|
||||
canvas.drawRect(0, bottom, canvas.getWidth(), bottom + tabsHeight, mHeaderPaint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
}
|
||||
}
|
||||
|
||||
public int getMaxTranslation() {
|
||||
int getMaxTranslation() {
|
||||
if (mMaxTranslation == 0 && (mTabsHidden || mFloatingRowsCollapsed)) {
|
||||
return getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_bottom_padding);
|
||||
} else if (mMaxTranslation > 0 && mTabsHidden) {
|
||||
@@ -334,7 +334,8 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
|
||||
int clipTop = getPaddingTop() - mTabsAdditionalPaddingTop;
|
||||
if (mTabsHidden) {
|
||||
clipTop += getPaddingBottom() - mTabsAdditionalPaddingBottom;
|
||||
// Add back spacing that is otherwise covered by the tabs.
|
||||
clipTop += mTabsAdditionalPaddingTop;
|
||||
}
|
||||
mRVClip.top = mTabsHidden || mFloatingRowsCollapsed ? clipTop : 0;
|
||||
mHeaderClip.top = clipTop;
|
||||
@@ -405,6 +406,10 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
return mFloatingRowsHeight;
|
||||
}
|
||||
|
||||
int getTabsAdditionalPaddingTop() {
|
||||
return mTabsAdditionalPaddingTop;
|
||||
}
|
||||
|
||||
int getTabsAdditionalPaddingBottom() {
|
||||
return mTabsAdditionalPaddingBottom;
|
||||
}
|
||||
@@ -473,7 +478,7 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
/**
|
||||
* Returns visible height of FloatingHeaderView contents requiring header protection
|
||||
*/
|
||||
public int getPeripheralProtectionHeight() {
|
||||
int getPeripheralProtectionHeight() {
|
||||
if (!mHeaderProtectionSupported) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user