Skip to content

Commit e03bc95

Browse files
committed
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
1 parent 11dea29 commit e03bc95

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import android.view.View;
3737
import android.view.ViewGroup;
3838
import android.view.Surface;
39+
import android.view.Window;
3940
import android.view.WindowManager;
4041
import android.view.WindowManagerImpl;
4142
import android.widget.ImageView;
@@ -73,7 +74,7 @@ public class NavigationBarView extends LinearLayout {
7374
int mNavigationIconHints = 0;
7475

7576
private Drawable mBackIcon, mBackLandIcon, mBackAltIcon, mBackAltLandIcon;
76-
77+
7778
private DelegateViewHelper mDelegateHelper;
7879

7980
// workaround for LayoutTransitions leaving the nav buttons in a weird state (bug 5549288)
@@ -311,7 +312,6 @@ public void reorient() {
311312
}
312313
mCurrentView = mRotatedViews[rot];
313314
mCurrentView.setVisibility(View.VISIBLE);
314-
mVertical = (rot == Surface.ROTATION_90 || rot == Surface.ROTATION_270);
315315

316316
// force the low profile & disabled states into compliance
317317
setLowProfile(mLowProfile, false, true /* force */);
@@ -333,6 +333,14 @@ public void reorient() {
333333
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
334334
if (DEBUG) Slog.d(TAG, String.format(
335335
"onSizeChanged: (%dx%d) old: (%dx%d)", w, h, oldw, oldh));
336+
337+
final boolean newVertical = w > 0 && h > w;
338+
if (newVertical != mVertical) {
339+
mVertical = newVertical;
340+
//Slog.v(TAG, String.format("onSizeChanged: h=%d, w=%d, vert=%s", h, w, mVertical?"y":"n"));
341+
reorient();
342+
}
343+
336344
postCheckForInvalidLayout("sizeChanged");
337345
super.onSizeChanged(w, h, oldw, oldh);
338346
}

0 commit comments

Comments
 (0)