More spacing changes to Customization Drawer.
Change-Id: Ie51a0a5da6169b0651e9f70cfb28450254cf0df1
diff --git a/res/layout-xlarge-port/customization_drawer.xml b/res/layout-xlarge-port/customization_drawer.xml
index 53d1f6f..d3ca457 100644
--- a/res/layout-xlarge-port/customization_drawer.xml
+++ b/res/layout-xlarge-port/customization_drawer.xml
@@ -19,10 +19,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
- launcher:widgetCellCountX="12"
+ launcher:widgetCellCountX="10"
launcher:cellCountX="5"
- launcher:cellCountY="4"
- launcher:pageLayoutPaddingTop="15dp"
+ launcher:cellCountY="5"
+ launcher:pageLayoutWidthGap="36dp"
+ launcher:pageLayoutHeightGap="36dp"
+ launcher:pageLayoutPaddingTop="25dp"
launcher:pageLayoutPaddingBottom="25dp"
- launcher:pageLayoutPaddingLeft="15dp"
- launcher:pageLayoutPaddingRight="15dp" />
+ launcher:pageLayoutPaddingLeft="20dp"
+ launcher:pageLayoutPaddingRight="20dp" />
diff --git a/res/layout-xlarge-port/launcher.xml b/res/layout-xlarge-port/launcher.xml
index df7abc1..20debca 100644
--- a/res/layout-xlarge-port/launcher.xml
+++ b/res/layout-xlarge-port/launcher.xml
@@ -131,7 +131,7 @@
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
- android:layout_height="550dip"
+ android:layout_height="800dip"
android:layout_gravity="bottom">
<LinearLayout
android:orientation="vertical"
@@ -148,7 +148,7 @@
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="650dp">
</FrameLayout>
</LinearLayout>
</TabHost>
diff --git a/res/layout-xlarge/customize_paged_view_widget.xml b/res/layout-xlarge/customize_paged_view_widget.xml
index e8f4ac9..cfc0ca0 100644
--- a/res/layout-xlarge/customize_paged_view_widget.xml
+++ b/res/layout-xlarge/customize_paged_view_widget.xml
@@ -18,10 +18,9 @@
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="425dp"
android:paddingLeft="12.5dp"
android:paddingRight="12.5dp"
- android:paddingTop="40dp"
android:paddingBottom="50dp"
android:gravity="top"
android:orientation="vertical"
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index ecc6f3a..bfab155 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -22,9 +22,15 @@
apps and in customization mode -->
<dimen name="smallScreenExtraSpacing">0dip</dimen>
- <!-- vertical spacing between edge of screen and mini screen thumbnails -->
- <dimen name="smallScreenVerticalMarginLandscape">30dip</dimen>
- <dimen name="smallScreenVerticalMarginPortrait">60dip</dimen>
+ <!-- Vertical spacing between edge of screen and mini cell layouts when they
+ are minimized to the bottom in all apps -->
+ <dimen name="allAppsSmallScreenVerticalMarginLandscape">30dip</dimen>
+ <dimen name="allAppsSmallScreenVerticalMarginPortrait">60dip</dimen>
+
+ <!-- Vertical spacing between edge of screen and mini cell layouts when they
+ are minimized to the top when the customization drawer is showing -->
+ <dimen name="customizeSmallScreenVerticalMarginLandscape">70dip</dimen>
+ <dimen name="customizeSmallScreenVerticalMarginPortrait">180dip</dimen>
<dimen name="toolbar_padding">10dip</dimen>
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index cc21276..a01f1c0 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -539,6 +539,7 @@
layout.setCellCount(mCellCountX, mCellCountY);
layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop, mPageLayoutPaddingRight,
mPageLayoutPaddingBottom);
+ layout.setGap(mPageLayoutWidthGap, mPageLayoutHeightGap);
}
private void setupWorkspaceLayout() {
@@ -557,6 +558,8 @@
for (int i = 0; i < numPages; ++i) {
LinearLayout layout = new PagedViewWidgetLayout(getContext());
layout.setGravity(Gravity.CENTER_HORIZONTAL);
+ layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
+ mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
// Temporary change to prevent the last page from being too small (and items bleeding
// onto it). We can remove this once we properly fix the fading algorithm
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 44127fe..56e78c3 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -718,8 +718,8 @@
boolean isPortrait = getMeasuredHeight() > getMeasuredWidth();
float newY = (isPortrait ?
- getResources().getDimension(R.dimen.smallScreenVerticalMarginPortrait) :
- getResources().getDimension(R.dimen.smallScreenVerticalMarginLandscape));
+ getResources().getDimension(R.dimen.allAppsSmallScreenVerticalMarginPortrait) :
+ getResources().getDimension(R.dimen.allAppsSmallScreenVerticalMarginLandscape));
float finalAlpha = 1.0f;
float extraShrinkFactor = 1.0f;
if (shrinkPosition == ShrinkPosition.SHRINK_TO_BOTTOM_VISIBLE) {
@@ -735,7 +735,9 @@
newY = screenHeight / 2 - scaledPageHeight / 2;
finalAlpha = 1.0f;
} else if (shrinkPosition == ShrinkPosition.SHRINK_TO_TOP) {
- newY = screenHeight / 10;
+ newY = (isPortrait ?
+ getResources().getDimension(R.dimen.customizeSmallScreenVerticalMarginPortrait) :
+ getResources().getDimension(R.dimen.customizeSmallScreenVerticalMarginLandscape));
}
// We animate all the screens to the centered position in workspace