Only reorient nav bar if needed
Bug: 30388298 Change-Id: Ifda69682fd00ed11ce21b439d12d3b432db1eca7
This commit is contained in:
@@ -65,6 +65,7 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
|
|
||||||
boolean mVertical;
|
boolean mVertical;
|
||||||
boolean mScreenOn;
|
boolean mScreenOn;
|
||||||
|
private int mCurrentRotation = -1;
|
||||||
|
|
||||||
boolean mShowMenu;
|
boolean mShowMenu;
|
||||||
int mDisabledFlags = 0;
|
int mDisabledFlags = 0;
|
||||||
@@ -526,6 +527,10 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
updateCurrentView();
|
updateCurrentView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean needsReorient() {
|
||||||
|
return mCurrentRotation != mDisplay.getRotation();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateCurrentView() {
|
private void updateCurrentView() {
|
||||||
final int rot = mDisplay.getRotation();
|
final int rot = mDisplay.getRotation();
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
@@ -538,6 +543,7 @@ public class NavigationBarView extends LinearLayout {
|
|||||||
mButtonDisatchers.valueAt(i).setCurrentView(mCurrentView);
|
mButtonDisatchers.valueAt(i).setCurrentView(mCurrentView);
|
||||||
}
|
}
|
||||||
updateLayoutTransitionsEnabled();
|
updateLayoutTransitionsEnabled();
|
||||||
|
mCurrentRotation = rot;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRecentsIcon() {
|
private void updateRecentsIcon() {
|
||||||
|
|||||||
@@ -3548,7 +3548,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisplayChanged(int displayId) {
|
public void onDisplayChanged(int displayId) {
|
||||||
if (displayId == Display.DEFAULT_DISPLAY) {
|
if (displayId == Display.DEFAULT_DISPLAY
|
||||||
|
&& mNavigationBarView != null && mNavigationBarView.needsReorient()) {
|
||||||
repositionNavigationBar();
|
repositionNavigationBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user