Allow taps on the ticker to pass through to the notification target view

so the notification panel still opens.

Bug: 3313762
Change-Id: Ia4e869b859fabe7016283f36631891c179dc82bf
This commit is contained in:
Joe Onorato
2011-01-04 16:33:01 -08:00
parent 6c3e5601a7
commit ec51a82bd6
4 changed files with 41 additions and 26 deletions

View File

@@ -25,30 +25,39 @@
android:layout_alignParentRight="true"
android:orientation="horizontal"
>
<com.android.systemui.statusbar.tablet.InputMethodButton
android:id="@+id/imeSwitchButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dip"
android:src="@drawable/ic_sysbar_ime_default"
android:visibility="gone"
/>
<com.android.systemui.statusbar.tablet.NotificationIconArea
android:id="@+id/notificationIcons"
<LinearLayout
android:id="@+id/notificationAndImeArea"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<view
class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout"
android:id="@+id/icons"
<com.android.systemui.statusbar.tablet.InputMethodButton
android:id="@+id/imeSwitchButton"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingTop="5dp"
android:layout_marginLeft="8dp"
android:layout_marginLeft="8dip"
android:src="@drawable/ic_sysbar_ime_default"
android:visibility="gone"
/>
</com.android.systemui.statusbar.tablet.NotificationIconArea>
<com.android.systemui.statusbar.tablet.NotificationIconArea
android:id="@+id/notificationIcons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<view
class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout"
android:id="@+id/icons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:paddingTop="5dp"
android:layout_marginLeft="8dp"
/>
</com.android.systemui.statusbar.tablet.NotificationIconArea>
</LinearLayout>
<LinearLayout
android:id="@+id/notificationTrigger"

View File

@@ -119,6 +119,7 @@ public class TabletStatusBar extends StatusBar {
View mMenuButton;
View mRecentButton;
ViewGroup mNotificationAndImeArea;
InputMethodButton mInputMethodSwitchButton;
NotificationPanel mNotificationPanel;
@@ -344,6 +345,7 @@ public class TabletStatusBar extends StatusBar {
mRecentButton.setOnClickListener(mOnClickListener);
// The bar contents buttons
mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea);
mInputMethodSwitchButton = (InputMethodButton) sb.findViewById(R.id.imeSwitchButton);
// for redirecting errant bar taps to the IME
@@ -718,15 +720,14 @@ public class TabletStatusBar extends StatusBar {
if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_TICKER))) {
mTicker.add(key, n);
mNotificationArea.setVisibility(View.GONE);
mNotificationAndImeArea.setVisibility(View.GONE);
}
}
}
// called by TabletTicker when it's done with all queued ticks
public void doneTicking() {
mNotificationArea.setVisibility(View.VISIBLE);
mNotificationAndImeArea.setVisibility(View.VISIBLE);
}
public void animateExpand() {

View File

@@ -60,6 +60,7 @@ public class TabletStatusBarView extends FrameLayout {
}
}
}
Slog.d(TabletStatusBar.TAG, "TabletStatusBarView not intercepting event");
return super.onInterceptTouchEvent(ev);
}

View File

@@ -53,7 +53,7 @@ public class TabletTicker
private static final String TAG = "StatusBar.TabletTicker";
private static final boolean CLICKABLE_TICKER = true;
private static final boolean CLICKABLE_TICKER = false;
// 3 is enough to let us see most cases, but not get so far behind that it's too annoying.
private static final int QUEUE_LENGTH = 3;
@@ -209,12 +209,16 @@ public class TabletTicker
final FrameLayout view = new FrameLayout(mContext);
final int width = res.getDimensionPixelSize(R.dimen.notification_ticker_width);
final int height = res.getDimensionPixelSize(R.dimen.notification_large_icon_height);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height,
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
int windowFlags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
| WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
| WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
if (CLICKABLE_TICKER) {
windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
} else {
windowFlags |= WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE;
}
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(width, height,
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, windowFlags,
PixelFormat.TRANSLUCENT);
lp.gravity = Gravity.BOTTOM | Gravity.RIGHT;
// lp.windowAnimations = com.android.internal.R.style.Animation_Toast;