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 ;
@@ -142,6 +143,7 @@ public class PhoneStatusBar extends BaseStatusBar {
142143 int mIconSize = -1 ;
143144 int mIconHPadding = -1 ;
144145 Display mDisplay ;
146+ Point mCurrentDisplaySize = new Point ();
145147
146148 IDreamManager mDreamManager ;
147149
@@ -168,10 +170,9 @@ public class PhoneStatusBar extends BaseStatusBar {
168170 PanelView mNotificationPanel ; // the sliding/resizing panel within the notification window
169171 ScrollView mScrollView ;
170172 View mExpandedContents ;
171- final Rect mNotificationPanelBackgroundPadding = new Rect ();
172173 int mNotificationPanelGravity ;
173174 int mNotificationPanelMarginBottomPx , mNotificationPanelMarginPx ;
174- int mNotificationPanelMinHeight ;
175+ float mNotificationPanelMinHeightFrac ;
175176 boolean mNotificationPanelIsFullScreenWidth ;
176177 TextView mNotificationPanelDebugText ;
177178
@@ -1640,12 +1641,17 @@ protected int getExpandedViewMaxHeight() {
16401641
16411642 @ Override
16421643 public void updateExpandedViewPos (int thingy ) {
1643- // TODO
16441644 if (DEBUG ) Slog .v (TAG , "updateExpandedViewPos" );
1645+
1646+ // on larger devices, the notification panel is propped open a bit
1647+ mNotificationPanel .setMinimumHeight (
1648+ (int )(mNotificationPanelMinHeightFrac * mCurrentDisplaySize .y ));
1649+
16451650 FrameLayout .LayoutParams lp = (FrameLayout .LayoutParams ) mNotificationPanel .getLayoutParams ();
16461651 lp .gravity = mNotificationPanelGravity ;
16471652 lp .leftMargin = mNotificationPanelMarginPx ;
16481653 mNotificationPanel .setLayoutParams (lp );
1654+
16491655 lp = (FrameLayout .LayoutParams ) mSettingsPanel .getLayoutParams ();
16501656 lp .gravity = mSettingsPanelGravity ;
16511657 lp .rightMargin = mNotificationPanelMarginPx ;
@@ -1777,6 +1783,8 @@ else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
17771783 if (DEBUG ) {
17781784 Slog .v (TAG , "configuration changed: " + mContext .getResources ().getConfiguration ());
17791785 }
1786+ mDisplay .getSize (mCurrentDisplaySize );
1787+
17801788 updateResources ();
17811789 repositionNavigationBar ();
17821790 updateExpandedViewPos (EXPANDED_LEAVE_ALONE );
@@ -1885,27 +1893,16 @@ protected void loadDimens() {
18851893 if (mSettingsPanelGravity <= 0 ) {
18861894 mSettingsPanelGravity = Gravity .RIGHT | Gravity .TOP ;
18871895 }
1888- getNinePatchPadding (res .getDrawable (R .drawable .notification_panel_bg ), mNotificationPanelBackgroundPadding );
1889- final int notificationPanelDecorationHeight =
1890- res .getDimensionPixelSize (R .dimen .notification_panel_padding_top )
1891- + res .getDimensionPixelSize (R .dimen .notification_panel_header_height )
1892- + mNotificationPanelBackgroundPadding .top
1893- + mNotificationPanelBackgroundPadding .bottom ;
1894- mNotificationPanelMinHeight =
1895- notificationPanelDecorationHeight
1896- + res .getDimensionPixelSize (R .dimen .close_handle_underlap );
18971896
18981897 mCarrierLabelHeight = res .getDimensionPixelSize (R .dimen .carrier_label_height );
18991898 mNotificationHeaderHeight = res .getDimensionPixelSize (R .dimen .notification_panel_header_height );
19001899
1901- if (false ) Slog .v (TAG , "updateResources" );
1902- }
1903-
1904- private static void getNinePatchPadding (Drawable d , Rect outPadding ) {
1905- if (d instanceof NinePatchDrawable ) {
1906- NinePatchDrawable ninePatch = (NinePatchDrawable ) d ;
1907- ninePatch .getPadding (outPadding );
1900+ mNotificationPanelMinHeightFrac = res .getFraction (R .dimen .notification_panel_min_height_frac , 1 , 1 );
1901+ if (mNotificationPanelMinHeightFrac < 0f || mNotificationPanelMinHeightFrac > 1f ) {
1902+ mNotificationPanelMinHeightFrac = 0f ;
19081903 }
1904+
1905+ if (false ) Slog .v (TAG , "updateResources" );
19091906 }
19101907
19111908 //
0 commit comments