Merge "Adding support for dynamically resolved default layouts." into ub-now-nova
This commit is contained in:
@@ -58,4 +58,59 @@
|
|||||||
launcher:y="3" />
|
launcher:y="3" />
|
||||||
|
|
||||||
<!-- Far-right screen [4] -->
|
<!-- Far-right screen [4] -->
|
||||||
|
|
||||||
|
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
|
||||||
|
<!-- Dialer, Contacts, [All Apps], Messaging, Browser -->
|
||||||
|
<resolve
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="0"
|
||||||
|
launcher:x="0"
|
||||||
|
launcher:y="0" >
|
||||||
|
<favorite launcher:uri="#Intent;action=android.intent.action.DIAL;end" />
|
||||||
|
<favorite launcher:uri="tel:123" />
|
||||||
|
<favorite launcher:uri="#Intent;action=android.intent.action.CALL_BUTTON;end" />
|
||||||
|
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.dialer"
|
||||||
|
launcher:className="com.android.dialer.DialtactsActivity" />
|
||||||
|
</resolve>
|
||||||
|
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.contacts"
|
||||||
|
launcher:className="com.android.contacts.activities.PeopleActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="1"
|
||||||
|
launcher:x="1"
|
||||||
|
launcher:y="0" />
|
||||||
|
|
||||||
|
<resolve
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="3"
|
||||||
|
launcher:x="3"
|
||||||
|
launcher:y="0" >
|
||||||
|
<favorite
|
||||||
|
launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_MESSAGING;end" />
|
||||||
|
<favorite launcher:uri="sms:" />
|
||||||
|
<favorite launcher:uri="smsto:" />
|
||||||
|
<favorite launcher:uri="mms:" />
|
||||||
|
<favorite launcher:uri="mmsto:" />
|
||||||
|
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.mms"
|
||||||
|
launcher:className="com.android.mms.ui.ConversationList" />
|
||||||
|
</resolve>
|
||||||
|
<resolve
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="4"
|
||||||
|
launcher:x="4"
|
||||||
|
launcher:y="0" >
|
||||||
|
<favorite
|
||||||
|
launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
|
||||||
|
<favorite launcher:uri="http://www.example.com/" />
|
||||||
|
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.browser"
|
||||||
|
launcher:className="com.android.browser.BrowserActivity" />
|
||||||
|
</resolve>
|
||||||
|
|
||||||
</favorites>
|
</favorites>
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2013 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
|
||||||
|
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
|
||||||
|
<!-- Dialer Hangouts Maps Chrome Camera -->
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.dialer"
|
||||||
|
launcher:className="com.google.android.dialer.extensions.GoogleDialtactsActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="1"
|
||||||
|
launcher:x="1"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.talk"
|
||||||
|
launcher:className="com.google.android.talk.SigningInActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="2"
|
||||||
|
launcher:x="2"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.apps.maps"
|
||||||
|
launcher:className="com.google.android.maps.MapsActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="3"
|
||||||
|
launcher:x="3"
|
||||||
|
launcher:y="0"/>
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.chrome"
|
||||||
|
launcher:className="com.google.android.apps.chrome.Main"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="4"
|
||||||
|
launcher:x="4"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.GoogleCamera"
|
||||||
|
launcher:className="com.android.camera.CameraLauncher"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="5"
|
||||||
|
launcher:x="5"
|
||||||
|
launcher:y="0" />
|
||||||
|
</favorites>
|
||||||
|
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2013 The Android Open Source Project
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
|
||||||
|
<!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
|
||||||
|
<!-- Dialer Hangouts Maps Chrome Camera -->
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.dialer"
|
||||||
|
launcher:className="com.google.android.dialer.extensions.GoogleDialtactsActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="1"
|
||||||
|
launcher:x="1"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.talk"
|
||||||
|
launcher:className="com.google.android.talk.SigningInActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="2"
|
||||||
|
launcher:x="2"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.apps.maps"
|
||||||
|
launcher:className="com.google.android.maps.MapsActivity"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="3"
|
||||||
|
launcher:x="3"
|
||||||
|
launcher:y="0"/>
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.android.chrome"
|
||||||
|
launcher:className="com.google.android.apps.chrome.Main"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="4"
|
||||||
|
launcher:x="4"
|
||||||
|
launcher:y="0" />
|
||||||
|
<favorite
|
||||||
|
launcher:packageName="com.google.android.GoogleCamera"
|
||||||
|
launcher:className="com.android.camera.CameraLauncher"
|
||||||
|
launcher:container="-101"
|
||||||
|
launcher:screen="5"
|
||||||
|
launcher:x="5"
|
||||||
|
launcher:y="0" />
|
||||||
|
</favorites>
|
||||||
|
|
||||||
@@ -43,16 +43,18 @@ import java.util.Comparator;
|
|||||||
|
|
||||||
|
|
||||||
class DeviceProfileQuery {
|
class DeviceProfileQuery {
|
||||||
|
DeviceProfile profile;
|
||||||
float widthDps;
|
float widthDps;
|
||||||
float heightDps;
|
float heightDps;
|
||||||
float value;
|
float value;
|
||||||
PointF dimens;
|
PointF dimens;
|
||||||
|
|
||||||
DeviceProfileQuery(float w, float h, float v) {
|
DeviceProfileQuery(DeviceProfile p, float v) {
|
||||||
widthDps = w;
|
widthDps = p.minWidthDps;
|
||||||
heightDps = h;
|
heightDps = p.minHeightDps;
|
||||||
value = v;
|
value = v;
|
||||||
dimens = new PointF(w, h);
|
dimens = new PointF(widthDps, heightDps);
|
||||||
|
profile = p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +74,9 @@ public class DeviceProfile {
|
|||||||
private int iconDrawablePaddingOriginalPx;
|
private int iconDrawablePaddingOriginalPx;
|
||||||
private float hotseatIconSize;
|
private float hotseatIconSize;
|
||||||
|
|
||||||
|
int defaultLayoutId;
|
||||||
|
int defaultNoAllAppsLayoutId;
|
||||||
|
|
||||||
boolean isLandscape;
|
boolean isLandscape;
|
||||||
boolean isTablet;
|
boolean isTablet;
|
||||||
boolean isLargeTablet;
|
boolean isLargeTablet;
|
||||||
@@ -127,7 +132,7 @@ public class DeviceProfile {
|
|||||||
private ArrayList<DeviceProfileCallbacks> mCallbacks = new ArrayList<DeviceProfileCallbacks>();
|
private ArrayList<DeviceProfileCallbacks> mCallbacks = new ArrayList<DeviceProfileCallbacks>();
|
||||||
|
|
||||||
DeviceProfile(String n, float w, float h, float r, float c,
|
DeviceProfile(String n, float w, float h, float r, float c,
|
||||||
float is, float its, float hs, float his) {
|
float is, float its, float hs, float his, int dlId, int dnalId) {
|
||||||
// Ensure that we have an odd number of hotseat items (since we need to place all apps)
|
// Ensure that we have an odd number of hotseat items (since we need to place all apps)
|
||||||
if (!LauncherAppState.isDisableAllApps() && hs % 2 == 0) {
|
if (!LauncherAppState.isDisableAllApps() && hs % 2 == 0) {
|
||||||
throw new RuntimeException("All Device Profiles must have an odd number of hotseat spaces");
|
throw new RuntimeException("All Device Profiles must have an odd number of hotseat spaces");
|
||||||
@@ -142,6 +147,8 @@ public class DeviceProfile {
|
|||||||
iconTextSize = its;
|
iconTextSize = its;
|
||||||
numHotseatIcons = hs;
|
numHotseatIcons = hs;
|
||||||
hotseatIconSize = his;
|
hotseatIconSize = his;
|
||||||
|
defaultLayoutId = dlId;
|
||||||
|
defaultNoAllAppsLayoutId = dnalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceProfile(Context context,
|
DeviceProfile(Context context,
|
||||||
@@ -182,29 +189,32 @@ public class DeviceProfile {
|
|||||||
overviewModeScaleFactor =
|
overviewModeScaleFactor =
|
||||||
res.getInteger(R.integer.config_dynamic_grid_overview_scale_percentage) / 100f;
|
res.getInteger(R.integer.config_dynamic_grid_overview_scale_percentage) / 100f;
|
||||||
|
|
||||||
// Interpolate the rows
|
// Find the closes profile given the width/height
|
||||||
for (DeviceProfile p : profiles) {
|
for (DeviceProfile p : profiles) {
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.numRows));
|
points.add(new DeviceProfileQuery(p, 0f));
|
||||||
}
|
}
|
||||||
numRows = Math.round(invDistWeightedInterpolate(minWidth, minHeight, points));
|
DeviceProfile closestProfile = findClosestDeviceProfile(minWidth, minHeight, points);
|
||||||
// Interpolate the columns
|
|
||||||
points.clear();
|
// Snap to the closest row count
|
||||||
for (DeviceProfile p : profiles) {
|
numRows = closestProfile.numRows;
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.numColumns));
|
|
||||||
}
|
// Snap to the closest column count
|
||||||
numColumns = Math.round(invDistWeightedInterpolate(minWidth, minHeight, points));
|
numColumns = closestProfile.numColumns;
|
||||||
// Interpolate the hotseat length
|
|
||||||
points.clear();
|
// Snap to the closest hotseat size
|
||||||
for (DeviceProfile p : profiles) {
|
numHotseatIcons = closestProfile.numHotseatIcons;
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.numHotseatIcons));
|
|
||||||
}
|
|
||||||
numHotseatIcons = Math.round(invDistWeightedInterpolate(minWidth, minHeight, points));
|
|
||||||
hotseatAllAppsRank = (int) (numHotseatIcons / 2);
|
hotseatAllAppsRank = (int) (numHotseatIcons / 2);
|
||||||
|
|
||||||
|
// Snap to the closest default layout id
|
||||||
|
defaultLayoutId = closestProfile.defaultLayoutId;
|
||||||
|
|
||||||
|
// Snap to the closest default no all-apps layout id
|
||||||
|
defaultNoAllAppsLayoutId = closestProfile.defaultNoAllAppsLayoutId;
|
||||||
|
|
||||||
// Interpolate the icon size
|
// Interpolate the icon size
|
||||||
points.clear();
|
points.clear();
|
||||||
for (DeviceProfile p : profiles) {
|
for (DeviceProfile p : profiles) {
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.iconSize));
|
points.add(new DeviceProfileQuery(p, p.iconSize));
|
||||||
}
|
}
|
||||||
iconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
iconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
||||||
// AllApps uses the original non-scaled icon size
|
// AllApps uses the original non-scaled icon size
|
||||||
@@ -213,7 +223,7 @@ public class DeviceProfile {
|
|||||||
// Interpolate the icon text size
|
// Interpolate the icon text size
|
||||||
points.clear();
|
points.clear();
|
||||||
for (DeviceProfile p : profiles) {
|
for (DeviceProfile p : profiles) {
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.iconTextSize));
|
points.add(new DeviceProfileQuery(p, p.iconTextSize));
|
||||||
}
|
}
|
||||||
iconTextSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
iconTextSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
||||||
iconDrawablePaddingOriginalPx =
|
iconDrawablePaddingOriginalPx =
|
||||||
@@ -224,7 +234,7 @@ public class DeviceProfile {
|
|||||||
// Interpolate the hotseat icon size
|
// Interpolate the hotseat icon size
|
||||||
points.clear();
|
points.clear();
|
||||||
for (DeviceProfile p : profiles) {
|
for (DeviceProfile p : profiles) {
|
||||||
points.add(new DeviceProfileQuery(p.minWidthDps, p.minHeightDps, p.hotseatIconSize));
|
points.add(new DeviceProfileQuery(p, p.hotseatIconSize));
|
||||||
}
|
}
|
||||||
// Hotseat
|
// Hotseat
|
||||||
hotseatIconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
hotseatIconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
|
||||||
@@ -398,6 +408,28 @@ public class DeviceProfile {
|
|||||||
return (float) (1f / Math.pow(d, pow));
|
return (float) (1f / Math.pow(d, pow));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns the closest device profile given the width and height and a list of profiles */
|
||||||
|
private DeviceProfile findClosestDeviceProfile(float width, float height,
|
||||||
|
ArrayList<DeviceProfileQuery> points) {
|
||||||
|
return findClosestDeviceProfiles(width, height, points).get(0).profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Returns the closest device profiles ordered by closeness to the specified width and height */
|
||||||
|
private ArrayList<DeviceProfileQuery> findClosestDeviceProfiles(float width, float height,
|
||||||
|
ArrayList<DeviceProfileQuery> points) {
|
||||||
|
final PointF xy = new PointF(width, height);
|
||||||
|
|
||||||
|
// Sort the profiles by their closeness to the dimensions
|
||||||
|
ArrayList<DeviceProfileQuery> pointsByNearness = points;
|
||||||
|
Collections.sort(pointsByNearness, new Comparator<DeviceProfileQuery>() {
|
||||||
|
public int compare(DeviceProfileQuery a, DeviceProfileQuery b) {
|
||||||
|
return (int) (dist(xy, a.dimens) - dist(xy, b.dimens));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return pointsByNearness;
|
||||||
|
}
|
||||||
|
|
||||||
private float invDistWeightedInterpolate(float width, float height,
|
private float invDistWeightedInterpolate(float width, float height,
|
||||||
ArrayList<DeviceProfileQuery> points) {
|
ArrayList<DeviceProfileQuery> points) {
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
@@ -406,12 +438,8 @@ public class DeviceProfile {
|
|||||||
float kNearestNeighbors = 3;
|
float kNearestNeighbors = 3;
|
||||||
final PointF xy = new PointF(width, height);
|
final PointF xy = new PointF(width, height);
|
||||||
|
|
||||||
ArrayList<DeviceProfileQuery> pointsByNearness = points;
|
ArrayList<DeviceProfileQuery> pointsByNearness = findClosestDeviceProfiles(width, height,
|
||||||
Collections.sort(pointsByNearness, new Comparator<DeviceProfileQuery>() {
|
points);
|
||||||
public int compare(DeviceProfileQuery a, DeviceProfileQuery b) {
|
|
||||||
return (int) (dist(xy, a.dimens) - dist(xy, b.dimens));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
for (int i = 0; i < pointsByNearness.size(); ++i) {
|
for (int i = 0; i < pointsByNearness.size(); ++i) {
|
||||||
DeviceProfileQuery p = pointsByNearness.get(i);
|
DeviceProfileQuery p = pointsByNearness.get(i);
|
||||||
|
|||||||
@@ -60,36 +60,41 @@ public class DynamicGrid {
|
|||||||
DEFAULT_ICON_SIZE_PX = pxFromDp(DEFAULT_ICON_SIZE_DP, dm);
|
DEFAULT_ICON_SIZE_PX = pxFromDp(DEFAULT_ICON_SIZE_DP, dm);
|
||||||
// Our phone profiles include the bar sizes in each orientation
|
// Our phone profiles include the bar sizes in each orientation
|
||||||
deviceProfiles.add(new DeviceProfile("Super Short Stubby",
|
deviceProfiles.add(new DeviceProfile("Super Short Stubby",
|
||||||
255, 300, 2, 3, 48, 13, (hasAA ? 5 : 5), 48));
|
255, 300, 2, 3, 48, 13, (hasAA ? 3 : 5), 48, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Shorter Stubby",
|
deviceProfiles.add(new DeviceProfile("Shorter Stubby",
|
||||||
255, 400, 3, 3, 48, 13, (hasAA ? 5 : 5), 48));
|
255, 400, 3, 3, 48, 13, (hasAA ? 3 : 5), 48, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Short Stubby",
|
deviceProfiles.add(new DeviceProfile("Short Stubby",
|
||||||
275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48));
|
275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Stubby",
|
deviceProfiles.add(new DeviceProfile("Stubby",
|
||||||
255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48));
|
255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus S",
|
deviceProfiles.add(new DeviceProfile("Nexus S",
|
||||||
296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48));
|
296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 4",
|
deviceProfiles.add(new DeviceProfile("Nexus 4",
|
||||||
335, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56));
|
335, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 5",
|
deviceProfiles.add(new DeviceProfile("Nexus 5",
|
||||||
359, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56));
|
359, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Large Phone",
|
deviceProfiles.add(new DeviceProfile("Large Phone",
|
||||||
406, 694, 5, 5, 64, 14.4f, 5, 56));
|
406, 694, 5, 5, 64, 14.4f, 5, 56, R.xml.default_workspace_5x5,
|
||||||
|
R.xml.default_workspace_5x5_no_all_apps));
|
||||||
// The tablet profile is odd in that the landscape orientation
|
// The tablet profile is odd in that the landscape orientation
|
||||||
// also includes the nav bar on the side
|
// also includes the nav bar on the side
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 7",
|
deviceProfiles.add(new DeviceProfile("Nexus 7",
|
||||||
575, 904, 5, 6, 72, 14.4f, 7, 60));
|
575, 904, 5, 6, 72, 14.4f, 7, 60, R.xml.default_workspace_5x6,
|
||||||
|
R.xml.default_workspace_5x6_no_all_apps));
|
||||||
// Larger tablet profiles always have system bars on the top & bottom
|
// Larger tablet profiles always have system bars on the top & bottom
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 10",
|
deviceProfiles.add(new DeviceProfile("Nexus 10",
|
||||||
727, 1207, 5, 6, 76, 14.4f, 7, 64));
|
727, 1207, 5, 6, 76, 14.4f, 7, 64, R.xml.default_workspace_5x6,
|
||||||
/*
|
R.xml.default_workspace_5x6_no_all_apps));
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 7",
|
|
||||||
600, 960, 5, 5, 72, 14.4f, 5, 60));
|
|
||||||
deviceProfiles.add(new DeviceProfile("Nexus 10",
|
|
||||||
800, 1280, 5, 5, 80, 14.4f, (hasAA ? 7 : 6), 64));
|
|
||||||
*/
|
|
||||||
deviceProfiles.add(new DeviceProfile("20-inch Tablet",
|
deviceProfiles.add(new DeviceProfile("20-inch Tablet",
|
||||||
1527, 2527, 7, 7, 100, 20, 7, 72));
|
1527, 2527, 7, 7, 100, 20, 7, 72, R.xml.default_workspace_4x4,
|
||||||
|
R.xml.default_workspace_4x4_no_all_apps));
|
||||||
mMinWidth = dpiFromPx(minWidthPx, dm);
|
mMinWidth = dpiFromPx(minWidthPx, dm);
|
||||||
mMinHeight = dpiFromPx(minHeightPx, dm);
|
mMinHeight = dpiFromPx(minHeightPx, dm);
|
||||||
mProfile = new DeviceProfile(context, deviceProfiles,
|
mProfile = new DeviceProfile(context, deviceProfiles,
|
||||||
|
|||||||
@@ -336,10 +336,12 @@ public class LauncherProvider extends ContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static int getDefaultWorkspaceResourceId() {
|
private static int getDefaultWorkspaceResourceId() {
|
||||||
|
LauncherAppState app = LauncherAppState.getInstance();
|
||||||
|
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
|
||||||
if (LauncherAppState.isDisableAllApps()) {
|
if (LauncherAppState.isDisableAllApps()) {
|
||||||
return R.xml.default_workspace_no_all_apps;
|
return grid.defaultNoAllAppsLayoutId;
|
||||||
} else {
|
} else {
|
||||||
return R.xml.default_workspace;
|
return grid.defaultLayoutId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user