Merge "Unify code paths for collapsing action views in action bars" into lmp-dev
This commit is contained in:
@@ -925,6 +925,15 @@ public class WindowDecorActionBar extends ActionBar implements
|
||||
public void onContentScrollStopped() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean collapseActionView() {
|
||||
if (mDecorToolbar != null && mDecorToolbar.hasExpandedActionView()) {
|
||||
mDecorToolbar.collapseActionView();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -184,8 +184,6 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar
|
||||
Build.VERSION_CODES.KITKAT;
|
||||
|
||||
mFlingEstimator = new OverScroller(context);
|
||||
|
||||
setFocusableInTouchMode(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -660,27 +658,6 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar
|
||||
return finalY > mActionBarTop.getHeight();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||
if (super.dispatchKeyEvent(event)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
|
||||
final int action = event.getAction();
|
||||
|
||||
// Collapse any expanded action views.
|
||||
if (mDecorToolbar != null && mDecorToolbar.hasExpandedActionView()) {
|
||||
if (action == KeyEvent.ACTION_UP) {
|
||||
mDecorToolbar.collapseActionView();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWindowCallback(Window.Callback cb) {
|
||||
pullChildren();
|
||||
|
||||
Reference in New Issue
Block a user