summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-07-22 14:36:03 -0700
committerAdam Cohen <adamcohen@google.com>2011-07-22 14:37:20 -0700
commitf4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5 (patch)
treebe58b63b45d721b38fd76ae88161c92a70159c35
parent1228b3bc8e523ad07bcac602d89890690c9f06ef (diff)
downloadandroid_packages_apps_Trebuchet-f4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5.tar.gz
android_packages_apps_Trebuchet-f4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5.tar.bz2
android_packages_apps_Trebuchet-f4bb1cdecd3cf866a1d87b7b8560234fa7dd4cc5.zip
Cleaning up folder layout, still pending final assets / cell size
-> see bug 5044356 Change-Id: I80a3cd90145de2a774565aae04809d8c1d04ccd5
-rw-r--r--res/layout/user_folder.xml13
-rw-r--r--res/values/dimens.xml5
-rw-r--r--src/com/android/launcher2/Folder.java12
3 files changed, 11 insertions, 19 deletions
diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml
index 548a39ef3..6b19603f3 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" />
<EditText
android:id="@+id/folder_name"
@@ -47,7 +43,6 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:paddingTop="@dimen/folder_content_name_gap"
- android:paddingBottom="@dimen/folder_padding"
android:background="#00000000"
android:hint="@string/folder_hint_text"
android:textSize="16sp"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 75786eb1e..44da3521c 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -22,6 +22,8 @@
<dimen name="workspace_width_gap">-1dp</dimen>
<dimen name="workspace_height_gap">-1dp</dimen>
<dimen name="workspace_max_gap">8dp</dimen>
+ <dimen name="folder_cell_width">74dp</dimen>
+ <dimen name="folder_cell_height">80dp</dimen>
<dimen name="scroll_track_padding_left">12dp</dimen>
<dimen name="scroll_track_padding_right">12dp</dimen>
@@ -84,8 +86,7 @@
<dimen name="folder_preview_size">64dp</dimen>
<!-- The amount that the preview contents are inset from the preview background -->
<dimen name="folder_preview_padding">4dp</dimen>
- <dimen name="folder_padding">18dp</dimen>
- <dimen name="folder_content_name_gap">10dp</dimen>
+ <dimen name="folder_content_name_gap">8dp</dimen>
<dimen name="folder_width_gap">0dp</dimen>
<dimen name="folder_height_gap">0dp</dimen>
</resources>
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java
index d3b5d4171..428d7b330 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);