Merge "Do not animate status bar icons outside of shade" into qt-dev
am: 38d017b0d6
Change-Id: Ie62bfc316443017a99dfac46ffe60968cde54b43
This commit is contained in:
@@ -929,7 +929,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
|
||||
|
||||
public void setAnimationsEnabled(boolean enabled) {
|
||||
mAnimationsEnabled = enabled;
|
||||
mCollapsedIcons.setAnimationsEnabled(enabled);
|
||||
if (!enabled) {
|
||||
// we need to wait with enabling the animations until the first frame has passed
|
||||
mShelfIcons.setAnimationsEnabled(false);
|
||||
|
||||
@@ -3223,6 +3223,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
|
||||
private void updateNotificationAnimationStates() {
|
||||
boolean running = mAnimationsEnabled || hasPulsingNotifications();
|
||||
mShelf.setAnimationsEnabled(running);
|
||||
mIconAreaController.setAnimationsEnabled(running);
|
||||
int childCount = getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
View child = getChildAt(i);
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.android.systemui.statusbar.NotificationListener;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.NotificationShelf;
|
||||
import com.android.systemui.statusbar.StatusBarIconView;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.NotificationUtils;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
@@ -78,6 +79,7 @@ public class NotificationIconAreaController implements DarkReceiver,
|
||||
private Context mContext;
|
||||
private boolean mFullyDark;
|
||||
private boolean mShowLowPriority = true;
|
||||
private boolean mAnimationsEnabled;
|
||||
|
||||
/**
|
||||
* Ratio representing being awake or in ambient mode, where 1 is dark and 0 awake.
|
||||
@@ -283,6 +285,25 @@ public class NotificationIconAreaController implements DarkReceiver,
|
||||
false /* hide centered icon */);
|
||||
}
|
||||
|
||||
/**
|
||||
* If icons of the status bar should animate when they are added or removed.
|
||||
*/
|
||||
public void setAnimationsEnabled(boolean enabled) {
|
||||
mAnimationsEnabled = enabled;
|
||||
updateAnimations();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStateChanged(int newState) {
|
||||
updateAnimations();
|
||||
}
|
||||
|
||||
private void updateAnimations() {
|
||||
boolean inShade = mStatusBarStateController.getState() == StatusBarState.SHADE;
|
||||
mCenteredIcon.setAnimationsEnabled(mAnimationsEnabled && inShade);
|
||||
mNotificationIcons.setAnimationsEnabled(mAnimationsEnabled && inShade);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
boolean shouldShouldLowPriorityIcons() {
|
||||
return mShowLowPriority;
|
||||
|
||||
@@ -315,7 +315,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
|
||||
@Override
|
||||
public void onViewRemoved(View child) {
|
||||
super.onViewRemoved(child);
|
||||
if (child instanceof StatusBarIconView) {
|
||||
if (mAnimationsEnabled && child instanceof StatusBarIconView) {
|
||||
boolean isReplacingIcon = isReplacingIcon(child);
|
||||
final StatusBarIconView icon = (StatusBarIconView) child;
|
||||
if (icon.getVisibleState() != StatusBarIconView.STATE_HIDDEN
|
||||
|
||||
Reference in New Issue
Block a user