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

Commit 4605b292 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "set correct bounds in ActionBar based on visibility of ActionBarView" into lmp-dev

parents c6a65dfb ccd3da23
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ public class ActionBarContainer extends FrameLayout {
    private boolean mIsTransitioning;
    private View mTabContainer;
    private View mActionBarView;
    private View mActionContextView;

    private Drawable mBackground;
    private Drawable mStackedBackground;
@@ -79,6 +80,7 @@ public class ActionBarContainer extends FrameLayout {
    public void onFinishInflate() {
        super.onFinishInflate();
        mActionBarView = findViewById(com.android.internal.R.id.action_bar);
        mActionContextView = findViewById(com.android.internal.R.id.action_context_bar);
    }

    public void setPrimaryBackground(Drawable bg) {
@@ -312,8 +314,16 @@ public class ActionBarContainer extends FrameLayout {
            }
        } else {
            if (mBackground != null) {
                if (mActionBarView.getVisibility() == View.VISIBLE) {
                    mBackground.setBounds(mActionBarView.getLeft(), mActionBarView.getTop(),
                            mActionBarView.getRight(), mActionBarView.getBottom());
                } else if (mActionContextView != null &&
                        mActionContextView.getVisibility() == View.VISIBLE) {
                    mBackground.setBounds(mActionContextView.getLeft(), mActionContextView.getTop(),
                            mActionContextView.getRight(), mActionContextView.getBottom());
                } else {
                    mBackground.setBounds(0, 0, 0, 0);
                }
                needsInvalidate = true;
            }
            mIsStacked = hasTabs;