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

Commit 185b6f64 authored by Anthony Chen's avatar Anthony Chen
Browse files

Fix bug where the wrong width was being set on the

NotificationPanelView.

The QS panel and notification panel now have different widths; so, need
to pass the correct one when reloading it.

Test: booted up on AAE headunit and phone
Change-Id: I9aef0c6725dd1969fabedaa3f08bf01811f52d6b
parent 0941be7c
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.Fragment;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.support.annotation.DimenRes;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewStub;
@@ -32,7 +33,6 @@ import com.android.systemui.SysUiServiceProvider;
import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
import com.android.systemui.plugins.qs.QS;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.statusbar.NotificationData.Entry;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
@@ -91,14 +91,16 @@ public class NotificationsQuickSettingsContainer extends FrameLayout
    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        reloadWidth(mQsFrame);
        reloadWidth(mStackScroller);
        reloadWidth(mQsFrame, R.dimen.qs_panel_width);
        reloadWidth(mStackScroller, R.dimen.notification_panel_width);
    }

    private void reloadWidth(View view) {
    /**
     * Loads the given width resource and sets it on the given View.
     */
    private void reloadWidth(View view, @DimenRes int width) {
        LayoutParams params = (LayoutParams) view.getLayoutParams();
        params.width = getContext().getResources().getDimensionPixelSize(
                R.dimen.qs_panel_width);
        params.width = getResources().getDimensionPixelSize(width);
        view.setLayoutParams(params);
    }