From f4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5 Mon Sep 17 00:00:00 2001 From: Adam Cohen Date: Fri, 22 Jul 2011 14:36:03 -0700 Subject: [PATCH] Cleaning up folder layout, still pending final assets / cell size -> see bug 5044356 Change-Id: I80a3cd90145de2a774565aae04809d8c1d04ccd5 --- res/layout/user_folder.xml | 13 ++++--------- res/values/dimens.xml | 5 +++-- src/com/android/launcher2/Folder.java | 12 ++++-------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml index 548a39ef30..6b19603f36 100644 --- a/res/layout/user_folder.xml +++ b/res/layout/user_folder.xml @@ -19,10 +19,6 @@ xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingLeft="@dimen/folder_padding" - android:paddingRight="@dimen/folder_padding" - android:paddingTop="@dimen/folder_padding" - android:paddingBottom="0dp" android:orientation="vertical" android:background="@drawable/portal_container_holo"> @@ -32,14 +28,14 @@ android:layout_height="wrap_content" android:paddingLeft="0dip" android:paddingRight="0dip" - android:paddingTop="8dip" - android:paddingBottom="8dip" + android:paddingTop="0dip" + android:paddingBottom="0dip" android:cacheColorHint="#ff333333" android:hapticFeedbackEnabled="false" launcher:widthGap="@dimen/folder_width_gap" launcher:heightGap="@dimen/folder_height_gap" - launcher:cellWidth="@dimen/workspace_cell_width" - launcher:cellHeight="@dimen/workspace_cell_height" /> + launcher:cellWidth="@dimen/folder_cell_width" + launcher:cellHeight="@dimen/folder_cell_height" /> -1dp -1dp 8dp + 74dp + 80dp 12dp 12dp @@ -84,8 +86,7 @@ 64dp 4dp - 18dp - 10dp + 8dp 0dp 0dp diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index d3b5d4171a..428d7b3307 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -35,12 +35,10 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; -import android.view.View.MeasureSpec; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; -import android.widget.AdapterView; import android.widget.LinearLayout; import android.widget.TextView; @@ -717,9 +715,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList DragLayer.LayoutParams lp = (DragLayer.LayoutParams) getLayoutParams(); int width = getPaddingLeft() + getPaddingRight() + mContent.getDesiredWidth(); - // Technically there is no padding at the bottom, but we add space equal to the padding - // and have to account for that here. - int height = getPaddingTop() + mContent.getDesiredHeight() + mFolderNameHeight; + int height = getPaddingTop() + getPaddingBottom() + mContent.getDesiredHeight() + + mFolderNameHeight; DragLayer parent = (DragLayer) mLauncher.findViewById(R.id.drag_layer); parent.getDescendantRectRelativeToSelf(mFolderIcon, mTempRect); @@ -783,9 +780,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = getPaddingLeft() + getPaddingRight() + mContent.getDesiredWidth(); - // Technically there is no padding at the bottom, but we add space equal to the padding - // and have to account for that here. - int height = getPaddingTop() + mContent.getDesiredHeight() + mFolderNameHeight; + int height = getPaddingTop() + getPaddingBottom() + mContent.getDesiredHeight() + + mFolderNameHeight; int contentWidthSpec = MeasureSpec.makeMeasureSpec(mContent.getDesiredWidth(), MeasureSpec.EXACTLY);