Allow for NxM layout and in-place rotation of items on homescreen.

Currently, rotation is disabled as designs are still in flux, but the NxM grid is enabled (8x4).

Change-Id: I0026f88c674719e3d67de6d6d481d2d4cd606362
diff --git a/res/layout-xlarge/launcher.xml b/res/layout-xlarge/launcher.xml
index 092e018..17a5b84 100644
--- a/res/layout-xlarge/launcher.xml
+++ b/res/layout-xlarge/launcher.xml
@@ -29,14 +29,14 @@
         android:id="@+id/workspace"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        launcher:defaultScreen="2">
+        launcher:canonicalDeviceWidth="8"
+        launcher:canonicalDeviceHeight="4">
 
         <include android:id="@+id/cell1" layout="@layout/workspace_screen" />
         <include android:id="@+id/cell2" layout="@layout/workspace_screen" />
         <include android:id="@+id/cell3" layout="@layout/workspace_screen" />
         <include android:id="@+id/cell4" layout="@layout/workspace_screen" />
         <include android:id="@+id/cell5" layout="@layout/workspace_screen" />
-
     </com.android.launcher2.Workspace>
 
     <com.android.launcher2.DeleteZone
diff --git a/res/layout-xlarge/workspace_screen.xml b/res/layout-xlarge/workspace_screen.xml
new file mode 100644
index 0000000..aa892b9
--- /dev/null
+++ b/res/layout-xlarge/workspace_screen.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 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.
+-->
+
+<com.android.launcher2.CellLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
+
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:hapticFeedbackEnabled="false"
+
+    launcher:cellWidth="@dimen/workspace_cell_width"
+    launcher:cellHeight="@dimen/workspace_cell_height"
+    launcher:longAxisStartPadding="8dip"
+    launcher:longAxisEndPadding="8dip"
+    launcher:shortAxisStartPadding="8dip"
+    launcher:shortAxisEndPadding="8dip"
+    launcher:shortAxisCells="4"
+    launcher:longAxisCells="8" />
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
new file mode 100644
index 0000000..8279492
--- /dev/null
+++ b/res/values-xlarge/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2009 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.
+-->
+
+<resources>
+    <dimen name="workspace_cell_width">76dip</dimen>
+    <dimen name="workspace_cell_height">76dip</dimen>
+</resources>
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
new file mode 100644
index 0000000..e4c047f
--- /dev/null
+++ b/res/values-xlarge/styles.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+* Copyright (C) 2008 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.
+*/
+-->
+
+<resources>
+    <style name="WorkspaceIcon.Portrait">
+        <item name="android:drawablePadding">4dip</item>
+        <item name="android:paddingTop">1dip</item>
+    </style>
+
+    <style name="WorkspaceIcon.Landscape">
+        <item name="android:drawablePadding">4dip</item>
+        <item name="android:paddingTop">1dip</item>
+    </style>
+</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 7839120..c977f97 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -32,6 +32,10 @@
     <declare-styleable name="Workspace">
         <!-- The first screen the workspace should display. -->
         <attr name="defaultScreen" format="integer"  />
+        <!-- The number of horizontal cells for the device in its natural orientation -->
+        <attr name="canonicalDeviceWidth" format="integer"  />
+        <!-- The number of vertical cells for the device in its natural orientation -->
+        <attr name="canonicalDeviceHeight" format="integer"  />
     </declare-styleable>
     
     <!-- CellLayout specific attributes. These attributes are used to customize