Loading packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ --> <!-- android:background="@drawable/status_bar_closed_default_background" --> <LinearLayout <com.android.systemui.statusbar.tablet.NotificationPanel xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="match_parent" Loading @@ -46,4 +46,4 @@ > </LinearLayout> </ScrollView> </LinearLayout> </com.android.systemui.statusbar.tablet.NotificationPanel> packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java 0 → 100644 +41 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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.tablet; import android.content.Context; import android.widget.LinearLayout; import android.util.AttributeSet; public class NotificationPanel extends LinearLayout implements StatusBarPanel { public NotificationPanel(Context context, AttributeSet attrs) { this(context, attrs, 0); } public NotificationPanel(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public boolean isInContentArea(int x, int y) { final int l = getPaddingLeft(); final int r = getWidth() - getPaddingRight(); final int t = getPaddingTop(); final int b = getHeight() - getPaddingBottom(); return x >= l && x < r && y >= t && y < b; } } packages/SystemUI/src/com/android/systemui/statusbar/tablet/StatusBarPanel.java 0 → 100644 +21 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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.tablet; public interface StatusBarPanel { public boolean isInContentArea(int x, int y); } packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java +9 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ import com.android.internal.telephony.cdma.TtyIntent; import com.android.systemui.statusbar.*; import com.android.systemui.R; public class SystemPanel extends LinearLayout { public class SystemPanel extends LinearLayout implements StatusBarPanel { private static final String TAG = "SystemPanel"; private static final boolean DEBUG = TabletStatusBarService.DEBUG; private static final boolean DEBUG_SIGNAL = false; Loading Loading @@ -122,6 +122,14 @@ public class SystemPanel extends LinearLayout { boolean mDataEnabled, mDataConnected, mDataRoaming; int mDataLevel; public boolean isInContentArea(int x, int y) { final int l = getPaddingLeft(); final int r = getWidth() - getPaddingRight(); final int t = getPaddingTop(); final int b = getHeight() - getPaddingBottom(); return x >= l && x < r && y >= t && y < b; } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Loading packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java +13 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class TabletStatusBarService extends StatusBarService { View mNotificationButtons; View mSystemInfo; View mNotificationPanel; NotificationPanel mNotificationPanel; SystemPanel mSystemPanel; ViewGroup mPile; Loading Loading @@ -110,10 +110,11 @@ public class TabletStatusBarService extends StatusBarService { final int barHeight= res.getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); mNotificationPanel = View.inflate(this, R.layout.sysbar_panel_notifications, null); mNotificationPanel = (NotificationPanel)View.inflate(this, R.layout.sysbar_panel_notifications, null); mNotificationPanel.setVisibility(View.GONE); mNotificationPanel.setOnTouchListener( new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL)); new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel)); mStatusBarView.setIgnoreChildren(0, mNotificationTrigger, mNotificationPanel); Loading @@ -135,7 +136,8 @@ public class TabletStatusBarService extends StatusBarService { mSystemPanel = (SystemPanel) View.inflate(this, R.layout.sysbar_panel_system, null); mSystemPanel.setVisibility(View.GONE); mSystemPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_SYSTEM_PANEL)); mSystemPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_SYSTEM_PANEL, mSystemPanel)); mStatusBarView.setIgnoreChildren(1, mSystemInfo, mSystemPanel); Loading Loading @@ -787,13 +789,18 @@ public class TabletStatusBarService extends StatusBarService { public class TouchOutsideListener implements View.OnTouchListener { private int mMsg; private StatusBarPanel mPanel; public TouchOutsideListener(int msg) { public TouchOutsideListener(int msg, StatusBarPanel panel) { mMsg = msg; mPanel = panel; } public boolean onTouch(View v, MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_OUTSIDE) { final int action = ev.getAction(); if (action == MotionEvent.ACTION_OUTSIDE || (action == MotionEvent.ACTION_DOWN && !mPanel.isInContentArea((int)ev.getX(), (int)ev.getY()))) { mHandler.removeMessages(mMsg); mHandler.sendEmptyMessage(mMsg); return true; Loading Loading
packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml +2 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ --> <!-- android:background="@drawable/status_bar_closed_default_background" --> <LinearLayout <com.android.systemui.statusbar.tablet.NotificationPanel xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="match_parent" Loading @@ -46,4 +46,4 @@ > </LinearLayout> </ScrollView> </LinearLayout> </com.android.systemui.statusbar.tablet.NotificationPanel>
packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java 0 → 100644 +41 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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.tablet; import android.content.Context; import android.widget.LinearLayout; import android.util.AttributeSet; public class NotificationPanel extends LinearLayout implements StatusBarPanel { public NotificationPanel(Context context, AttributeSet attrs) { this(context, attrs, 0); } public NotificationPanel(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public boolean isInContentArea(int x, int y) { final int l = getPaddingLeft(); final int r = getWidth() - getPaddingRight(); final int t = getPaddingTop(); final int b = getHeight() - getPaddingBottom(); return x >= l && x < r && y >= t && y < b; } }
packages/SystemUI/src/com/android/systemui/statusbar/tablet/StatusBarPanel.java 0 → 100644 +21 −0 Original line number Diff line number Diff line /* * Copyright (C) 2010 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.tablet; public interface StatusBarPanel { public boolean isInContentArea(int x, int y); }
packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java +9 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ import com.android.internal.telephony.cdma.TtyIntent; import com.android.systemui.statusbar.*; import com.android.systemui.R; public class SystemPanel extends LinearLayout { public class SystemPanel extends LinearLayout implements StatusBarPanel { private static final String TAG = "SystemPanel"; private static final boolean DEBUG = TabletStatusBarService.DEBUG; private static final boolean DEBUG_SIGNAL = false; Loading Loading @@ -122,6 +122,14 @@ public class SystemPanel extends LinearLayout { boolean mDataEnabled, mDataConnected, mDataRoaming; int mDataLevel; public boolean isInContentArea(int x, int y) { final int l = getPaddingLeft(); final int r = getWidth() - getPaddingRight(); final int t = getPaddingTop(); final int b = getHeight() - getPaddingBottom(); return x >= l && x < r && y >= t && y < b; } private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarService.java +13 −6 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class TabletStatusBarService extends StatusBarService { View mNotificationButtons; View mSystemInfo; View mNotificationPanel; NotificationPanel mNotificationPanel; SystemPanel mSystemPanel; ViewGroup mPile; Loading Loading @@ -110,10 +110,11 @@ public class TabletStatusBarService extends StatusBarService { final int barHeight= res.getDimensionPixelSize( com.android.internal.R.dimen.status_bar_height); mNotificationPanel = View.inflate(this, R.layout.sysbar_panel_notifications, null); mNotificationPanel = (NotificationPanel)View.inflate(this, R.layout.sysbar_panel_notifications, null); mNotificationPanel.setVisibility(View.GONE); mNotificationPanel.setOnTouchListener( new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL)); new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel)); mStatusBarView.setIgnoreChildren(0, mNotificationTrigger, mNotificationPanel); Loading @@ -135,7 +136,8 @@ public class TabletStatusBarService extends StatusBarService { mSystemPanel = (SystemPanel) View.inflate(this, R.layout.sysbar_panel_system, null); mSystemPanel.setVisibility(View.GONE); mSystemPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_SYSTEM_PANEL)); mSystemPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_SYSTEM_PANEL, mSystemPanel)); mStatusBarView.setIgnoreChildren(1, mSystemInfo, mSystemPanel); Loading Loading @@ -787,13 +789,18 @@ public class TabletStatusBarService extends StatusBarService { public class TouchOutsideListener implements View.OnTouchListener { private int mMsg; private StatusBarPanel mPanel; public TouchOutsideListener(int msg) { public TouchOutsideListener(int msg, StatusBarPanel panel) { mMsg = msg; mPanel = panel; } public boolean onTouch(View v, MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_OUTSIDE) { final int action = ev.getAction(); if (action == MotionEvent.ACTION_OUTSIDE || (action == MotionEvent.ACTION_DOWN && !mPanel.isInContentArea((int)ev.getX(), (int)ev.getY()))) { mHandler.removeMessages(mMsg); mHandler.sendEmptyMessage(mMsg); return true; Loading