Loading packages/SystemUI/res/layout-sw600dp/super_status_bar.xml +4 −2 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ --> <!-- This is the combined status bar / notification panel window. --> <FrameLayout <com.android.systemui.statusbar.phone.StatusBarWindowView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:focusable="true" android:descendantFocusability="afterDescendants" android:fitsSystemWindows="true" > Loading @@ -35,4 +37,4 @@ android:layout_height="@*android:dimen/status_bar_height" /> </FrameLayout> </com.android.systemui.statusbar.phone.StatusBarWindowView> packages/SystemUI/res/layout/super_status_bar.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ --> <!-- This is the combined status bar / notification panel window. --> <FrameLayout <com.android.systemui.statusbar.phone.StatusBarWindowView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:focusable="true" Loading @@ -36,4 +36,4 @@ android:layout_height="@*android:dimen/status_bar_height" /> </FrameLayout> </com.android.systemui.statusbar.phone.StatusBarWindowView> packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +7 −2 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class PhoneStatusBar extends BaseStatusBar { IWindowManager mWindowManager; View mStatusBarWindow; StatusBarWindowView mStatusBarWindow; PhoneStatusBarView mStatusBarView; int mPixelFormat; Loading Loading @@ -280,11 +280,12 @@ public class PhoneStatusBar extends BaseStatusBar { mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size); mStatusBarWindow = View.inflate(context, mStatusBarWindow = (StatusBarWindowView) View.inflate(context, R.layout.super_status_bar, null); if (DEBUG) { mStatusBarWindow.setBackgroundColor(0x6000FF80); } mStatusBarWindow.mService = this; mStatusBarWindow.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Loading Loading @@ -1141,10 +1142,13 @@ public class PhoneStatusBar extends BaseStatusBar { // Expand the window to encompass the full screen in anticipation of the drag. // This is only possible to do atomically because the status bar is at the top of the screen! WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams(); lp.flags &= (~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); lp.height = ViewGroup.LayoutParams.MATCH_PARENT; final WindowManager wm = WindowManagerImpl.getDefault(); wm.updateViewLayout(mStatusBarWindow, lp); mStatusBarWindow.requestFocus(View.FOCUS_FORWARD); visibilityChanged(true); } Loading Loading @@ -1231,6 +1235,7 @@ public class PhoneStatusBar extends BaseStatusBar { // Shrink the window to the size of the status bar only WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams(); lp.height = getStatusBarHeight(); lp.flags |= (WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); final WindowManager wm = WindowManagerImpl.getDefault(); wm.updateViewLayout(mStatusBarWindow, lp); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.os.SystemClock; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.phone; import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import android.widget.FrameLayout; import android.widget.TextSwitcher; public class StatusBarWindowView extends FrameLayout { PhoneStatusBar mService; public StatusBarWindowView(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean dispatchKeyEvent(KeyEvent event) { boolean down = event.getAction() == KeyEvent.ACTION_DOWN; switch (event.getKeyCode()) { case KeyEvent.KEYCODE_BACK: if (!down) { mService.animateCollapse(); } return true; } return super.dispatchKeyEvent(event); } } Loading
packages/SystemUI/res/layout-sw600dp/super_status_bar.xml +4 −2 Original line number Diff line number Diff line Loading @@ -18,9 +18,11 @@ --> <!-- This is the combined status bar / notification panel window. --> <FrameLayout <com.android.systemui.statusbar.phone.StatusBarWindowView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:focusable="true" android:descendantFocusability="afterDescendants" android:fitsSystemWindows="true" > Loading @@ -35,4 +37,4 @@ android:layout_height="@*android:dimen/status_bar_height" /> </FrameLayout> </com.android.systemui.statusbar.phone.StatusBarWindowView>
packages/SystemUI/res/layout/super_status_bar.xml +2 −2 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ --> <!-- This is the combined status bar / notification panel window. --> <FrameLayout <com.android.systemui.statusbar.phone.StatusBarWindowView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:focusable="true" Loading @@ -36,4 +36,4 @@ android:layout_height="@*android:dimen/status_bar_height" /> </FrameLayout> </com.android.systemui.statusbar.phone.StatusBarWindowView>
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +7 −2 Original line number Diff line number Diff line Loading @@ -147,7 +147,7 @@ public class PhoneStatusBar extends BaseStatusBar { IWindowManager mWindowManager; View mStatusBarWindow; StatusBarWindowView mStatusBarWindow; PhoneStatusBarView mStatusBarView; int mPixelFormat; Loading Loading @@ -280,11 +280,12 @@ public class PhoneStatusBar extends BaseStatusBar { mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size); mStatusBarWindow = View.inflate(context, mStatusBarWindow = (StatusBarWindowView) View.inflate(context, R.layout.super_status_bar, null); if (DEBUG) { mStatusBarWindow.setBackgroundColor(0x6000FF80); } mStatusBarWindow.mService = this; mStatusBarWindow.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { Loading Loading @@ -1141,10 +1142,13 @@ public class PhoneStatusBar extends BaseStatusBar { // Expand the window to encompass the full screen in anticipation of the drag. // This is only possible to do atomically because the status bar is at the top of the screen! WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams(); lp.flags &= (~WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); lp.height = ViewGroup.LayoutParams.MATCH_PARENT; final WindowManager wm = WindowManagerImpl.getDefault(); wm.updateViewLayout(mStatusBarWindow, lp); mStatusBarWindow.requestFocus(View.FOCUS_FORWARD); visibilityChanged(true); } Loading Loading @@ -1231,6 +1235,7 @@ public class PhoneStatusBar extends BaseStatusBar { // Shrink the window to the size of the status bar only WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams(); lp.height = getStatusBarHeight(); lp.flags |= (WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); final WindowManager wm = WindowManagerImpl.getDefault(); wm.updateViewLayout(mStatusBarWindow, lp); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.os.SystemClock; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java 0 → 100644 +47 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.statusbar.phone; import android.content.Context; import android.util.AttributeSet; import android.view.KeyEvent; import android.widget.FrameLayout; import android.widget.TextSwitcher; public class StatusBarWindowView extends FrameLayout { PhoneStatusBar mService; public StatusBarWindowView(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean dispatchKeyEvent(KeyEvent event) { boolean down = event.getAction() == KeyEvent.ACTION_DOWN; switch (event.getKeyCode()) { case KeyEvent.KEYCODE_BACK: if (!down) { mService.animateCollapse(); } return true; } return super.dispatchKeyEvent(event); } }