Fixed an issue where added icons were white in multiwindow
Because it wasn't laid out yet, icons would appear white.
Change-Id: I9338966299de253f36ae325553e82b76defe3b9d
Fixes: 66711268
Test: add icon with light statusbar in multiwindow, icon looks normal
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 2cff79d..9fa5dcd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -43,6 +43,7 @@
import android.util.Log;
import android.util.Property;
import android.util.TypedValue;
+import android.view.View;
import android.view.ViewDebug;
import android.view.accessibility.AccessibilityEvent;
import android.view.animation.Interpolator;
@@ -142,6 +143,7 @@
private float[] mMatrix;
private ColorMatrixColorFilter mMatrixColorFilter;
private boolean mIsInShelf;
+ private Runnable mLayoutRunnable;
public StatusBarIconView(Context context, String slot, StatusBarNotification sbn) {
this(context, slot, sbn, false);
@@ -804,6 +806,19 @@
return mIsInShelf;
}
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ if (mLayoutRunnable != null) {
+ mLayoutRunnable.run();
+ mLayoutRunnable = null;
+ }
+ }
+
+ public void executeOnLayout(Runnable runnable) {
+ mLayoutRunnable = runnable;
+ }
+
public interface OnVisibilityChangedListener {
void onVisibilityChanged(int newVisibility);
}