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

Commit 75f99187 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Unify code paths for collapsing action views in action bars" into lmp-dev

parents cf038760 5352a89e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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 
     */
+0 −23
Original line number Diff line number Diff line
@@ -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();