Fix hotseat width to span a number of columns
Fix: 227344807 Fix: 231283023 Test: manual Change-Id: Iad0f38c2323be6d9752a8e509fc7e1164edbcf4e
This commit is contained in:
1 parent
50b4ddc3f0
commit
425f6828f1
11 files changed
+103
-48
No files matched your search
@@ -154,6 +154,8 @@ public class InvariantDeviceProfile {
|
||||
*/
|
||||
public int numDatabaseHotseatIcons;
|
||||
|
||||
public int[] hotseatColumnSpan;
|
||||
|
||||
/**
|
||||
* Number of columns in the all apps list.
|
||||
*/
|
||||
@@ -357,6 +359,7 @@ public class InvariantDeviceProfile {
|
||||
numShrunkenHotseatIcons = closestProfile.numShrunkenHotseatIcons;
|
||||
numDatabaseHotseatIcons = deviceType == TYPE_MULTI_DISPLAY
|
||||
? closestProfile.numDatabaseHotseatIcons : closestProfile.numHotseatIcons;
|
||||
hotseatColumnSpan = closestProfile.hotseatColumnSpan;
|
||||
hotseatBorderSpaces = displayOption.hotseatBorderSpaces;
|
||||
|
||||
numAllAppsColumns = closestProfile.numAllAppsColumns;
|
||||
@@ -398,7 +401,8 @@ public class InvariantDeviceProfile {
|
||||
// We need to ensure that there is enough extra space in the wallpaper
|
||||
// for the intended parallax effects
|
||||
float parallaxFactor =
|
||||
dpiFromPx(Math.min(displayWidth, displayHeight), displayInfo.densityDpi) < 720
|
||||
dpiFromPx(Math.min(displayWidth, displayHeight), displayInfo.getDensityDpi())
|
||||
< 720
|
||||
? 2
|
||||
: wallpaperTravelToScreenWidthRatio(displayWidth, displayHeight);
|
||||
defaultWallpaperSize.x =
|
||||
@@ -587,8 +591,8 @@ public class InvariantDeviceProfile {
|
||||
}
|
||||
}
|
||||
|
||||
float width = dpiFromPx(minWidthPx, displayInfo.densityDpi);
|
||||
float height = dpiFromPx(minHeightPx, displayInfo.densityDpi);
|
||||
float width = dpiFromPx(minWidthPx, displayInfo.getDensityDpi());
|
||||
float height = dpiFromPx(minHeightPx, displayInfo.getDensityDpi());
|
||||
|
||||
// Sort the profiles based on the closeness to the device size
|
||||
Collections.sort(points, (a, b) ->
|
||||
@@ -735,6 +739,7 @@ public class InvariantDeviceProfile {
|
||||
private final int numHotseatIcons;
|
||||
private final int numShrunkenHotseatIcons;
|
||||
private final int numDatabaseHotseatIcons;
|
||||
private final int[] hotseatColumnSpan = new int[COUNT_SIZES];
|
||||
|
||||
private final String dbFile;
|
||||
|
||||
@@ -774,6 +779,16 @@ public class InvariantDeviceProfile {
|
||||
R.styleable.GridDisplayOption_numShrunkenHotseatIcons, numHotseatIcons / 2);
|
||||
numDatabaseHotseatIcons = a.getInt(
|
||||
R.styleable.GridDisplayOption_numExtendedHotseatIcons, 2 * numHotseatIcons);
|
||||
hotseatColumnSpan[INDEX_DEFAULT] = a.getInt(
|
||||
R.styleable.GridDisplayOption_hotseatColumnSpan, numColumns);
|
||||
hotseatColumnSpan[INDEX_LANDSCAPE] = a.getInt(
|
||||
R.styleable.GridDisplayOption_hotseatColumnSpanLandscape, numColumns);
|
||||
hotseatColumnSpan[INDEX_TWO_PANEL_LANDSCAPE] = a.getInt(
|
||||
R.styleable.GridDisplayOption_hotseatColumnSpanTwoPanelLandscape,
|
||||
numColumns);
|
||||
hotseatColumnSpan[INDEX_TWO_PANEL_PORTRAIT] = a.getInt(
|
||||
R.styleable.GridDisplayOption_hotseatColumnSpanTwoPanelPortrait,
|
||||
numColumns);
|
||||
|
||||
numFolderRows = a.getInt(
|
||||
R.styleable.GridDisplayOption_numFolderRows, numRows);
|
||||
@@ -821,6 +836,7 @@ public class InvariantDeviceProfile {
|
||||
private float folderBorderSpace;
|
||||
private final PointF[] borderSpaces = new PointF[COUNT_SIZES];
|
||||
private final float[] horizontalMargin = new float[COUNT_SIZES];
|
||||
//TODO(http://b/228998082) remove this when 3 button spaces are fixed
|
||||
private final float[] hotseatBorderSpaces = new float[COUNT_SIZES];
|
||||
|
||||
private final float[] iconSizes = new float[COUNT_SIZES];
|
||||
|
||||
Reference in new issue
Block a user