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

Commit 8f28f669 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Forcibly recalculate size of the notification expanded view."

parents 74e3c75e cf336e10
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -103,9 +103,9 @@
                <TextView android:id="@+id/noNotificationsTitle"
                <TextView android:id="@+id/noNotificationsTitle"
                    android:layout_width="match_parent"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/title_bar_portrait"
                    android:textAppearance="@android:style/TextAppearance.Large"
                    android:paddingLeft="5dp"
                    android:padding="8dp"
                    android:textAppearance="@style/TextAppearance.StatusBar.Title"
                    android:gravity="center"
                    android:text="@string/status_bar_no_notifications_title"
                    android:text="@string/status_bar_no_notifications_title"
                    />
                    />


+5 −2
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone;


import android.content.Context;
import android.content.Context;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.util.Slog;
import android.widget.LinearLayout;
import android.widget.LinearLayout;


public class ExpandedView extends LinearLayout {
public class ExpandedView extends LinearLayout {
@@ -44,8 +45,10 @@ public class ExpandedView extends LinearLayout {
         super.onLayout(changed, left, top, right, bottom);
         super.onLayout(changed, left, top, right, bottom);
         int height = bottom - top;
         int height = bottom - top;
         if (height != mPrevHeight) {
         if (height != mPrevHeight) {
             //Slog.d(StatusBar.TAG, "height changed old=" + mPrevHeight
             if (PhoneStatusBar.DEBUG) {
             //     + " new=" + height);
                 Slog.d(PhoneStatusBar.TAG, "ExpandedView height changed old=" + mPrevHeight
                      + " new=" + height);
             }
             mPrevHeight = height;
             mPrevHeight = height;
             mService.updateExpandedViewPos(PhoneStatusBar.EXPANDED_LEAVE_ALONE);
             mService.updateExpandedViewPos(PhoneStatusBar.EXPANDED_LEAVE_ALONE);
         }
         }
+29 −1
Original line number Original line Diff line number Diff line
@@ -255,6 +255,9 @@ public class PhoneStatusBar extends StatusBar {


        ExpandedView expanded = (ExpandedView)View.inflate(context,
        ExpandedView expanded = (ExpandedView)View.inflate(context,
                R.layout.status_bar_expanded, null);
                R.layout.status_bar_expanded, null);
        if (DEBUG) {
            expanded.setBackgroundColor(0x6000FF80);
        }
        expanded.mService = this;
        expanded.mService = this;


        mIntruderAlertView = View.inflate(context, R.layout.intruder_alert, null);
        mIntruderAlertView = View.inflate(context, R.layout.intruder_alert, null);
@@ -1267,6 +1270,10 @@ public class PhoneStatusBar extends StatusBar {
            Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening);
            Slog.d(TAG, "panel: beginning to track the user's touch, y=" + y + " opening=" + opening);
        }
        }


        // there are some race conditions that cause this to be inaccurate; let's recalculate it any
        // time we're about to drag the panel
        updateExpandedSize();

        mTracking = true;
        mTracking = true;
        mVelocityTracker = VelocityTracker.obtain();
        mVelocityTracker = VelocityTracker.obtain();
        if (opening) {
        if (opening) {
@@ -1780,7 +1787,7 @@ public class PhoneStatusBar extends StatusBar {
    void updateExpandedViewPos(int expandedPosition) {
    void updateExpandedViewPos(int expandedPosition) {
        if (SPEW) {
        if (SPEW) {
            Slog.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
            Slog.d(TAG, "updateExpandedViewPos before expandedPosition=" + expandedPosition
                    + " mTrackingParams.y=" + mTrackingParams.y
                    + " mTrackingParams.y=" + ((mTrackingParams == null) ? "?" : mTrackingParams.y)
                    + " mTrackingPosition=" + mTrackingPosition);
                    + " mTrackingPosition=" + mTrackingPosition);
        }
        }


@@ -1824,6 +1831,16 @@ public class PhoneStatusBar extends StatusBar {


                mExpandedParams.y = pos + mTrackingView.getHeight()
                mExpandedParams.y = pos + mTrackingView.getHeight()
                        - (mTrackingParams.height-closePos) - contentsBottom;
                        - (mTrackingParams.height-closePos) - contentsBottom;

                if (SPEW) {
                    Slog.d(PhoneStatusBar.TAG, 
                            "pos=" + pos +
                            " trackingHeight=" + mTrackingView.getHeight() +
                            " (trackingParams.height - closePos)=" + 
                                (mTrackingParams.height - closePos) +
                            " contentsBottom=" + contentsBottom);
                }

            } else {
            } else {
                // If the tracking view is not yet visible, then we can't have
                // If the tracking view is not yet visible, then we can't have
                // a good value of the close view location.  We need to wait for
                // a good value of the close view location.  We need to wait for
@@ -1866,6 +1883,10 @@ public class PhoneStatusBar extends StatusBar {
    }
    }


    int getExpandedHeight(int disph) {
    int getExpandedHeight(int disph) {
        if (DEBUG) {
            Slog.d(TAG, "getExpandedHeight(" + disph + "): sbView="
                    + mStatusBarView.getHeight() + " closeView=" + mCloseView.getHeight());
        }
        return disph - mStatusBarView.getHeight() - mCloseView.getHeight();
        return disph - mStatusBarView.getHeight() - mCloseView.getHeight();
    }
    }


@@ -1875,6 +1896,9 @@ public class PhoneStatusBar extends StatusBar {
    }
    }


    void updateExpandedSize() {
    void updateExpandedSize() {
        if (DEBUG) {
            Slog.d(TAG, "updateExpandedSize()");
        }
        if (mExpandedDialog != null && mExpandedParams != null && mDisplaySize != null) {
        if (mExpandedDialog != null && mExpandedParams != null && mDisplaySize != null) {
            mExpandedParams.width = mDisplaySize.x;
            mExpandedParams.width = mDisplaySize.x;
            mExpandedParams.height = getExpandedHeight(mDisplaySize.y);
            mExpandedParams.height = getExpandedHeight(mDisplaySize.y);
@@ -1883,6 +1907,10 @@ public class PhoneStatusBar extends StatusBar {
            } else {
            } else {
                mExpandedDialog.getWindow().setAttributes(mExpandedParams);
                mExpandedDialog.getWindow().setAttributes(mExpandedParams);
            }
            }
            if (DEBUG) {
                Slog.d(TAG, "updateExpandedSize: height=" + mExpandedParams.height + " " + 
                    (mExpandedVisible ? "VISIBLE":"INVISIBLE"));
            }
        }
        }
    }
    }