Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec51a82b authored by Joe Onorato's avatar Joe Onorato
Browse files

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

so the notification panel still opens.

Bug: 3313762
Change-Id: Ia4e869b859fabe7016283f36631891c179dc82bf
parent 6c3e5601
Loading
Loading
Loading
Loading
+26 −17
Original line number Diff line number Diff line
@@ -25,6 +25,14 @@
    android:layout_alignParentRight="true"
    android:orientation="horizontal"
    >

    <LinearLayout
        android:id="@+id/notificationAndImeArea"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:orientation="horizontal"
        >

        <com.android.systemui.statusbar.tablet.InputMethodButton
            android:id="@+id/imeSwitchButton"
            android:layout_width="wrap_content"
@@ -49,6 +57,7 @@
                android:layout_marginLeft="8dp"
                />
        </com.android.systemui.statusbar.tablet.NotificationIconArea>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/notificationTrigger"
+4 −3
Original line number Diff line number Diff line
@@ -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() {
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ public class TabletStatusBarView extends FrameLayout {
                }
            }
        }
        Slog.d(TabletStatusBar.TAG, "TabletStatusBarView not intercepting event");
        return super.onInterceptTouchEvent(ev);
    }

+10 −6
Original line number Diff line number Diff line
@@ -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;