mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Revert^3 "Maximised the taskbar window to the default size"" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
6ba50e36e4
@@ -1296,25 +1296,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the TaskbarContainer size, using the maximum of the provided {@code size}
|
||||
* and the default size from {@link #getDefaultTaskbarWindowSize()}.
|
||||
* Updates the TaskbarContainer size (pass {@link #getDefaultTaskbarWindowSize()} to reset).
|
||||
*/
|
||||
public void setTaskbarWindowSize(int size) {
|
||||
// In landscape phone button nav mode, we should set the task bar width instead of height
|
||||
// because this is the only case in which the nav bar is not on the display bottom.
|
||||
int windowSize = size;
|
||||
if (windowSize != MATCH_PARENT) {
|
||||
windowSize = Math.max(size, getDefaultTaskbarWindowSize());
|
||||
}
|
||||
boolean landscapePhoneButtonNav = isPhoneButtonNavMode() && mDeviceProfile.isLandscape;
|
||||
if ((landscapePhoneButtonNav ? mWindowLayoutParams.width : mWindowLayoutParams.height)
|
||||
== windowSize || mIsDestroyed) {
|
||||
== size || mIsDestroyed) {
|
||||
return;
|
||||
}
|
||||
if (windowSize == MATCH_PARENT) {
|
||||
windowSize = mDeviceProfile.heightPx;
|
||||
if (size == MATCH_PARENT) {
|
||||
size = mDeviceProfile.heightPx;
|
||||
} else {
|
||||
mLastRequestedNonFullscreenSize = windowSize;
|
||||
mLastRequestedNonFullscreenSize = size;
|
||||
if (mIsFullscreen || mIsTaskbarSizeFrozenForAnimatingBubble) {
|
||||
// We either still need to be fullscreen or a bubble is still animating, so defer
|
||||
// any change to our height until setTaskbarWindowFullscreen(false) is called or
|
||||
@@ -1326,14 +1321,14 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
}
|
||||
}
|
||||
if (landscapePhoneButtonNav) {
|
||||
mWindowLayoutParams.width = windowSize;
|
||||
mWindowLayoutParams.width = size;
|
||||
for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) {
|
||||
mWindowLayoutParams.paramsForRotation[rot].width = windowSize;
|
||||
mWindowLayoutParams.paramsForRotation[rot].width = size;
|
||||
}
|
||||
} else {
|
||||
mWindowLayoutParams.height = windowSize;
|
||||
mWindowLayoutParams.height = size;
|
||||
for (int rot = Surface.ROTATION_0; rot <= Surface.ROTATION_270; rot++) {
|
||||
mWindowLayoutParams.paramsForRotation[rot].height = windowSize;
|
||||
mWindowLayoutParams.paramsForRotation[rot].height = size;
|
||||
}
|
||||
}
|
||||
mControllers.runAfterInit(
|
||||
|
||||
Reference in New Issue
Block a user