Merge "Use only current density to check isTablet" into sc-v2-dev am: 7ba828c1a9 am: 8d3d6b1961
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16306379 Change-Id: I66dd05d8c193cebfafa2095f986d8ea2bc3f9c57
This commit is contained in:
commit
af43216f0d
4 files changed
+26
-20
No files matched your search
@@ -16,13 +16,10 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE;
|
||||
|
||||
import static com.android.launcher3.ResourceUtils.pxFromDp;
|
||||
import static com.android.launcher3.Utilities.dpiFromPx;
|
||||
import static com.android.launcher3.Utilities.pxFromSp;
|
||||
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR;
|
||||
import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -64,7 +61,6 @@ public class DeviceProfile {
|
||||
public final boolean isPhone;
|
||||
public final boolean transposeLayoutWithOrientation;
|
||||
public final boolean isTwoPanels;
|
||||
public final boolean allowRotation;
|
||||
|
||||
// Device properties in current orientation
|
||||
public final boolean isLandscape;
|
||||
@@ -244,12 +240,7 @@ public class DeviceProfile {
|
||||
availableHeightPx = windowBounds.availableSize.y;
|
||||
|
||||
mInfo = info;
|
||||
// If the device's pixel density was scaled (usually via settings for A11y), use the
|
||||
// original dimensions to determine if rotation is allowed of not.
|
||||
float originalSmallestWidth = dpiFromPx(Math.min(widthPx, heightPx), DENSITY_DEVICE_STABLE);
|
||||
allowRotation = originalSmallestWidth >= MIN_TABLET_WIDTH;
|
||||
// Tablet UI does not support emulated landscape.
|
||||
isTablet = allowRotation && info.isTablet(windowBounds);
|
||||
isTablet = info.isTablet(windowBounds);
|
||||
isPhone = !isTablet;
|
||||
isTwoPanels = isTablet && useTwoPanels;
|
||||
|
||||
@@ -1032,7 +1023,6 @@ public class DeviceProfile {
|
||||
writer.println(prefix + "DeviceProfile:");
|
||||
writer.println(prefix + "\t1 dp = " + mMetrics.density + " px");
|
||||
|
||||
writer.println(prefix + "\tallowRotation:" + allowRotation);
|
||||
writer.println(prefix + "\tisTablet:" + isTablet);
|
||||
writer.println(prefix + "\tisPhone:" + isPhone);
|
||||
writer.println(prefix + "\ttransposeLayoutWithOrientation:"
|
||||
|
||||
Reference in new issue
Block a user