Refactoring padding dimens for CellLayouts and Workspace

Change-Id: Ib354b822588717b7bb81b4dcb14c834e5b8d4892
This commit is contained in:
Adam Cohen 2012-04-26 14:56:12 -07:00
parent 58039d634c
commit d5f8c3479a
14 changed files with 93 additions and 82 deletions

View File

@ -27,8 +27,10 @@
android:id="@+id/workspace" android:id="@+id/workspace"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingLeft="@dimen/qsb_bar_height" android:paddingLeft="@dimen/workspace_left_padding"
android:paddingRight="@dimen/button_bar_height" android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
launcher:defaultScreen="2" launcher:defaultScreen="2"
launcher:cellCountX="@integer/cell_count_x" launcher:cellCountX="@integer/cell_count_x"
launcher:cellCountY="@integer/cell_count_y" launcher:cellCountY="@integer/cell_count_y"

View File

@ -44,8 +44,10 @@
android:id="@+id/workspace" android:id="@+id/workspace"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingTop="@dimen/qsb_bar_height_inset" android:paddingLeft="@dimen/workspace_left_padding"
android:paddingBottom="@dimen/button_bar_height" android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
launcher:defaultScreen="2" launcher:defaultScreen="2"
launcher:cellCountX="@integer/cell_count_x" launcher:cellCountX="@integer/cell_count_x"
launcher:cellCountY="@integer/cell_count_y" launcher:cellCountY="@integer/cell_count_y"

View File

@ -19,7 +19,10 @@
<com.android.launcher2.Workspace <com.android.launcher2.Workspace
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:paddingTop="@dimen/workspace_content_large_only_top_margin" android:paddingLeft="@dimen/workspace_left_padding"
android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
launcher:defaultScreen="2" launcher:defaultScreen="2"
launcher:pageSpacing="@dimen/workspace_page_spacing"> launcher:pageSpacing="@dimen/workspace_page_spacing">
<include android:id="@+id/cell1" layout="@layout/workspace_screen" /> <include android:id="@+id/cell1" layout="@layout/workspace_screen" />

View File

@ -1,33 +0,0 @@
<?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="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/workspace_left_padding"
android:paddingRight="@dimen/workspace_right_padding"
android:paddingTop="@dimen/workspace_top_padding"
android:paddingBottom="@dimen/workspace_bottom_padding"
android:hapticFeedbackEnabled="false"
launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height"
launcher:widthGap="@dimen/workspace_width_gap"
launcher:heightGap="@dimen/workspace_height_gap"
launcher:maxGap="@dimen/workspace_max_gap" />

View File

@ -17,16 +17,17 @@
<com.android.launcher2.CellLayout <com.android.launcher2.CellLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
style="@style/WorkspaceScreen"
android:paddingLeft="@dimen/workspace_left_padding" android:layout_width="wrap_content"
android:paddingRight="@dimen/workspace_right_padding" android:layout_height="wrap_content"
android:paddingTop="@dimen/workspace_top_padding" android:paddingLeft="@dimen/cell_layout_left_padding"
android:paddingBottom="@dimen/workspace_bottom_padding" android:paddingRight="@dimen/cell_layout_right_padding"
android:paddingTop="@dimen/cell_layout_top_padding"
android:paddingBottom="@dimen/cell_layout_bottom_padding"
android:hapticFeedbackEnabled="false" android:hapticFeedbackEnabled="false"
launcher:cellWidth="@dimen/workspace_cell_width" launcher:cellWidth="@dimen/workspace_cell_width"
launcher:cellHeight="@dimen/workspace_cell_height" launcher:cellHeight="@dimen/workspace_cell_height"
launcher:widthGap="@dimen/workspace_width_gap" launcher:widthGap="@dimen/workspace_width_gap"
launcher:heightGap="@dimen/workspace_height_gap" launcher:heightGap="@dimen/workspace_height_gap"
launcher:maxGap="@dimen/workspace_max_gap" /> launcher:maxGap="@dimen/workspace_max_gap" />

