Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf55b00f authored by Chanhee Lee's avatar Chanhee Lee Committed by DvTonder
Browse files

Make system layout fill the window properly on expanded desktop mode

This commit fixes e.g. the gap on the bottom of the lock screen
or the gap on the right side of status bar on landscape mode.

Patch set 2  : Remove whitespace issues
Patch set 3  : Code cleanup
Patch set 4  : Damn whitespace errors

Change-Id: Ic8a6b748f94d7dcc883201579d199898713c90fd
parent 640a0d3c
Loading
Loading
Loading
Loading
+38 −2
Original line number Diff line number Diff line
/*
 * File modifications copyright (C) 2012 The CyanogenMod Project
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (C) 2012-2013 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -1436,7 +1437,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                            MSG_ENABLE_POINTER_LOCATION : MSG_DISABLE_POINTER_LOCATION);
                }
            }
            // use screen off timeout setting as the timeout for the lockscreen

            // Use screen off timeout setting as the timeout for the lockscreen
            mLockScreenTimeout = Settings.System.getIntForUser(resolver,
                    Settings.System.SCREEN_OFF_TIMEOUT, 0, UserHandle.USER_CURRENT);
            String imId = Settings.Secure.getStringForUser(resolver,
@@ -1446,7 +1448,41 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                mHasSoftInput = hasSoftInput;
                updateRotation = true;
            }

            // Update navigation bar dimensions
            boolean desktopExpanded = Settings.System.getInt(mContext.getContentResolver(),
                    Settings.System.EXPANDED_DESKTOP_STATE, 0) == 1;
            if (desktopExpanded) {
                // Set the navigation bar's dimensions to 0 in expanded desktop mode
                mNavigationBarWidthForRotation[mPortraitRotation]
                        = mNavigationBarWidthForRotation[mUpsideDownRotation]
                        = mNavigationBarWidthForRotation[mLandscapeRotation]
                        = mNavigationBarWidthForRotation[mSeascapeRotation]
                        = mNavigationBarHeightForRotation[mPortraitRotation]
                        = mNavigationBarHeightForRotation[mUpsideDownRotation]
                        = mNavigationBarHeightForRotation[mLandscapeRotation]
                        = mNavigationBarHeightForRotation[mSeascapeRotation] = 0;
            } else {
                // Height of the navigation bar when presented horizontally at bottom
                mNavigationBarHeightForRotation[mPortraitRotation] =
                mNavigationBarHeightForRotation[mUpsideDownRotation] =
                        mContext.getResources().getDimensionPixelSize(
                                com.android.internal.R.dimen.navigation_bar_height);
                mNavigationBarHeightForRotation[mLandscapeRotation] =
                mNavigationBarHeightForRotation[mSeascapeRotation] =
                        mContext.getResources().getDimensionPixelSize(
                                com.android.internal.R.dimen.navigation_bar_height_landscape);

                // Width of the navigation bar when presented vertically along one side
                mNavigationBarWidthForRotation[mPortraitRotation] =
                mNavigationBarWidthForRotation[mUpsideDownRotation] =
                mNavigationBarWidthForRotation[mLandscapeRotation] =
                mNavigationBarWidthForRotation[mSeascapeRotation] =
                        mContext.getResources().getDimensionPixelSize(
                                com.android.internal.R.dimen.navigation_bar_width);
            }
        }

        if (updateRotation) {
            updateRotation(true);
        }