Cleaning up folder layout, still pending final assets / cell size

-> see bug 5044356

Change-Id: I80a3cd90145de2a774565aae04809d8c1d04ccd5
This commit is contained in:
Adam Cohen
2011-07-22 14:36:03 -07:00
parent 1228b3bc8e
commit f4bb1cdecd
3 changed files with 11 additions and 19 deletions
+4 -9
View File
@@ -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"
+3 -2
View File
@@ -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>
+4 -8
View File
@@ -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);