am f536ba51: am 93aae779: Merge "More fixes to ensure that touches outside the panel close it." into honeycomb

* commit 'f536ba516c82581e3a751dcef24f0fef7d47ffc6':
  More fixes to ensure that touches outside the panel close it.
This commit is contained in:
Daniel Sandler
2011-01-19 22:01:30 -08:00
committed by Android Git Automerger
2 changed files with 14 additions and 7 deletions

View File

@@ -23,7 +23,6 @@
android:orientation="vertical"
android:background="@drawable/notify_panel_clock_bg"
>
<ImageView
android:id="@+id/network_signal"
android:layout_height="32dp"
@@ -150,4 +149,10 @@
android:layout_marginLeft="32dp"
/>
<Button
android:id="@+id/mode_toggle"
android:background="@null"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</RelativeLayout>

View File

@@ -47,6 +47,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
boolean mShowing;
View mTitleArea;
View mModeToggle;
View mSettingsButton;
View mNotificationButton;
View mNotificationScroller;
@@ -75,7 +76,8 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
mContentParent = (ViewGroup)findViewById(R.id.content_parent);
mContentParent.bringToFront();
mTitleArea = findViewById(R.id.title_area);
mTitleArea.setOnClickListener(this);
mModeToggle = findViewById(R.id.mode_toggle);
mModeToggle.setOnClickListener(this);
mScrim = findViewById(R.id.scrim);
mGlow = findViewById(R.id.glow);
@@ -138,7 +140,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
}
public void onClick(View v) {
if (v == mTitleArea) {
if (v == mModeToggle) {
if (mSettingsView == null) {
switchToSettingsMode();
} else {
@@ -163,10 +165,10 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
}
public boolean isInContentArea(int x, int y) {
mContentArea.left = mContentFrame.getLeft();
mContentArea.top = mTitleArea.getTop();
mContentArea.right = mContentFrame.getRight();
mContentArea.bottom = mContentFrame.getBottom();
mContentArea.left = mContentFrame.getLeft() + mContentFrame.getPaddingLeft();
mContentArea.top = mTitleArea.getTop() + mTitleArea.getPaddingTop();
mContentArea.right = mContentFrame.getRight() - mContentFrame.getPaddingRight();
mContentArea.bottom = mContentFrame.getBottom() - mContentFrame.getPaddingBottom();
offsetDescendantRectToMyCoords(mContentParent, mContentArea);
return mContentArea.contains(x, y);
}