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

Commit e03bc95f authored by Daniel Sandler's avatar Daniel Sandler
Browse files

The tiny-back-button bug found its way back in!

(Horizontal nav bars in landscape are not "vertical"; look
at the view bounds to determine verticality instead of
merely considering the device rotation.)

Bug: 5993561
Change-Id: I70a691f68db1c6417ea2af6f3bb018f99bcabda0
parent 11dea294
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.view.VelocityTracker;
import android.view.View;
import android.view.ViewGroup;
import android.view.Surface;
import android.view.Window;
import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.widget.ImageView;
@@ -311,7 +312,6 @@ public class NavigationBarView extends LinearLayout {
        }
        mCurrentView = mRotatedViews[rot];
        mCurrentView.setVisibility(View.VISIBLE);
        mVertical = (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270);

        // force the low profile & disabled states into compliance
        setLowProfile(mLowProfile, false, true /* force */);
@@ -333,6 +333,14 @@ public class NavigationBarView extends LinearLayout {
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        if (DEBUG) Slog.d(TAG, String.format(
                    "onSizeChanged: (%dx%d) old: (%dx%d)", w, h, oldw, oldh));

        final boolean newVertical = w > 0 && h > w;
        if (newVertical != mVertical) {
            mVertical = newVertical;
            //Slog.v(TAG, String.format("onSizeChanged: h=%d, w=%d, vert=%s", h, w, mVertical?"y":"n"));
            reorient();
        }

        postCheckForInvalidLayout("sizeChanged");
        super.onSizeChanged(w, h, oldw, oldh);
    }