View File

@ -24,21 +24,26 @@
<dimen name="workspace_cell_height">74dp</dimen> <dimen name="workspace_cell_height">74dp</dimen>
<dimen name="hotseat_cell_width">64dp</dimen> <dimen name="hotseat_cell_width">64dp</dimen>
<dimen name="hotseat_cell_height">58dp</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>
<!-- We need top/bottom padding for portals to look right, but
really only in spring loaded mode... -->
<dimen name="workspace_top_padding">0dp</dimen>
<dimen name="workspace_bottom_padding">0dp</dimen>
<!-- We really want the page spacing to be the max of either the button bar <!-- We really want the page spacing to be the max of either the button bar
height or the qsb bar height --> height or the qsb bar height -->
<dimen name="workspace_page_spacing">-1dp</dimen> <dimen name="workspace_page_spacing">-1dp</dimen>
<dimen name="workspace_divider_padding_left">0dp</dimen> <dimen name="workspace_divider_padding_left">0dp</dimen>
<dimen name="workspace_divider_padding_right">0dp</dimen> <dimen name="workspace_divider_padding_right">0dp</dimen>
<dimen name="workspace_divider_padding_top">12dp</dimen> <dimen name="workspace_divider_padding_top">12dp</dimen>
<dimen name="workspace_divider_padding_bottom">12dp</dimen> <dimen name="workspace_divider_padding_bottom">12dp</dimen>
<!-- Block spacing on each side of the screen. And also padding
for the portals to look right. -->
<dimen name="cell_layout_left_padding">@dimen/cell_layout_left_padding_land</dimen>
<dimen name="cell_layout_right_padding">@dimen/cell_layout_right_padding_land</dimen>
<dimen name="cell_layout_top_padding">@dimen/cell_layout_top_padding_land</dimen>
<dimen name="cell_layout_bottom_padding">@dimen/cell_layout_bottom_padding_land</dimen>
<!-- Workspace padding -->
<dimen name="workspace_left_padding">@dimen/workspace_left_padding_land</dimen>
<dimen name="workspace_right_padding">@dimen/workspace_right_padding_land</dimen>
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_land</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_land</dimen>
<dimen name="app_icon_padding_top">6dp</dimen> <dimen name="app_icon_padding_top">6dp</dimen>
<!-- height of the bottom row of controls --> <!-- height of the bottom row of controls -->

View File

@ -18,12 +18,6 @@
--> -->
<resources> <resources>
<!-- Workspace -->
<style name="WorkspaceScreen">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
<!-- Search Bar --> <!-- Search Bar -->
<style name="QSBBar"> <style name="QSBBar">
<item name="android:orientation">vertical</item> <item name="android:orientation">vertical</item>

View File

@ -22,12 +22,18 @@
<dimen name="qsb_padding_right">3dp</dimen> <dimen name="qsb_padding_right">3dp</dimen>
<!-- Workspace --> <!-- Workspace -->
<dimen name="workspace_left_padding">0dp</dimen>
<dimen name="workspace_right_padding">0dp</dimen>
<!-- Block spacing on each side of the screen. And also padding <!-- Block spacing on each side of the screen. And also padding
for the portals to look right. --> for the portals to look right. -->
<dimen name="workspace_top_padding">6dp</dimen> <dimen name="cell_layout_left_padding">@dimen/cell_layout_left_padding_port</dimen>
<dimen name="workspace_bottom_padding">0dp</dimen> <dimen name="cell_layout_right_padding">@dimen/cell_layout_right_padding_port</dimen>
<dimen name="cell_layout_top_padding">@dimen/cell_layout_top_padding_port</dimen>
<dimen name="cell_layout_bottom_padding">@dimen/cell_layout_bottom_padding_port</dimen>
<!-- Workspace padding -->
<dimen name="workspace_left_padding">@dimen/workspace_left_padding_port</dimen>
<dimen name="workspace_right_padding">@dimen/workspace_right_padding_port</dimen>
<dimen name="workspace_top_padding">@dimen/workspace_top_padding_port</dimen>
<dimen name="workspace_bottom_padding">@dimen/workspace_bottom_padding_port</dimen>
<dimen name="workspace_page_spacing">-1dp</dimen> <dimen name="workspace_page_spacing">-1dp</dimen>
<!-- AppsCustomize --> <!-- AppsCustomize -->

