mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Manually apply nav bar insets in DeviceProfile for tablets
- With flexible inset changes in T, taskbar is no longer inseted in getCurrentSizeRange, i.e. DeviceProfile.availableHeight no longer inset nav bar size - In order for home screen sizes to be calcualted correctly, inset nav bar manually in DeviceProfile Bug: 215528237 Test: maual in tablet gesture nav and 3 buttons Change-Id: Ia7d518613eb843f4c45ed77cefc906d7124cb367
This commit is contained in:
@@ -238,27 +238,35 @@ public class DeviceProfile {
|
||||
|
||||
isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode;
|
||||
|
||||
// Determine sizes.
|
||||
widthPx = windowBounds.bounds.width();
|
||||
heightPx = windowBounds.bounds.height();
|
||||
availableWidthPx = windowBounds.availableSize.x;
|
||||
availableHeightPx = windowBounds.availableSize.y;
|
||||
|
||||
// Determine device posture.
|
||||
mInfo = info;
|
||||
isTablet = info.isTablet(windowBounds);
|
||||
isPhone = !isTablet;
|
||||
isTwoPanels = isTablet && useTwoPanels;
|
||||
isTaskbarPresent = isTablet && ApiWrapper.TASKBAR_DRAWN_IN_PROCESS
|
||||
&& FeatureFlags.ENABLE_TASKBAR.get();
|
||||
|
||||
|
||||
aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx);
|
||||
boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
|
||||
mQsbCenterFactor = context.getResources().getFloat(R.dimen.qsb_center_factor);
|
||||
// Some more constants
|
||||
// Some more constants.
|
||||
context = getContext(context, info, isVerticalBarLayout()
|
||||
? Configuration.ORIENTATION_LANDSCAPE
|
||||
: Configuration.ORIENTATION_PORTRAIT);
|
||||
mMetrics = context.getResources().getDisplayMetrics();
|
||||
final Resources res = context.getResources();
|
||||
mMetrics = res.getDisplayMetrics();
|
||||
|
||||
// Determine sizes.
|
||||
widthPx = windowBounds.bounds.width();
|
||||
heightPx = windowBounds.bounds.height();
|
||||
availableWidthPx = windowBounds.availableSize.x;
|
||||
int taskbarInset = isTaskbarPresent
|
||||
? ResourceUtils.getNavbarSize(
|
||||
isLandscape ? "navigation_bar_height_landscape" : "navigation_bar_height",
|
||||
res)
|
||||
: 0;
|
||||
availableHeightPx = windowBounds.availableSize.y - taskbarInset;
|
||||
|
||||
aspectRatio = ((float) Math.max(widthPx, heightPx)) / Math.min(widthPx, heightPx);
|
||||
boolean isTallDevice = Float.compare(aspectRatio, TALL_DEVICE_ASPECT_RATIO_THRESHOLD) >= 0;
|
||||
mQsbCenterFactor = res.getFloat(R.dimen.qsb_center_factor);
|
||||
|
||||
if (isTwoPanels) {
|
||||
if (isLandscape) {
|
||||
@@ -274,8 +282,6 @@ public class DeviceProfile {
|
||||
}
|
||||
}
|
||||
|
||||
isTaskbarPresent = isTablet && ApiWrapper.TASKBAR_DRAWN_IN_PROCESS
|
||||
&& FeatureFlags.ENABLE_TASKBAR.get();
|
||||
if (isTaskbarPresent) {
|
||||
taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user