am eb620ff6: Fix not being able to dismiss panel with single tap

* commit 'eb620ff614ed94d06a3f8395b4b873f30aeb5a08':
  Fix not being able to dismiss panel with single tap
This commit is contained in:
Jorim Jaggi
2014-08-05 19:30:59 +00:00
committed by Android Git Automerger

View File

@@ -853,6 +853,12 @@ public abstract class PanelView extends FrameLayout {
}
}
private final Runnable mPostCollapseRunnable = new Runnable() {
@Override
public void run() {
collapse();
}
};
private boolean onMiddleClicked() {
switch (mStatusBar.getBarState()) {
case StatusBarState.KEYGUARD:
@@ -862,7 +868,10 @@ public abstract class PanelView extends FrameLayout {
mStatusBar.goToKeyguard();
return true;
case StatusBarState.SHADE:
collapse();
// This gets called in the middle of the touch handling, where the state is still
// that we are tracking the panel. Collapse the panel after this is done.
post(mPostCollapseRunnable);
return false;
default:
return true;