Merge "Fixed a flashing when the affordances were launched" into nyc-dev
This commit is contained in:
@@ -39,6 +39,7 @@ import android.view.WindowInsets;
|
|||||||
import android.view.accessibility.AccessibilityEvent;
|
import android.view.accessibility.AccessibilityEvent;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.keyguard.KeyguardStatusView;
|
import com.android.keyguard.KeyguardStatusView;
|
||||||
import com.android.systemui.AutoReinflateContainer;
|
import com.android.systemui.AutoReinflateContainer;
|
||||||
@@ -2291,6 +2292,12 @@ public class NotificationPanelView extends PanelView implements
|
|||||||
setLaunchingAffordance(false);
|
setLaunchingAffordance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setAlpha(float alpha) {
|
||||||
|
super.setAlpha(alpha);
|
||||||
|
mNotificationStackScroller.setParentFadingOut(alpha != 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether we are currently launching an affordance. This is currently only set when
|
* Set whether we are currently launching an affordance. This is currently only set when
|
||||||
* launched via a camera gesture.
|
* launched via a camera gesture.
|
||||||
|
|||||||
@@ -3865,6 +3865,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
mScrimController.forceHideScrims(true /* hide */);
|
mScrimController.forceHideScrims(true /* hide */);
|
||||||
updateMediaMetaData(false, true);
|
updateMediaMetaData(false, true);
|
||||||
mNotificationPanel.setAlpha(1);
|
mNotificationPanel.setAlpha(1);
|
||||||
|
mStackScroller.setParentFadingOut(true);
|
||||||
mNotificationPanel.animate()
|
mNotificationPanel.animate()
|
||||||
.alpha(0)
|
.alpha(0)
|
||||||
.setStartDelay(FADE_KEYGUARD_START_DELAY)
|
.setStartDelay(FADE_KEYGUARD_START_DELAY)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class BrightnessMirrorController {
|
|||||||
|
|
||||||
public void showMirror() {
|
public void showMirror() {
|
||||||
mBrightnessMirror.setVisibility(View.VISIBLE);
|
mBrightnessMirror.setVisibility(View.VISIBLE);
|
||||||
mStackScroller.setFadedOut(true);
|
mStackScroller.setFadingOut(true);
|
||||||
mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, Interpolators.ALPHA_OUT);
|
mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, Interpolators.ALPHA_OUT);
|
||||||
outAnimation(mNotificationPanel.animate())
|
outAnimation(mNotificationPanel.animate())
|
||||||
.withLayer();
|
.withLayer();
|
||||||
@@ -67,7 +67,7 @@ public class BrightnessMirrorController {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mBrightnessMirror.setVisibility(View.INVISIBLE);
|
mBrightnessMirror.setVisibility(View.INVISIBLE);
|
||||||
mStackScroller.setFadedOut(false);
|
mStackScroller.setFadingOut(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,7 +333,8 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
|
private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
|
||||||
private boolean mPulsing;
|
private boolean mPulsing;
|
||||||
private boolean mDrawBackgroundAsSrc;
|
private boolean mDrawBackgroundAsSrc;
|
||||||
private boolean mFadedOut;
|
private boolean mFadingOut;
|
||||||
|
private boolean mParentFadingOut;
|
||||||
private boolean mGroupExpandedForMeasure;
|
private boolean mGroupExpandedForMeasure;
|
||||||
private View mForcedScroll;
|
private View mForcedScroll;
|
||||||
private float mBackgroundFadeAmount = 1.0f;
|
private float mBackgroundFadeAmount = 1.0f;
|
||||||
@@ -470,7 +471,8 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateSrcDrawing() {
|
private void updateSrcDrawing() {
|
||||||
mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && !mFadedOut ? mSrcMode : null);
|
mBackgroundPaint.setXfermode(mDrawBackgroundAsSrc && (!mFadingOut && !mParentFadingOut)
|
||||||
|
? mSrcMode : null);
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1871,7 +1873,7 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void applyCurrentBackgroundBounds() {
|
private void applyCurrentBackgroundBounds() {
|
||||||
if (!mFadedOut) {
|
if (!mFadingOut) {
|
||||||
mScrimController.setExcludedBackgroundArea(mCurrentBounds);
|
mScrimController.setExcludedBackgroundArea(mCurrentBounds);
|
||||||
}
|
}
|
||||||
invalidate();
|
invalidate();
|
||||||
@@ -3610,22 +3612,33 @@ public class NotificationStackScrollLayout extends ViewGroup
|
|||||||
updateNotificationAnimationStates();
|
updateNotificationAnimationStates();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFadedOut(boolean fadingOut) {
|
public void setFadingOut(boolean fadingOut) {
|
||||||
if (fadingOut != mFadedOut) {
|
if (fadingOut != mFadingOut) {
|
||||||
mFadedOut = fadingOut;
|
mFadingOut = fadingOut;
|
||||||
if (fadingOut) {
|
updateFadingState();
|
||||||
mScrimController.setExcludedBackgroundArea(null);
|
|
||||||
} else {
|
|
||||||
applyCurrentBackgroundBounds();
|
|
||||||
}
|
|
||||||
updateSrcDrawing();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setParentFadingOut(boolean fadingOut) {
|
||||||
|
if (fadingOut != mParentFadingOut) {
|
||||||
|
mParentFadingOut = fadingOut;
|
||||||
|
updateFadingState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateFadingState() {
|
||||||
|
if (mFadingOut || mParentFadingOut || mAmbientState.isDark()) {
|
||||||
|
mScrimController.setExcludedBackgroundArea(null);
|
||||||
|
} else {
|
||||||
|
applyCurrentBackgroundBounds();
|
||||||
|
}
|
||||||
|
updateSrcDrawing();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) {
|
public void setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) {
|
||||||
super.setAlpha(alpha);
|
super.setAlpha(alpha);
|
||||||
setFadedOut(alpha != 1.0f);
|
setFadingOut(alpha != 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user