View File

@ -24,12 +24,6 @@
<item name="android:paddingRight">8dp</item> <item name="android:paddingRight">8dp</item>
</style> </style>
<!-- Workspace -->
<style name="WorkspaceScreen">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
<!-- AppsCustomize --> <!-- AppsCustomize -->
<style name="TabIndicator.AppsCustomize"> <style name="TabIndicator.AppsCustomize">
<item name="android:maxWidth">130dp</item> <item name="android:maxWidth">130dp</item>

View File

@ -21,10 +21,6 @@
<!-- Workspace --> <!-- Workspace -->
<dimen name="workspace_width_gap">0dp</dimen> <dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">0dp</dimen> <dimen name="workspace_height_gap">0dp</dimen>
<dimen name="workspace_top_padding">8dp</dimen>
<dimen name="workspace_bottom_padding">8dp</dimen>
<dimen name="workspace_left_padding">8dp</dimen>
<dimen name="workspace_right_padding">8dp</dimen>
<!-- Hotseat --> <!-- Hotseat -->
<dimen name="hotseat_width_gap">0dp</dimen> <dimen name="hotseat_width_gap">0dp</dimen>
@ -37,4 +33,14 @@
<dimen name="button_bar_width_left_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_width_right_padding">8dp</dimen>
<dimen name="button_bar_height_plus_padding">80dp</dimen> <dimen name="button_bar_height_plus_padding">80dp</dimen>
<!-- CellLayout padding land / port-->
<dimen name="cell_layout_left_padding_portrait">8dp</dimen>
<dimen name="cell_layout_left_padding_landscape">8dp</dimen>
<dimen name="cell_layout_right_padding_portrait">8dp</dimen>
<dimen name="cell_layout_right_padding_landscape">8dp</dimen>
<dimen name="cell_layout_top_padding_portrait">8dp</dimen>
<dimen name="cell_layout_top_padding_landscape">8dp</dimen>
<dimen name="cell_layout_bottom_padding_portrait">8dp</dimen>
<dimen name="cell_layout_bottom_padding_landscape">8dp</dimen>
</resources> </resources>

View File

@ -22,11 +22,6 @@
<dimen name="apps_customize_pageLayoutPaddingRight">16dp</dimen> <dimen name="apps_customize_pageLayoutPaddingRight">16dp</dimen>
<!-- Workspace --> <!-- Workspace -->
<dimen name="workspace_left_padding">24dip</dimen>
<dimen name="workspace_right_padding">24dip</dimen>
<!-- We need padding on the screens for portals to look right -->
<dimen name="workspace_top_padding">12dip</dimen>
<dimen name="workspace_bottom_padding">12dip</dimen>
<dimen name="workspace_width_gap">32dp</dimen> <dimen name="workspace_width_gap">32dp</dimen>
<dimen name="workspace_height_gap">2dp</dimen> <dimen name="workspace_height_gap">2dp</dimen>
<dimen name="workspace_page_spacing">50dp</dimen> <dimen name="workspace_page_spacing">50dp</dimen>

View File

