Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 668c8970 authored by Christoph Studer's avatar Christoph Studer
Browse files

SysUI: Sort status bar notification icons

Bug: 15761406
Change-Id: I64884319014d6fa3008c0db4060db7b9b066b6d7
parent d26a20fc
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -1559,8 +1559,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            }
        }

        for (View remove : toRemove) {
            mNotificationIcons.removeView(remove);
        final int toRemoveCount = toRemove.size();
        for (int i = 0; i < toRemoveCount; i++) {
            mNotificationIcons.removeView(toRemove.get(i));
        }

        for (int i=0; i<toShow.size(); i++) {
@@ -1569,6 +1570,18 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                mNotificationIcons.addView(v, i, params);
            }
        }

        // Resort notification icons
        final int childCount = mNotificationIcons.getChildCount();
        for (int i = 0; i < childCount; i++) {
            View actual = mNotificationIcons.getChildAt(i);
            StatusBarIconView expected = toShow.get(i);
            if (actual == expected) {
                continue;
            }
            mNotificationIcons.removeView(expected);
            mNotificationIcons.addView(expected, i);
        }
    }

    @Override