Merge "Fixed a bug where notification icons were not animating when dozing" into nyc-dev

This commit is contained in:
Selim Cinek
2016-03-09 20:51:52 +00:00
committed by Android (Google) Code Review
2 changed files with 23 additions and 3 deletions

View File

@@ -4494,7 +4494,20 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
private void handlePulseWhileDozing(@NonNull PulseCallback callback, int reason) {
mDozeScrimController.pulse(callback, reason);
mDozeScrimController.pulse(new PulseCallback() {
@Override
public void onPulseStarted() {
callback.onPulseStarted();
mStackScroller.setPulsing(true);
}
@Override
public void onPulseFinished() {
callback.onPulseFinished();
mStackScroller.setPulsing(false);
}
}, reason);
}
private void handleStopDozing() {

View File

@@ -324,6 +324,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
};
private PorterDuffXfermode mSrcMode = new PorterDuffXfermode(PorterDuff.Mode.SRC);
private boolean mPulsing;
public NotificationStackScrollLayout(Context context) {
this(context, null);
@@ -2194,7 +2195,7 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private void updateNotificationAnimationStates() {
boolean running = mAnimationsEnabled;
boolean running = mAnimationsEnabled || mPulsing;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
@@ -2204,7 +2205,8 @@ public class NotificationStackScrollLayout extends ViewGroup
}
private void updateAnimationState(View child) {
updateAnimationState(mAnimationsEnabled && (mIsExpanded || isPinnedHeadsUp(child)), child);
updateAnimationState((mAnimationsEnabled || mPulsing)
&& (mIsExpanded || isPinnedHeadsUp(child)), child);
}
@@ -3322,6 +3324,11 @@ public class NotificationStackScrollLayout extends ViewGroup
return mIsExpanded;
}
public void setPulsing(boolean pulsing) {
mPulsing = pulsing;
updateNotificationAnimationStates();
}
/**
* A listener that is notified when some child locations might have changed.
*/