diff --git a/res/layout-xlarge-land/all_apps_tabbed.xml b/res/layout-xlarge-land/all_apps_tabbed.xml index 4f573f8a88..3a07b9543d 100644 --- a/res/layout-xlarge-land/all_apps_tabbed.xml +++ b/res/layout-xlarge-land/all_apps_tabbed.xml @@ -16,7 +16,6 @@ \ No newline at end of file diff --git a/res/layout-xlarge/launcher.xml b/res/layout-xlarge-land/launcher.xml similarity index 100% rename from res/layout-xlarge/launcher.xml rename to res/layout-xlarge-land/launcher.xml diff --git a/res/layout-xlarge-port/all_apps_tabbed.xml b/res/layout-xlarge-port/all_apps_tabbed.xml index 2ff0447921..6675adc554 100644 --- a/res/layout-xlarge-port/all_apps_tabbed.xml +++ b/res/layout-xlarge-port/all_apps_tabbed.xml @@ -16,7 +16,6 @@ \ No newline at end of file diff --git a/res/layout-xlarge-port/launcher.xml b/res/layout-xlarge-port/launcher.xml new file mode 100644 index 0000000000..a418b36aa7 --- /dev/null +++ b/res/layout-xlarge-port/launcher.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index bcb7e9a6e2..4f74b59859 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -69,7 +69,7 @@ - %1$d x %2$d + %1$d x %2$d diff --git a/src/com/android/launcher2/AllAppsTabbed.java b/src/com/android/launcher2/AllAppsTabbed.java index 368306f509..aff8ddd20d 100644 --- a/src/com/android/launcher2/AllAppsTabbed.java +++ b/src/com/android/launcher2/AllAppsTabbed.java @@ -127,6 +127,9 @@ public class AllAppsTabbed extends TabHost implements AllAppsView { } }); + // TEMP: Working around a bug in tab host where the current tab does not initially have a + // highlight on it by selecting something else, then selecting the actual tab we want.. + setCurrentTab(1); setCurrentTab(0); // It needs to be INVISIBLE so that it will be measured in the layout. diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 989ee25176..d7c2f5bb53 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -350,6 +350,9 @@ public final class Launcher extends Activity } }); + // TEMP: Working around a bug in tab host where the current tab does not initially have + // a highlight on it by selecting something else, then selecting the actual tab we want.. + mHomeCustomizationDrawer.setCurrentTab(1); mHomeCustomizationDrawer.setCurrentTab(0); } setupViews(); diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index 83320533fc..97bbbdff4d 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -406,6 +406,14 @@ public abstract class PagedView extends ViewGroup { int halfChildWidth = (childWidth / 2); int childCenter = getChildOffset(i) + halfChildWidth; + // On the first layout, we may not have a width nor a proper offset, so for now + // we should just assume full page width (and calculate the offset according to + // that). + if (childWidth <= 0) { + childWidth = getMeasuredWidth(); + childCenter = (i * childWidth) + (childWidth / 2); + } + int d = halfChildWidth; int distanceFromScreenCenter = childCenter - screenCenter; if (distanceFromScreenCenter > 0) { @@ -419,6 +427,9 @@ public abstract class PagedView extends ViewGroup { } d += mPageSpacing; + // Preventing potential divide-by-zero + d = Math.max(1, d); + float dimAlpha = (float) (Math.abs(distanceFromScreenCenter)) / d; dimAlpha = Math.max(0.0f, Math.min(1.0f, (dimAlpha * dimAlpha))); float alpha = 1.0f - dimAlpha; @@ -1237,6 +1248,7 @@ public abstract class PagedView extends ViewGroup { // Load any pages that are necessary for the current window of views loadAssociatedPages(mCurrentPage); mDirtyPageAlpha = true; + updateAdjacentPagesAlpha(); requestLayout(); } } diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index ac5c1b9d26..0d070488ed 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -717,8 +717,10 @@ public class Workspace extends SmoothPagedView finalAlpha = 0.0f; extraShrinkFactor = 0.1f; } else if (shrinkPosition == ShrinkPosition.SHRINK_TO_MIDDLE) { - newY = screenHeight / 2 - scaledPageHeight / 2; - finalAlpha = 1.0f; + newY = screenHeight / 2 - scaledPageHeight / 2; + finalAlpha = 1.0f; + } else if (shrinkPosition == ShrinkPosition.SHRINK_TO_TOP) { + newY = screenHeight / 10; } // We animate all the screens to the centered position in workspace