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

Commit 73c3bb13 authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge "Fixed a crash when changing font scales"

parents 58feeac9 0e8d77e0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingStart="13dp"
        android:paddingEnd="13dp"
        android:paddingStart="@dimen/shelf_icon_container_padding"
        android:paddingEnd="@dimen/shelf_icon_container_padding"
        android:gravity="center_vertical" />

    <com.android.systemui.statusbar.notification.FakeShadowView
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@
    <!-- Height of a the shelf with the notification icons -->
    <dimen name="notification_shelf_height">32dp</dimen>

    <!-- the padding of the shelf icon container -->
    <dimen name="shelf_icon_container_padding">13dp</dimen>

    <!-- The padding of a notification icon on top to the start of the notification. Used for custom
         views where the distance can't be measured -->
    <dimen name="notification_icon_appear_padding">15dp</dimen>
+6 −0
Original line number Diff line number Diff line
@@ -95,6 +95,12 @@ public class NotificationShelf extends ActivatableNotificationView {
                R.dimen.status_bar_padding_start);
        mPaddingBetweenElements = getResources().getDimensionPixelSize(
                R.dimen.notification_divider_height);
        ViewGroup.LayoutParams layoutParams = getLayoutParams();
        layoutParams.height = getResources().getDimensionPixelOffset(
                R.dimen.notification_shelf_height);
        setLayoutParams(layoutParams);
        int padding = getResources().getDimensionPixelOffset(R.dimen.shelf_icon_container_padding);
        mShelfIcons.setPadding(padding, 0, padding, 0);
    }

    @Override
+7 −5
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import android.graphics.Rect;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.FrameLayout;

import com.android.internal.util.NotificationColorUtil;
import com.android.systemui.R;
@@ -73,16 +73,18 @@ public class NotificationIconAreaController {

    public void onDensityOrFontScaleChanged(Context context) {
        reloadDimens(context);
        final LinearLayout.LayoutParams params = generateIconLayoutParams();
        final FrameLayout.LayoutParams params = generateIconLayoutParams();
        for (int i = 0; i < mNotificationIcons.getChildCount(); i++) {
            View child = mNotificationIcons.getChildAt(i);
            child.setLayoutParams(params);
            child = mShelfIcons.getChildAt(i);
            child.setLayoutParams(params);
        }
    }

    @NonNull
    private LinearLayout.LayoutParams generateIconLayoutParams() {
        return new LinearLayout.LayoutParams(
    private FrameLayout.LayoutParams generateIconLayoutParams() {
        return new FrameLayout.LayoutParams(
                mIconSize + 2 * mIconHPadding, getHeight());
    }

@@ -203,7 +205,7 @@ public class NotificationIconAreaController {
            hostLayout.removeView(toRemove.get(i));
        }

        final LinearLayout.LayoutParams params = generateIconLayoutParams();
        final FrameLayout.LayoutParams params = generateIconLayoutParams();
        for (int i = 0; i < toShow.size(); i++) {
            View v = toShow.get(i);
            // The view might still be transiently added if it was just removed and added again
+0 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        updateClearAll();
        inflateEmptyShadeView();
        updateEmptyShadeView();
        inflateShelf();
        mStatusBarKeyguardViewManager.onDensityOrFontScaleChanged();
        mUserInfoController.onDensityOrFontScaleChanged();
        if (mUserSwitcherController != null) {
Loading