Merge "Simulate extra navigation bar for fixed rotation" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b4fabe9b08
@@ -1521,31 +1521,51 @@ public class DisplayPolicy {
|
|||||||
* some temporal states, but doesn't change the window frames used to show on screen.
|
* some temporal states, but doesn't change the window frames used to show on screen.
|
||||||
*/
|
*/
|
||||||
void simulateLayoutDisplay(DisplayFrames displayFrames, SparseArray<Rect> barContentFrames) {
|
void simulateLayoutDisplay(DisplayFrames displayFrames, SparseArray<Rect> barContentFrames) {
|
||||||
if (mNavigationBar != null) {
|
|
||||||
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
|
||||||
if (INSETS_LAYOUT_GENERALIZATION) {
|
if (INSETS_LAYOUT_GENERALIZATION) {
|
||||||
simulateLayoutDecorWindow(mNavigationBar, displayFrames, simulatedWindowFrames,
|
final InsetsStateController insetsStateController =
|
||||||
|
mDisplayContent.getInsetsStateController();
|
||||||
|
for (int type = 0; type < InsetsState.SIZE; type++) {
|
||||||
|
final InsetsSourceProvider provider =
|
||||||
|
insetsStateController.peekSourceProvider(type);
|
||||||
|
if (provider == null || !provider.hasWindow()
|
||||||
|
|| provider.mWin.getControllableInsetProvider() != provider) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
||||||
|
simulateLayoutDecorWindow(provider.mWin, displayFrames, simulatedWindowFrames,
|
||||||
barContentFrames,
|
barContentFrames,
|
||||||
contentFrame -> simulateLayoutForContentFrame(displayFrames,
|
contentFrame -> simulateLayoutForContentFrame(displayFrames,
|
||||||
mNavigationBar, contentFrame));
|
provider.mWin, contentFrame));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (mNavigationBar != null) {
|
||||||
|
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
||||||
simulateLayoutDecorWindow(mNavigationBar, displayFrames, simulatedWindowFrames,
|
simulateLayoutDecorWindow(mNavigationBar, displayFrames, simulatedWindowFrames,
|
||||||
barContentFrames, contentFrame -> layoutNavigationBar(displayFrames,
|
barContentFrames, contentFrame -> layoutNavigationBar(displayFrames,
|
||||||
contentFrame));
|
contentFrame));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (mStatusBar != null) {
|
if (mStatusBar != null) {
|
||||||
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
||||||
if (INSETS_LAYOUT_GENERALIZATION) {
|
|
||||||
simulateLayoutDecorWindow(mStatusBar, displayFrames, simulatedWindowFrames,
|
|
||||||
barContentFrames,
|
|
||||||
contentFrame -> simulateLayoutForContentFrame(displayFrames,
|
|
||||||
mStatusBar, contentFrame));
|
|
||||||
} else {
|
|
||||||
simulateLayoutDecorWindow(mStatusBar, displayFrames, simulatedWindowFrames,
|
simulateLayoutDecorWindow(mStatusBar, displayFrames, simulatedWindowFrames,
|
||||||
barContentFrames,
|
barContentFrames,
|
||||||
contentFrame -> layoutStatusBar(displayFrames, contentFrame));
|
contentFrame -> layoutStatusBar(displayFrames, contentFrame));
|
||||||
}
|
}
|
||||||
|
if (mExtraNavBarAlt != null) {
|
||||||
|
// There's no pre-defined behavior for the extra navigation bar, we need to use the
|
||||||
|
// new flexible insets logic anyway.
|
||||||
|
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
||||||
|
simulateLayoutDecorWindow(mExtraNavBarAlt, displayFrames, simulatedWindowFrames,
|
||||||
|
barContentFrames,
|
||||||
|
contentFrame -> simulateLayoutForContentFrame(displayFrames,
|
||||||
|
mExtraNavBarAlt, contentFrame));
|
||||||
|
}
|
||||||
|
if (mClimateBarAlt != null) {
|
||||||
|
final WindowFrames simulatedWindowFrames = new WindowFrames();
|
||||||
|
simulateLayoutDecorWindow(mClimateBarAlt, displayFrames, simulatedWindowFrames,
|
||||||
|
barContentFrames,
|
||||||
|
contentFrame -> simulateLayoutForContentFrame(displayFrames,
|
||||||
|
mClimateBarAlt, contentFrame));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user