Loading packages/SystemUI/res/layout/keyguard_status_bar.xml +1 −2 Original line number Diff line number Diff line Loading @@ -60,9 +60,8 @@ </com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer> <FrameLayout android:id="@+id/system_icons_container" android:layout_width="0dp" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:layout_marginEnd="@dimen/status_bar_padding_end" android:gravity="center_vertical|end"> <include layout="@layout/system_icons" /> Loading packages/SystemUI/res/layout/notification_icon_area.xml +4 −13 Original line number Diff line number Diff line Loading @@ -14,18 +14,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <com.android.keyguard.AlphaOptimizedLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notification_icon_area_inner" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notificationIcons" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentStart="true" android:gravity="center_vertical" android:orientation="horizontal" android:clipChildren="false"/> No newline at end of file </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file packages/SystemUI/res/layout/status_bar.xml +91 −65 Original line number Diff line number Diff line Loading @@ -47,24 +47,35 @@ android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end" android:paddingTop="@dimen/status_bar_padding_top" android:orientation="horizontal" > android:orientation="horizontal"> <!-- Container for the entire start half of the status bar. It will always use the same width, independent of the number of visible children and sub-children. --> <FrameLayout android:id="@+id/status_bar_start_side_container" android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1"> <!-- Container that is wrapped around the views on the start half of the status bar. Its width will change with the number of visible children and sub-children. It is useful when we want to know the visible bounds of the content. --> <FrameLayout android:id="@+id/status_bar_start_side_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clipChildren="false"> <include layout="@layout/heads_up_status_bar_layout" /> <!-- The alpha of the left side is controlled by PhoneStatusBarTransitions, and the individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK and DISABLE_NOTIFICATION_ICONS, respectively --> <!-- The alpha of the start side is controlled by PhoneStatusBarTransitions, and the individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK and DISABLE_NOTIFICATION_ICONS, respectively --> <LinearLayout android:id="@+id/status_bar_left_side" android:layout_height="match_parent" android:id="@+id/status_bar_start_side_except_heads_up" android:layout_height="wrap_content" android:layout_width="match_parent" android:clipChildren="false" > android:clipChildren="false"> <ViewStub android:id="@+id/operator_name" android:layout_width="wrap_content" Loading @@ -86,14 +97,14 @@ <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/notification_icon_area" android:layout_width="0dp" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" android:clipChildren="false"/> </LinearLayout> </FrameLayout> </FrameLayout> <!-- Space should cover the notch (if it exists) and let other views lay out around it --> <android.widget.Space Loading @@ -103,13 +114,27 @@ android:gravity="center_horizontal|center_vertical" /> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area" <!-- Container for the entire end half of the status bar. It will always use the same width, independent of the number of visible children and sub-children. --> <FrameLayout android:id="@+id/status_bar_end_side_container" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clipChildren="false"> <!-- Container that is wrapped around the views on the end half of the status bar. Its width will change with the number of visible children and sub-children. It is useful when we want know the visible bounds of the content.--> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/status_bar_end_side_content" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="end" android:orientation="horizontal" android:gravity="center_vertical|end" > android:clipChildren="false"> <com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer android:id="@+id/user_switcher_container" Loading Loading @@ -139,6 +164,7 @@ <include layout="@layout/system_icons" /> </com.android.keyguard.AlphaOptimizedLinearLayout> </FrameLayout> </LinearLayout> </com.android.systemui.statusbar.phone.PhoneStatusBarView> packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +33 −5 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License */ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.phone.HeadsUpAppearanceController.CONTENT_FADE_DELAY; Loading @@ -31,6 +30,7 @@ import android.util.MathUtils; import android.util.Property; import android.view.ContextThemeWrapper; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; import androidx.annotation.VisibleForTesting; Loading @@ -40,7 +40,6 @@ import com.android.internal.statusbar.StatusBarIcon; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.statusbar.AlphaOptimizedFrameLayout; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.notification.stack.AnimationFilter; import com.android.systemui.statusbar.notification.stack.AnimationProperties; Loading @@ -54,7 +53,7 @@ import java.util.function.Consumer; * A container for notification icons. It handles overflowing icons properly and positions them * correctly on the screen. */ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { public class NotificationIconContainer extends ViewGroup { /** * A float value indicating how much before the overflow start the icons should transform into * a dot. A value of 0 means that they are exactly at the end and a value of 1 means it starts Loading Loading @@ -231,6 +230,31 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { initDimens(); } @Override public boolean hasOverlappingRendering() { // Does the same as "AlphaOptimizedFrameLayout". return false; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int childCount = getChildCount(); final int maxVisibleIcons = getMaxVisibleIcons(childCount); final int width = MeasureSpec.getSize(widthMeasureSpec); final int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED); int totalWidth = (int) (getActualPaddingStart() + getActualPaddingEnd()); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); measureChild(child, childWidthSpec, heightMeasureSpec); if (i <= maxVisibleIcons) { totalWidth += child.getMeasuredWidth(); } } final int measuredWidth = resolveSize(totalWidth, widthMeasureSpec); final int measuredHeight = MeasureSpec.getSize(heightMeasureSpec); setMeasuredDimension(measuredWidth, measuredHeight); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { float centerY = getHeight() / 2.0f; Loading Loading @@ -408,8 +432,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { float translationX = getActualPaddingStart(); int firstOverflowIndex = -1; int childCount = getChildCount(); int maxVisibleIcons = mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; int maxVisibleIcons = getMaxVisibleIcons(childCount); float layoutEnd = getLayoutEnd(); mVisualOverflowStart = 0; mFirstVisibleIconState = null; Loading Loading @@ -493,6 +516,11 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } } private int getMaxVisibleIcons(int childCount) { return mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; } private float getLayoutEnd() { return getActualWidth() - getActualPaddingEnd(); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java +5 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { private final float mIconAlphaWhenOpaque; private View mLeftSide, mStatusIcons, mBattery; private View mStartSide, mStatusIcons, mBattery; private Animator mCurrentAnimation; /** Loading @@ -41,7 +41,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { super(backgroundView, R.drawable.status_background); final Resources res = statusBarView.getContext().getResources(); mIconAlphaWhenOpaque = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1); mLeftSide = statusBarView.findViewById(R.id.status_bar_left_side); mStartSide = statusBarView.findViewById(R.id.status_bar_start_side_except_heads_up); mStatusIcons = statusBarView.findViewById(R.id.statusIcons); mBattery = statusBarView.findViewById(R.id.battery); applyModeBackground(-1, getMode(), false /*animate*/); Loading Loading @@ -75,7 +75,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { } private void applyMode(int mode, boolean animate) { if (mLeftSide == null) return; // pre-init if (mStartSide == null) return; // pre-init float newAlpha = getNonBatteryClockAlphaFor(mode); float newAlphaBC = getBatteryClockAlpha(mode); if (mCurrentAnimation != null) { Loading @@ -84,7 +84,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { if (animate) { AnimatorSet anims = new AnimatorSet(); anims.playTogether( animateTransitionTo(mLeftSide, newAlpha), animateTransitionTo(mStartSide, newAlpha), animateTransitionTo(mStatusIcons, newAlpha), animateTransitionTo(mBattery, newAlphaBC) ); Loading @@ -94,7 +94,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { anims.start(); mCurrentAnimation = anims; } else { mLeftSide.setAlpha(newAlpha); mStartSide.setAlpha(newAlpha); mStatusIcons.setAlpha(newAlpha); mBattery.setAlpha(newAlphaBC); } Loading Loading
packages/SystemUI/res/layout/keyguard_status_bar.xml +1 −2 Original line number Diff line number Diff line Loading @@ -60,9 +60,8 @@ </com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer> <FrameLayout android:id="@+id/system_icons_container" android:layout_width="0dp" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:layout_marginEnd="@dimen/status_bar_padding_end" android:gravity="center_vertical|end"> <include layout="@layout/system_icons" /> Loading
packages/SystemUI/res/layout/notification_icon_area.xml +4 −13 Original line number Diff line number Diff line Loading @@ -14,18 +14,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <com.android.keyguard.AlphaOptimizedLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notification_icon_area_inner" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false"> <com.android.systemui.statusbar.phone.NotificationIconContainer xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/notificationIcons" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentStart="true" android:gravity="center_vertical" android:orientation="horizontal" android:clipChildren="false"/> No newline at end of file </com.android.keyguard.AlphaOptimizedLinearLayout> No newline at end of file
packages/SystemUI/res/layout/status_bar.xml +91 −65 Original line number Diff line number Diff line Loading @@ -47,24 +47,35 @@ android:paddingStart="@dimen/status_bar_padding_start" android:paddingEnd="@dimen/status_bar_padding_end" android:paddingTop="@dimen/status_bar_padding_top" android:orientation="horizontal" > android:orientation="horizontal"> <!-- Container for the entire start half of the status bar. It will always use the same width, independent of the number of visible children and sub-children. --> <FrameLayout android:id="@+id/status_bar_start_side_container" android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1"> <!-- Container that is wrapped around the views on the start half of the status bar. Its width will change with the number of visible children and sub-children. It is useful when we want to know the visible bounds of the content. --> <FrameLayout android:id="@+id/status_bar_start_side_content" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clipChildren="false"> <include layout="@layout/heads_up_status_bar_layout" /> <!-- The alpha of the left side is controlled by PhoneStatusBarTransitions, and the individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK and DISABLE_NOTIFICATION_ICONS, respectively --> <!-- The alpha of the start side is controlled by PhoneStatusBarTransitions, and the individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK and DISABLE_NOTIFICATION_ICONS, respectively --> <LinearLayout android:id="@+id/status_bar_left_side" android:layout_height="match_parent" android:id="@+id/status_bar_start_side_except_heads_up" android:layout_height="wrap_content" android:layout_width="match_parent" android:clipChildren="false" > android:clipChildren="false"> <ViewStub android:id="@+id/operator_name" android:layout_width="wrap_content" Loading @@ -86,14 +97,14 @@ <com.android.systemui.statusbar.AlphaOptimizedFrameLayout android:id="@+id/notification_icon_area" android:layout_width="0dp" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="1" android:orientation="horizontal" android:clipChildren="false"/> </LinearLayout> </FrameLayout> </FrameLayout> <!-- Space should cover the notch (if it exists) and let other views lay out around it --> <android.widget.Space Loading @@ -103,13 +114,27 @@ android:gravity="center_horizontal|center_vertical" /> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area" <!-- Container for the entire end half of the status bar. It will always use the same width, independent of the number of visible children and sub-children. --> <FrameLayout android:id="@+id/status_bar_end_side_container" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:clipChildren="false"> <!-- Container that is wrapped around the views on the end half of the status bar. Its width will change with the number of visible children and sub-children. It is useful when we want know the visible bounds of the content.--> <com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/status_bar_end_side_content" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="end" android:orientation="horizontal" android:gravity="center_vertical|end" > android:clipChildren="false"> <com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer android:id="@+id/user_switcher_container" Loading Loading @@ -139,6 +164,7 @@ <include layout="@layout/system_icons" /> </com.android.keyguard.AlphaOptimizedLinearLayout> </FrameLayout> </LinearLayout> </com.android.systemui.statusbar.phone.PhoneStatusBarView>
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +33 −5 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License */ package com.android.systemui.statusbar.phone; import static com.android.systemui.statusbar.phone.HeadsUpAppearanceController.CONTENT_FADE_DELAY; Loading @@ -31,6 +30,7 @@ import android.util.MathUtils; import android.util.Property; import android.view.ContextThemeWrapper; import android.view.View; import android.view.ViewGroup; import android.view.animation.Interpolator; import androidx.annotation.VisibleForTesting; Loading @@ -40,7 +40,6 @@ import com.android.internal.statusbar.StatusBarIcon; import com.android.settingslib.Utils; import com.android.systemui.R; import com.android.systemui.animation.Interpolators; import com.android.systemui.statusbar.AlphaOptimizedFrameLayout; import com.android.systemui.statusbar.StatusBarIconView; import com.android.systemui.statusbar.notification.stack.AnimationFilter; import com.android.systemui.statusbar.notification.stack.AnimationProperties; Loading @@ -54,7 +53,7 @@ import java.util.function.Consumer; * A container for notification icons. It handles overflowing icons properly and positions them * correctly on the screen. */ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { public class NotificationIconContainer extends ViewGroup { /** * A float value indicating how much before the overflow start the icons should transform into * a dot. A value of 0 means that they are exactly at the end and a value of 1 means it starts Loading Loading @@ -231,6 +230,31 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { initDimens(); } @Override public boolean hasOverlappingRendering() { // Does the same as "AlphaOptimizedFrameLayout". return false; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int childCount = getChildCount(); final int maxVisibleIcons = getMaxVisibleIcons(childCount); final int width = MeasureSpec.getSize(widthMeasureSpec); final int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED); int totalWidth = (int) (getActualPaddingStart() + getActualPaddingEnd()); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); measureChild(child, childWidthSpec, heightMeasureSpec); if (i <= maxVisibleIcons) { totalWidth += child.getMeasuredWidth(); } } final int measuredWidth = resolveSize(totalWidth, widthMeasureSpec); final int measuredHeight = MeasureSpec.getSize(heightMeasureSpec); setMeasuredDimension(measuredWidth, measuredHeight); } @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { float centerY = getHeight() / 2.0f; Loading Loading @@ -408,8 +432,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { float translationX = getActualPaddingStart(); int firstOverflowIndex = -1; int childCount = getChildCount(); int maxVisibleIcons = mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; int maxVisibleIcons = getMaxVisibleIcons(childCount); float layoutEnd = getLayoutEnd(); mVisualOverflowStart = 0; mFirstVisibleIconState = null; Loading Loading @@ -493,6 +516,11 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout { } } private int getMaxVisibleIcons(int childCount) { return mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; } private float getLayoutEnd() { return getActualWidth() - getActualPaddingEnd(); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java +5 −5 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { private final float mIconAlphaWhenOpaque; private View mLeftSide, mStatusIcons, mBattery; private View mStartSide, mStatusIcons, mBattery; private Animator mCurrentAnimation; /** Loading @@ -41,7 +41,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { super(backgroundView, R.drawable.status_background); final Resources res = statusBarView.getContext().getResources(); mIconAlphaWhenOpaque = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1); mLeftSide = statusBarView.findViewById(R.id.status_bar_left_side); mStartSide = statusBarView.findViewById(R.id.status_bar_start_side_except_heads_up); mStatusIcons = statusBarView.findViewById(R.id.statusIcons); mBattery = statusBarView.findViewById(R.id.battery); applyModeBackground(-1, getMode(), false /*animate*/); Loading Loading @@ -75,7 +75,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { } private void applyMode(int mode, boolean animate) { if (mLeftSide == null) return; // pre-init if (mStartSide == null) return; // pre-init float newAlpha = getNonBatteryClockAlphaFor(mode); float newAlphaBC = getBatteryClockAlpha(mode); if (mCurrentAnimation != null) { Loading @@ -84,7 +84,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { if (animate) { AnimatorSet anims = new AnimatorSet(); anims.playTogether( animateTransitionTo(mLeftSide, newAlpha), animateTransitionTo(mStartSide, newAlpha), animateTransitionTo(mStatusIcons, newAlpha), animateTransitionTo(mBattery, newAlphaBC) ); Loading @@ -94,7 +94,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions { anims.start(); mCurrentAnimation = anims; } else { mLeftSide.setAlpha(newAlpha); mStartSide.setAlpha(newAlpha); mStatusIcons.setAlpha(newAlpha); mBattery.setAlpha(newAlphaBC); } Loading