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

Commit 2ed08d2e authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Dismiss the ticker early if the status bar is tapped.

Tapping the ticker will still launch the notification's
contentIntent, but tapping anywhere else in the bar will
immediately hide the ticker.

Bug: 3365129
Change-Id: Ic1abd38fd4c5bdf32f3586b4e4aa5b833b11a9bd
parent 8c989184
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -94,6 +94,7 @@ public class TabletStatusBar extends StatusBar implements
    public static final int MSG_HIDE_CHROME = 1031;
    public static final int MSG_HIDE_CHROME = 1031;
    public static final int MSG_OPEN_INPUT_METHODS_PANEL = 1040;
    public static final int MSG_OPEN_INPUT_METHODS_PANEL = 1040;
    public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041;
    public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041;
    public static final int MSG_STOP_TICKER = 2000;


    // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach
    // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach
    private static final boolean FAKE_SPACE_BAR = true;
    private static final boolean FAKE_SPACE_BAR = true;
@@ -581,6 +582,9 @@ public class TabletStatusBar extends StatusBar implements
                    mShadow.setVisibility(View.VISIBLE);
                    mShadow.setVisibility(View.VISIBLE);
                    notifyLightsChanged(false);
                    notifyLightsChanged(false);
                    break;
                    break;
                case MSG_STOP_TICKER:
                    mTicker.halt();
                    break;
            }
            }
        }
        }
    }
    }
+2 −0
Original line number Original line Diff line number Diff line
@@ -51,6 +51,8 @@ public class TabletStatusBarView extends FrameLayout {
            mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL);
            mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL);
            mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
            mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
            mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
            mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL);
            mHandler.removeMessages(TabletStatusBar.MSG_STOP_TICKER);
            mHandler.sendEmptyMessage(TabletStatusBar.MSG_STOP_TICKER);


            for (int i=0; i < mPanels.length; i++) {
            for (int i=0; i < mPanels.length; i++) {
                if (mPanels[i] != null && mPanels[i].getVisibility() == View.VISIBLE) {
                if (mPanels[i] != null && mPanels[i].getVisibility() == View.VISIBLE) {