@@ -169,12 +169,16 @@ public class PhoneStatusBar extends BaseStatusBar {
169169 PanelView mNotificationPanel ; // the sliding/resizing panel within the notification window
170170 ScrollView mScrollView ;
171171 View mExpandedContents ;
172- int mNotificationPanelMarginBottomPx , mNotificationPanelMarginLeftPx ;
173172 final Rect mNotificationPanelBackgroundPadding = new Rect ();
174173 int mNotificationPanelGravity ;
174+ int mNotificationPanelMarginBottomPx , mNotificationPanelMarginPx ;
175175 int mNotificationPanelMinHeight ;
176176 boolean mNotificationPanelIsFullScreenWidth ;
177177
178+ // settings
179+ PanelView mSettingsPanel ;
180+ int mSettingsPanelGravity ;
181+
178182 // top bar
179183 View mClearButton ;
180184 View mSettingsButton ;
@@ -310,22 +314,29 @@ public boolean onTouch(View v, MotionEvent event) {
310314
311315 mNotificationPanel = (PanelView ) mStatusBarWindow .findViewById (R .id .notification_panel );
312316 // don't allow clicks on the panel to pass through to the background where they will cause the panel to close
313- mNotificationPanel . setOnTouchListener ( new View .OnTouchListener () {
317+ View . OnTouchListener clickStopper = new View .OnTouchListener () {
314318 @ Override
315319 public boolean onTouch (View v , MotionEvent event ) {
316320 return true ;
317321 }
318- });
322+ };
323+ mNotificationPanel .setOnTouchListener (clickStopper );
319324 mNotificationPanelIsFullScreenWidth =
320325 (mNotificationPanel .getLayoutParams ().width == ViewGroup .LayoutParams .MATCH_PARENT );
321326 mNotificationPanel .setSystemUiVisibility (
322327 View .STATUS_BAR_DISABLE_NOTIFICATION_TICKER
323328 | (mNotificationPanelIsFullScreenWidth ? 0 : View .STATUS_BAR_DISABLE_SYSTEM_INFO ));
324329
330+ // quick settings (WIP)
331+ mSettingsPanel = (PanelView ) mStatusBarWindow .findViewById (R .id .settings_panel );
332+ mSettingsPanel .setOnTouchListener (clickStopper );
333+
325334 if (!ActivityManager .isHighEndGfx (mDisplay )) {
326335 mStatusBarWindow .setBackground (null );
327336 mNotificationPanel .setBackground (new FastColorDrawable (context .getResources ().getColor (
328337 R .color .notification_panel_solid_background )));
338+ mSettingsPanel .setBackground (new FastColorDrawable (context .getResources ().getColor (
339+ R .color .notification_panel_solid_background )));
329340 }
330341 if (ENABLE_INTRUDERS ) {
331342 mIntruderAlertView = (IntruderAlertView ) View .inflate (context , R .layout .intruder_alert , null );
@@ -1634,8 +1645,12 @@ public void updateExpandedViewPos(int thingy) {
16341645 if (DEBUG ) Slog .v (TAG , "updateExpandedViewPos" );
16351646 FrameLayout .LayoutParams lp = (FrameLayout .LayoutParams ) mNotificationPanel .getLayoutParams ();
16361647 lp .gravity = mNotificationPanelGravity ;
1637- lp .leftMargin = mNotificationPanelMarginLeftPx ;
1648+ lp .leftMargin = mNotificationPanelMarginPx ;
16381649 mNotificationPanel .setLayoutParams (lp );
1650+ lp = (FrameLayout .LayoutParams ) mSettingsPanel .getLayoutParams ();
1651+ lp .gravity = mSettingsPanelGravity ;
1652+ lp .rightMargin = mNotificationPanelMarginPx ;
1653+ mSettingsPanel .setLayoutParams (lp );
16391654 }
16401655
16411656 // called by makeStatusbar and also by PhoneStatusBarView
@@ -1872,11 +1887,15 @@ protected void loadDimens() {
18721887
18731888 mNotificationPanelMarginBottomPx
18741889 = (int ) res .getDimension (R .dimen .notification_panel_margin_bottom );
1875- mNotificationPanelMarginLeftPx
1890+ mNotificationPanelMarginPx
18761891 = (int ) res .getDimension (R .dimen .notification_panel_margin_left );
18771892 mNotificationPanelGravity = res .getInteger (R .integer .notification_panel_layout_gravity );
18781893 if (mNotificationPanelGravity <= 0 ) {
1879- mNotificationPanelGravity = Gravity .CENTER_VERTICAL | Gravity .TOP ;
1894+ mNotificationPanelGravity = Gravity .LEFT | Gravity .TOP ;
1895+ }
1896+ mSettingsPanelGravity = res .getInteger (R .integer .settings_panel_layout_gravity );
1897+ if (mSettingsPanelGravity <= 0 ) {
1898+ mSettingsPanelGravity = Gravity .RIGHT | Gravity .TOP ;
18801899 }
18811900 getNinePatchPadding (res .getDrawable (R .drawable .notification_panel_bg ), mNotificationPanelBackgroundPadding );
18821901 final int notificationPanelDecorationHeight =
0 commit comments