3636import android .view .View ;
3737import android .view .ViewGroup ;
3838import android .view .Surface ;
39+ import android .view .Window ;
3940import android .view .WindowManager ;
4041import android .view .WindowManagerImpl ;
4142import 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