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

Commit ba3b7089 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "Make system layout fill the window properly on expanded desktop mode" into cm-10.1

parents 641b8865 cf55b00f
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);
        }