Merge "Tweaking grid spacing (5162387)"

This commit is contained in:
Winson Chung
2011-08-30 17:03:09 -07:00
committed by Android (Google) Code Review
21 changed files with 245 additions and 39 deletions
+10 -7
View File
@@ -16,18 +16,21 @@
<com.android.launcher2.Hotseat
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:cellCountY="5">
<com.android.launcher2.CellLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="@dimen/button_bar_width_left_padding"
android:paddingBottom="@dimen/button_bar_width_right_padding"
android:paddingLeft="@dimen/button_bar_height_top_padding"
android:paddingRight="@dimen/button_bar_height_bottom_padding"
launcher:cellWidth="@dimen/hotseat_cell_width"
launcher:cellHeight="@dimen/hotseat_cell_height"
launcher:widthGap="-1dp"
launcher:heightGap="-1dp"
launcher:widthGap="@dimen/hotseat_width_gap"
launcher:heightGap="@dimen/hotseat_height_gap"
launcher:maxGap="@dimen/workspace_max_gap" />
</com.android.launcher2.Hotseat>
+3 -5
View File
@@ -66,11 +66,9 @@
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
</com.android.launcher2.Workspace>
<include layout="@layout/qsb_bar"
<include
android:id="@+id/qsb_bar"
android:layout_width="@dimen/qsb_bar_height"
android:layout_height="match_parent"
android:layout_gravity="left" />
layout="@layout/qsb_bar" />
<include layout="@layout/apps_customize_pane"
android:id="@+id/apps_customize_pane"
@@ -80,7 +78,7 @@
<include layout="@layout/hotseat"
android:id="@+id/hotseat"
android:layout_width="@dimen/button_bar_height"
android:layout_width="@dimen/button_bar_height_plus_padding"
android:layout_height="match_parent"
android:layout_gravity="right" />
+9 -7
View File
@@ -16,19 +16,21 @@
<com.android.launcher2.Hotseat
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="5"
launcher:cellCountY="1">
<com.android.launcher2.CellLayout
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingTop="@dimen/button_bar_height_padding"
android:paddingLeft="@dimen/workspace_left_padding"
android:paddingRight="@dimen/workspace_right_padding"
android:layout_gravity="center"
android:paddingTop="@dimen/button_bar_height_top_padding"
android:paddingBottom="@dimen/button_bar_height_bottom_padding"
android:paddingLeft="@dimen/button_bar_width_left_padding"
android:paddingRight="@dimen/button_bar_width_right_padding"
launcher:cellWidth="@dimen/hotseat_cell_width"
launcher:cellHeight="@dimen/hotseat_cell_height"
launcher:widthGap="-1dp"
launcher:heightGap="-1dp"
launcher:widthGap="@dimen/hotseat_width_gap"
launcher:heightGap="@dimen/hotseat_height_gap"
launcher:maxGap="@dimen/workspace_max_gap" />
</com.android.launcher2.Hotseat>
+2 -4
View File
@@ -67,11 +67,9 @@
<include android:id="@+id/cell5" layout="@layout/workspace_screen" />
</com.android.launcher2.Workspace>
<include layout="@layout/qsb_bar"
<include
android:id="@+id/qsb_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/qsb_bar_height"
android:layout_gravity="top" />
layout="@layout/qsb_bar" />
<include layout="@layout/apps_customize_pane"
android:id="@+id/apps_customize_pane"
+1
View File
@@ -16,6 +16,7 @@
<com.android.launcher2.SearchDropTargetBar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
style="@style/QSBBar"
android:focusable="false">
<!-- Search buttons container -->
+2 -2
View File
@@ -27,6 +27,6 @@
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
launcher:widthGap="-1dp"
launcher:heightGap="-1dp"
launcher:widthGap="@dimen/workspace_width_gap"
launcher:heightGap="@dimen/workspace_height_gap"
launcher:maxGap="@dimen/workspace_max_gap" />
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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>
<!-- Workspace -->
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
</resources>
+45
View File
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">-1dp</dimen>
<dimen name="workspace_bottom_padding">-1dp</dimen>
<dimen name="workspace_left_padding">-1dp</dimen>
<dimen name="workspace_right_padding">-1dp</dimen>
<dimen name="workspace_divider_padding_left">20dp</dimen>
<dimen name="workspace_divider_padding_right">20dp</dimen>
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<dimen name="hotseat_top_padding">-1dp</dimen>
<dimen name="hotseat_bottom_padding">-1dp</dimen>
<dimen name="hotseat_left_padding">-1dp</dimen>
<dimen name="hotseat_right_padding">-1dp</dimen>
<dimen name="qsb_bar_height">48dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">80dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">8dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (C) 2011 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>
<!-- Workspace -->
<style name="QSBBar">
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">320dp</item>
<item name="android:layout_height">@dimen/qsb_bar_height</item>
<item name="android:layout_gravity">top|center_horizontal</item>
</style>
</resources>
+18
View File
@@ -1,5 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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>
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">false</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
</resources>
+4 -1
View File
@@ -41,7 +41,10 @@
<dimen name="button_bar_height">68dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_padding">8dp</dimen>
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">0dp</dimen>
<dimen name="button_bar_width_left_padding">0dp</dimen>
<dimen name="button_bar_width_right_padding">0dp</dimen>
<dimen name="button_bar_height_plus_padding">76dp</dimen>
<!-- AppsCustomize -->
+7 -1
View File
@@ -21,9 +21,15 @@
<!-- Workspace -->
<style name="WorkspaceScreen">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
<!-- Search Bar -->
<style name="QSBBar">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">@dimen/qsb_bar_height</item>
<item name="android:layout_height">match_parent</item>
<item name="android:layout_gravity">left</item>
</style>
<style name="SearchDropTargetBar">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">match_parent</item>
+2
View File
@@ -8,6 +8,8 @@
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">true</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">true</bool>
<!-- When dragging items on the workspace, how much bigger (in pixels) the dragged view
should be, as compared to the original view. If 0, it will not be scaled at all.
+1 -1
View File
@@ -20,7 +20,7 @@
<resources>
<!-- Workspace -->
<style name="WorkspaceScreen">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
</resources>
+45
View File
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 201 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>
<!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">-1dp</dimen>
<dimen name="workspace_bottom_padding">-1dp</dimen>
<dimen name="workspace_left_padding">-1dp</dimen>
<dimen name="workspace_right_padding">-1dp</dimen>
<dimen name="workspace_divider_padding_top">20dp</dimen>
<dimen name="workspace_divider_padding_bottom">20dp</dimen>
<dimen name="hotseat_width_gap">0dp</dimen>
<dimen name="hotseat_height_gap">0dp</dimen>
<dimen name="hotseat_top_padding">-1dp</dimen>
<dimen name="hotseat_bottom_padding">-1dp</dimen>
<dimen name="hotseat_left_padding">-1dp</dimen>
<dimen name="hotseat_right_padding">-1dp</dimen>
<dimen name="qsb_bar_height">48dp</dimen>
<!-- height of the bottom row of controls -->
<dimen name="button_bar_height">80dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">8dp</dimen>
<dimen name="button_bar_width_left_padding">8dp</dimen>
<dimen name="button_bar_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen>
</resources>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
* Copyright (C) 2011 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>
<!-- Workspace -->
<style name="QSBBar">
<item name="android:orientation">vertical</item>
<item name="android:layout_width">@dimen/qsb_bar_height</item>
<item name="android:layout_height">320dp</item>
<item name="android:layout_gravity">left</item>
</style>
</resources>
+2
View File
@@ -44,6 +44,8 @@
<!-- Workspace -->
<!-- Whether or not the drop targets drop down as opposed to fade in -->
<bool name="config_useDropTargetDownTransition">true</bool>
<!-- Whether or not to fade the side pages -->
<bool name="config_workspaceFadeAdjacentScreens">false</bool>
<!-- The transition duration for the background of the drop targets -->
<integer name="config_dropTargetBgTransitionDuration">100</integer>
+8 -3
View File
@@ -22,8 +22,6 @@
<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">64dp</dimen>
<dimen name="hotseat_cell_height">64dp</dimen>
<dimen name="workspace_width_gap">-1dp</dimen>
<dimen name="workspace_height_gap">-1dp</dimen>
<dimen name="workspace_max_gap">16dp</dimen>
@@ -33,6 +31,10 @@
<dimen name="workspace_divider_padding_right">12dp</dimen>
<dimen name="workspace_divider_padding_top">0dp</dimen>
<dimen name="workspace_divider_padding_bottom">0dp</dimen>
<dimen name="hotseat_cell_width">64dp</dimen>
<dimen name="hotseat_cell_height">64dp</dimen>
<dimen name="hotseat_width_gap">-1dp</dimen>
<dimen name="hotseat_height_gap">-1dp</dimen>
<!-- QSB -->
<dimen name="toolbar_button_vertical_padding">0dip</dimen>
@@ -53,7 +55,10 @@
<dimen name="button_bar_height">64dip</dimen>
<!-- Because portal animations go beyond the bounds of an icon, we need
to make the dock layout slightly larger than the button_bar_height -->
<dimen name="button_bar_height_padding">8dp</dimen>
<dimen name="button_bar_height_top_padding">8dp</dimen>
<dimen name="button_bar_height_bottom_padding">0dp</dimen>
<dimen name="button_bar_width_left_padding">0dp</dimen>
<dimen name="button_bar_width_right_padding">0dp</dimen>
<dimen name="button_bar_height_plus_padding">72dp</dimen>
<!-- Drag padding to add to the drop targets -->
+1 -1
View File
@@ -149,7 +149,7 @@ s -->
<!-- Noun, menu item used to bring down the notifications shade -->
<string name="menu_notifications">Notifications</string>
<!-- Noun, menu item used to show the system settings -->
<string name="menu_settings">System Settings</string>
<string name="menu_settings">System settings</string>
<!-- Noun, menu item used to show help. [CHAR_LIMIT=none] -->
<string name="menu_help">Help</string>
+6
View File
@@ -108,6 +108,12 @@
<item name="android:drawablePadding">6dp</item>
</style>
<style name="QSBBar">
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">@dimen/qsb_bar_height</item>
<item name="android:layout_gravity">top|center_horizontal</item>
</style>
<style name="SearchDropTargetBar">
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
+2 -7
View File
@@ -265,13 +265,8 @@ public class Workspace extends SmoothPagedView
// With workspace, data is available straight from the get-go
setDataIsReady();
if (!LauncherApplication.isScreenLarge()) {
mCenterPagesVertically = false;
if (!LauncherApplication.isScreenLandscape(context)) {
mFadeInAdjacentScreens = false;
}
}
mFadeInAdjacentScreens =
getResources().getBoolean(R.bool.config_workspaceFadeAdjacentScreens);
mWallpaperManager = WallpaperManager.getInstance(context);
int cellCountX = DEFAULT_CELL_COUNT_X;