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

Commit d390b893 authored by Adrian Roos's avatar Adrian Roos
Browse files

Fix density change bugs in SystemUI

- Reinflate KeyguardUserSwitcher on density changes.
- Update size of UserAvatar on Keyguard.
- Fix brightness slider width in quick settings.
- Refetch and rescale user icons on density changes.

Change-Id: I961c59b8b224d6ac22cbbb8e115b8a12547a04b9
Fixes: 28535987
Fixes: 28454340
parent 99aa4415
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -19,14 +19,5 @@
        android:visibility="gone"
        android:layout_height="match_parent"
        android:layout_width="match_parent">
    <com.android.keyguard.AlphaOptimizedLinearLayout
            android:id="@+id/keyguard_user_switcher_inner"
            android:orientation="vertical"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_marginTop="@dimen/status_bar_header_height_keyguard"
            android:layout_gravity="end"
            android:gravity="end"
            android:paddingTop="4dp">
    </com.android.keyguard.AlphaOptimizedLinearLayout>
    <!-- KeyguardUserSwitcher loads keyguard_user_switcher_inner.xml here -->
</view>
 No newline at end of file
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ 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/keyguard_user_switcher_inner"
    android:orientation="vertical"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:layout_marginTop="@dimen/status_bar_header_height_keyguard"
    android:layout_gravity="end"
    android:gravity="end"
    android:paddingTop="4dp">
</com.android.keyguard.AlphaOptimizedLinearLayout>
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:layout_height="48dp"
    android:layout_width="match_parent"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    style="@style/BrightnessDialogContainer">
+5 −0
Original line number Diff line number Diff line
@@ -85,6 +85,11 @@ public class KeyguardStatusBarView extends RelativeLayout
                        com.android.internal.R.dimen.text_size_small_material));
        mBatteryLevel.setTextSize(TypedValue.COMPLEX_UNIT_PX,
                getResources().getDimensionPixelSize(R.dimen.battery_level_text_size));

        MarginLayoutParams lp = (MarginLayoutParams) mMultiUserAvatar.getLayoutParams();
        lp.width = lp.height = getResources().getDimensionPixelSize(
                R.dimen.multi_user_avatar_keyguard_size);
        mMultiUserAvatar.setLayoutParams(lp);
    }

    private void loadDimens() {
+10 −1
Original line number Diff line number Diff line
@@ -966,7 +966,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        super.onDensityOrFontScaleChanged();
        mScrimController.onDensityOrFontScaleChanged();
        mStatusBarView.onDensityOrFontScaleChanged();
        if (mBrightnessMirrorController != null) {
            mBrightnessMirrorController.onDensityOrFontScaleChanged();
        }
        inflateSignalClusters();
        mIconController.onDensityOrFontScaleChanged();
        inflateDismissView();
@@ -975,6 +977,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        updateEmptyShadeView();
        inflateOverflowContainer();
        mStatusBarKeyguardViewManager.onDensityOrFontScaleChanged();
        mUserInfoController.onDensityOrFontScaleChanged();
        if (mUserSwitcherController != null) {
            mUserSwitcherController.onDensityOrFontScaleChanged();
        }
        if (mKeyguardUserSwitcher != null) {
            mKeyguardUserSwitcher.onDensityOrFontScaleChanged();
        }
    }

    private void inflateSignalClusters() {
Loading