diff options
-rw-r--r-- | res/layout-land/hotseat.xml | 2 | ||||
-rw-r--r-- | res/layout-port/hotseat.xml | 2 | ||||
-rw-r--r-- | res/values-land/dimens.xml | 4 | ||||
-rw-r--r-- | res/values/dimens.xml | 2 | ||||
-rw-r--r-- | res/xml/default_workspace.xml | 22 | ||||
-rw-r--r-- | src/com/android/launcher2/AppsCustomizeTabHost.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher2/Hotseat.java | 10 | ||||
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 24 | ||||
-rw-r--r-- | src/com/android/launcher2/LauncherProvider.java | 2 |
9 files changed, 45 insertions, 26 deletions
diff --git a/res/layout-land/hotseat.xml b/res/layout-land/hotseat.xml index f82d541..dca30bf 100644 --- a/res/layout-land/hotseat.xml +++ b/res/layout-land/hotseat.xml @@ -18,7 +18,7 @@ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" android:background="@drawable/hotseat_bg_panel" launcher:cellCountX="1" - launcher:cellCountY="-1"> + launcher:cellCountY="5"> <com.android.launcher2.CellLayout android:id="@+id/layout" android:layout_width="match_parent" diff --git a/res/layout-port/hotseat.xml b/res/layout-port/hotseat.xml index 53f3c20..19da944 100644 --- a/res/layout-port/hotseat.xml +++ b/res/layout-port/hotseat.xml @@ -17,7 +17,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" android:background="@drawable/hotseat_bg_panel" - launcher:cellCountX="-1" + launcher:cellCountX="5" launcher:cellCountY="1"> <com.android.launcher2.CellLayout android:id="@+id/layout" diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml index 85465b4..ea761ce 100644 --- a/res/values-land/dimens.xml +++ b/res/values-land/dimens.xml @@ -22,8 +22,8 @@ <!-- Workspace --> <dimen name="workspace_cell_width">106dp</dimen> <dimen name="workspace_cell_height">74dp</dimen> - <dimen name="hotseat_cell_width">68dp</dimen> - <dimen name="hotseat_cell_height">74dp</dimen> + <dimen name="hotseat_cell_width">64dp</dimen> + <dimen name="hotseat_cell_height">58dp</dimen> <!-- Block spacing on each side of the screen --> <dimen name="workspace_left_padding">0dp</dimen> <dimen name="workspace_right_padding">0dp</dimen> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 5289ebd..641f8ea 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -19,7 +19,7 @@ <dimen name="qsb_bar_height">40dp</dimen> <dimen name="workspace_cell_width">80dp</dimen> <dimen name="workspace_cell_height">100dp</dimen> - <dimen name="hotseat_cell_width">80dp</dimen> + <dimen name="hotseat_cell_width">64dp</dimen> <dimen name="hotseat_cell_height">64dp</dimen> <dimen name="workspace_width_gap">-1dp</dimen> <dimen name="workspace_height_gap">-1dp</dimen> diff --git a/res/xml/default_workspace.xml b/res/xml/default_workspace.xml index db5e232..f6e363c 100644 --- a/res/xml/default_workspace.xml +++ b/res/xml/default_workspace.xml @@ -38,9 +38,6 @@ launcher:packageName="com.google.android.gm" launcher:className="com.google.android.gm.ConversationListActivityGmail" /> <favorite - launcher:packageName="com.google.android.talk" - launcher:className="com.google.android.talk.SigningInActivity" /> - <favorite launcher:packageName="com.google.android.apps.maps" launcher:className="com.google.android.maps.MapsActivity" /> <favorite @@ -78,21 +75,28 @@ launcher:packageName="com.android.contacts" launcher:className="com.android.contacts.activities.DialtactsActivity" launcher:container="-101" - launcher:screen="1" - launcher:x="1" + launcher:screen="0" + launcher:x="0" launcher:y="0" /> <favorite launcher:packageName="com.android.contacts" launcher:className="com.android.contacts.activities.PeopleActivity" launcher:container="-101" - launcher:screen="2" - launcher:x="2" + launcher:screen="1" + launcher:x="1" launcher:y="0" /> <favorite - launcher:packageName="com.android.browser" - launcher:className="com.android.browser.BrowserActivity" + launcher:packageName="com.google.android.talk" + launcher:className="com.google.android.talk.SigningInActivity" launcher:container="-101" launcher:screen="3" launcher:x="3" launcher:y="0" /> + <favorite + launcher:packageName="com.android.browser" + launcher:className="com.android.browser.BrowserActivity" + launcher:container="-101" + launcher:screen="4" + launcher:x="4" + launcher:y="0" /> </favorites> diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 2f5cc40..8aa7c59 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -39,7 +39,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona private static final String APPS_TAB_TAG = "APPS"; private static final String WIDGETS_TAB_TAG = "WIDGETS"; - private static final int sTabBarFadeInDuration = 150; private final LayoutInflater mLayoutInflater; private ViewGroup mTabs; @@ -130,7 +129,7 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona // Set the width and show the tab bar (if we have a loading graphic, we can switch // it off here) mTabs.getLayoutParams().width = contentWidth; - mTabsContainer.animate().alpha(1f).setDuration(sTabBarFadeInDuration); + mTabsContainer.setAlpha(1f); } } super.onMeasure(widthMeasureSpec, heightMeasureSpec); diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java index 491691e..c53a743 100644 --- a/src/com/android/launcher2/Hotseat.java +++ b/src/com/android/launcher2/Hotseat.java @@ -27,7 +27,8 @@ import android.widget.FrameLayout; import com.android.launcher.R; public class Hotseat extends FrameLayout { - static final String TAG = "Hotseat"; + private static final String TAG = "Hotseat"; + private static final int sAllAppsButtonRank = 2; // In the middle of the dock private Launcher mLauncher; private CellLayout mContent; @@ -75,6 +76,9 @@ public class Hotseat extends FrameLayout { int getCellYFromOrder(int rank) { return mIsLandscape ? (mContent.getCountY() - (rank + 1)) : 0; } + public static boolean isAllAppsButtonRank(int rank) { + return rank == sAllAppsButtonRank; + } @Override protected void onFinishInflate() { @@ -110,8 +114,8 @@ public class Hotseat extends FrameLayout { // Note: We do this to ensure that the hotseat is always laid out in the orientation of // the hotseat in order regardless of which orientation they were added - int x = getCellXFromOrder(0); - int y = getCellYFromOrder(0); + int x = getCellXFromOrder(sAllAppsButtonRank); + int y = getCellYFromOrder(sAllAppsButtonRank); mContent.addViewToCellLayout(allAppsButton, -1, 0, new CellLayout.LayoutParams(x,y,1,1), true); } diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 1573483..206de14 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -816,26 +816,37 @@ public class LauncherModel extends BroadcastReceiver { // check & update map of what's occupied; used to discard overlapping/invalid items private boolean checkItemPlacement(ItemInfo occupied[][][], ItemInfo item) { - if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) { + int containerIndex = item.screen; + if (item.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) { + // We use the last index to refer to the hotseat + containerIndex = Launcher.SCREEN_COUNT; + // Return early if we detect that an item is under the hotseat button + if (Hotseat.isAllAppsButtonRank(item.screen)) { + return false; + } + } else if (item.container != LauncherSettings.Favorites.CONTAINER_DESKTOP) { + // Skip further checking if it is not the hotseat or workspace container return true; } + for (int x = item.cellX; x < (item.cellX+item.spanX); x++) { for (int y = item.cellY; y < (item.cellY+item.spanY); y++) { - if (occupied[item.screen][x][y] != null) { + if (occupied[containerIndex][x][y] != null) { Log.e(TAG, "Error loading shortcut " + item - + " into cell (" + item.screen + ":" + + " into cell (" + containerIndex + "-" + item.screen + ":" + x + "," + y + ") occupied by " - + occupied[item.screen][x][y]); + + occupied[containerIndex][x][y]); return false; } } } for (int x = item.cellX; x < (item.cellX+item.spanX); x++) { for (int y = item.cellY; y < (item.cellY+item.spanY); y++) { - occupied[item.screen][x][y] = item; + occupied[containerIndex][x][y] = item; } } + return true; } @@ -858,8 +869,9 @@ public class LauncherModel extends BroadcastReceiver { final Cursor c = contentResolver.query( LauncherSettings.Favorites.CONTENT_URI, null, null, null, null); + // +1 for the hotseat (it can be larger than the workspace) final ItemInfo occupied[][][] = - new ItemInfo[Launcher.SCREEN_COUNT][mCellCountX][mCellCountY]; + new ItemInfo[Launcher.SCREEN_COUNT + 1][mCellCountX + 1][mCellCountY + 1]; try { final int idIndex = c.getColumnIndexOrThrow(LauncherSettings.Favorites._ID); diff --git a/src/com/android/launcher2/LauncherProvider.java b/src/com/android/launcher2/LauncherProvider.java index 6ca16de..53f7b42 100644 --- a/src/com/android/launcher2/LauncherProvider.java +++ b/src/com/android/launcher2/LauncherProvider.java @@ -737,7 +737,7 @@ public class LauncherProvider extends ContentProvider { // hotset. This screen can't be at position 0 because AllApps is in the // zeroth position. if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT && - Integer.valueOf(screen) <= 0) { + Hotseat.isAllAppsButtonRank(Integer.valueOf(screen))) { throw new RuntimeException("Invalid screen position for hotseat item"); } |