@ -31,11 +31,6 @@
<!-- the area at the edge of the screen that makes the workspace go left <!-- the area at the edge of the screen that makes the workspace go left
or right while you're dragging. --> or right while you're dragging. -->
<dimen name="scroll_zone">40dp</dimen> <dimen name="scroll_zone">40dp</dimen>
<dimen name="workspace_left_padding">15dip</dimen>
<dimen name="workspace_right_padding">15dip</dimen>
<dimen name="workspace_top_padding">25dip</dimen>
<dimen name="workspace_bottom_padding">25dip</dimen>
<dimen name="workspace_width_gap">0dp</dimen> <dimen name="workspace_width_gap">0dp</dimen>
<dimen name="workspace_height_gap">32dp</dimen> <dimen name="workspace_height_gap">32dp</dimen>
<dimen name="workspace_page_spacing">24dp</dimen> <dimen name="workspace_page_spacing">24dp</dimen>

View File

@ -53,4 +53,24 @@
the drag view should be offset from the position of the original view. --> the drag view should be offset from the position of the original view. -->
<dimen name="dragViewOffsetX">0dp</dimen> <dimen name="dragViewOffsetX">0dp</dimen>
<dimen name="dragViewOffsetY">0dp</dimen> <dimen name="dragViewOffsetY">0dp</dimen>
<!-- CellLayout padding land / port-->
<dimen name="cell_layout_left_padding_portrait">15dp</dimen>
<dimen name="cell_layout_left_padding_landscape">24dp</dimen>
<dimen name="cell_layout_right_padding_portrait">15dp</dimen>
<dimen name="cell_layout_right_padding_landscape">24dp</dimen>
<dimen name="cell_layout_top_padding_portrait">25dp</dimen>
<dimen name="cell_layout_top_padding_landscape">12dp</dimen>
<dimen name="cell_layout_bottom_padding_portrait">25dp</dimen>
<dimen name="cell_layout_bottom_padding_landscape">12dp</dimen>
<!-- Workspace padding -->
<dimen name="workspace_left_padding_port">0dp</dimen>
<dimen name="workspace_left_padding_land">0dp</dimen>
<dimen name="workspace_right_padding_port">0dp</dimen>
<dimen name="workspace_right_padding_land">0dp</dimen>
<dimen name="workspace_top_padding_port">@dimen/workspace_content_large_only_top_margin</dimen>
<dimen name="workspace_top_padding_land">@dimen/workspace_content_large_only_top_margin</dimen>
<dimen name="workspace_bottom_padding_port">0dp</dimen>
<dimen name="workspace_bottom_padding_land">0dp</dimen>
</resources> </resources>

View File

@ -119,4 +119,25 @@
<dimen name="folder_name_padding">10dp</dimen> <dimen name="folder_name_padding">10dp</dimen>
<dimen name="folder_width_gap">0dp</dimen> <dimen name="folder_width_gap">0dp</dimen>
<dimen name="folder_height_gap">0dp</dimen> <dimen name="folder_height_gap">0dp</dimen>
<!-- CellLayout padding -->
<dimen name="cell_layout_left_padding_port">0dp</dimen>
<dimen name="cell_layout_left_padding_land">0dp</dimen>
<dimen name="cell_layout_right_padding_port">0dp</dimen>
<dimen name="cell_layout_right_padding_land">0dp</dimen>
<dimen name="cell_layout_top_padding_port">6dp</dimen>
<dimen name="cell_layout_top_padding_land">0dp</dimen>
<dimen name="cell_layout_bottom_padding_port">0dp</dimen>
<dimen name="cell_layout_bottom_padding_land">0dp</dimen>
<!-- Workspace padding -->
<dimen name="workspace_left_padding_port">0dp</dimen>
<dimen name="workspace_left_padding_land">@dimen/qsb_bar_height</dimen>
<dimen name="workspace_right_padding_port">0dp</dimen>
<dimen name="workspace_right_padding_land">@dimen/button_bar_height</dimen>
<dimen name="workspace_top_padding_port">@dimen/qsb_bar_height_inset</dimen>
<dimen name="workspace_top_padding_land">0dp</dimen>
<dimen name="workspace_bottom_padding_port">@dimen/button_bar_height</dimen>
<dimen name="workspace_bottom_padding_land">0dp</dimen>
</resources> </resources>