diff options
author | Adam Cohen <adamcohen@google.com> | 2011-07-17 21:03:04 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-07-17 22:00:50 -0700 |
commit | 234c4cd54406e363a2ebc213f6ae5be284414988 (patch) | |
tree | a46c8e54b79e9036127127a2859d194b69d4000c /src/com/android/launcher2/Folder.java | |
parent | 95383fe41dacc45c2aa97e7f47bafebb5b7655d8 (diff) | |
download | android_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.tar.gz android_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.tar.bz2 android_packages_apps_Trebuchet-234c4cd54406e363a2ebc213f6ae5be284414988.zip |
Fix text clipping in Launcher (bug 4980315)
Change-Id: I20c9b98b606d317ed32d49a3437f24a4cd312759
Diffstat (limited to 'src/com/android/launcher2/Folder.java')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index ef02de6bc..7641fe7f2 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -35,6 +35,7 @@ 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; @@ -783,6 +784,23 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList centerAboutIcon(); } + 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 contentWidthSpec = MeasureSpec.makeMeasureSpec(mContent.getDesiredWidth(), + MeasureSpec.EXACTLY); + int contentHeightSpec = MeasureSpec.makeMeasureSpec(mContent.getDesiredHeight(), + MeasureSpec.EXACTLY); + mContent.measure(contentWidthSpec, contentHeightSpec); + + mFolderName.measure(contentWidthSpec, + MeasureSpec.makeMeasureSpec(mFolderNameHeight, MeasureSpec.EXACTLY)); + setMeasuredDimension(width, height); + } + private void arrangeChildren(ArrayList<View> list) { int[] vacant = new int[2]; if (list == null) { |