3333import android .graphics .Canvas ;
3434import android .graphics .ColorFilter ;
3535import android .graphics .PixelFormat ;
36+ import android .graphics .Point ;
3637import android .graphics .PorterDuff ;
3738import android .graphics .Rect ;
3839import android .graphics .drawable .Drawable ;
@@ -143,6 +144,7 @@ public class PhoneStatusBar extends BaseStatusBar {
143144 int mIconSize = -1 ;
144145 int mIconHPadding = -1 ;
145146 Display mDisplay ;
147+ Point mCurrentDisplaySize = new Point ();
146148
147149 IDreamManager mDreamManager ;
148150
@@ -169,10 +171,9 @@ public class PhoneStatusBar extends BaseStatusBar {
169171 PanelView mNotificationPanel ; // the sliding/resizing panel within the notification window
170172 ScrollView mScrollView ;
171173 View mExpandedContents ;
172- final Rect mNotificationPanelBackgroundPadding = new Rect ();
173174 int mNotificationPanelGravity ;
174175 int mNotificationPanelMarginBottomPx , mNotificationPanelMarginPx ;
175- int mNotificationPanelMinHeight ;
176+ float mNotificationPanelMinHeightFrac ;
176177 boolean mNotificationPanelIsFullScreenWidth ;
177178 TextView mNotificationPanelDebugText ;
178179
@@ -1644,12 +1645,17 @@ protected int getExpandedViewMaxHeight() {
16441645
16451646 @ Override
16461647 public void updateExpandedViewPos (int thingy ) {
1647- // TODO
16481648 if (DEBUG ) Slog .v (TAG , "updateExpandedViewPos" );
1649+
1650+ // on larger devices, the notification panel is propped open a bit
1651+ mNotificationPanel .setMinimumHeight (
1652+ (int )(mNotificationPanelMinHeightFrac * mCurrentDisplaySize .y ));
1653+
16491654 FrameLayout .LayoutParams lp = (FrameLayout .LayoutParams ) mNotificationPanel .getLayoutParams ();
16501655 lp .gravity = mNotificationPanelGravity ;
16511656 lp .leftMargin = mNotificationPanelMarginPx ;
16521657 mNotificationPanel .setLayoutParams (lp );
1658+
16531659 lp = (FrameLayout .LayoutParams ) mSettingsPanel .getLayoutParams ();
16541660 lp .gravity = mSettingsPanelGravity ;
16551661 lp .rightMargin = mNotificationPanelMarginPx ;
@@ -1781,6 +1787,8 @@ else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
17811787 if (DEBUG ) {
17821788 Slog .v (TAG , "configuration changed: " + mContext .getResources ().getConfiguration ());
17831789 }
1790+ mDisplay .getSize (mCurrentDisplaySize );
1791+
17841792 updateResources ();
17851793 repositionNavigationBar ();
17861794 updateExpandedViewPos (EXPANDED_LEAVE_ALONE );
@@ -1889,27 +1897,16 @@ protected void loadDimens() {
18891897 if (mSettingsPanelGravity <= 0 ) {
18901898 mSettingsPanelGravity = Gravity .RIGHT | Gravity .TOP ;
18911899 }
1892- getNinePatchPadding (res .getDrawable (R .drawable .notification_panel_bg ), mNotificationPanelBackgroundPadding );
1893- final int notificationPanelDecorationHeight =
1894- res .getDimensionPixelSize (R .dimen .notification_panel_padding_top )
1895- + res .getDimensionPixelSize (R .dimen .notification_panel_header_height )
1896- + mNotificationPanelBackgroundPadding .top
1897- + mNotificationPanelBackgroundPadding .bottom ;
1898- mNotificationPanelMinHeight =
1899- notificationPanelDecorationHeight
1900- + res .getDimensionPixelSize (R .dimen .close_handle_underlap );
19011900
19021901 mCarrierLabelHeight = res .getDimensionPixelSize (R .dimen .carrier_label_height );
19031902 mNotificationHeaderHeight = res .getDimensionPixelSize (R .dimen .notification_panel_header_height );
19041903
1905- if (false ) Slog .v (TAG , "updateResources" );
1906- }
1907-
1908- private static void getNinePatchPadding (Drawable d , Rect outPadding ) {
1909- if (d instanceof NinePatchDrawable ) {
1910- NinePatchDrawable ninePatch = (NinePatchDrawable ) d ;
1911- ninePatch .getPadding (outPadding );
1904+ mNotificationPanelMinHeightFrac = res .getFraction (R .dimen .notification_panel_min_height_frac , 1 , 1 );
1905+ if (mNotificationPanelMinHeightFrac < 0f || mNotificationPanelMinHeightFrac > 1f ) {
1906+ mNotificationPanelMinHeightFrac = 0f ;
19121907 }
1908+
1909+ if (false ) Slog .v (TAG , "updateResources" );
19131910 }
19141911
19151912 //
0 commit comments