summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Folder.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-06-01 11:00:38 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-06-01 16:15:54 -0700
commita07c2f5c80908e8a612f4681314a7068b92baa9f (patch)
treed2669826d99443c386da672980c94bf956eb461a /src/com/android/launcher3/Folder.java
parent761e820ae2b5482d1bece87e25525fcd17e23a8a (diff)
downloadandroid_packages_apps_Trebuchet-a07c2f5c80908e8a612f4681314a7068b92baa9f.tar.gz
android_packages_apps_Trebuchet-a07c2f5c80908e8a612f4681314a7068b92baa9f.tar.bz2
android_packages_apps_Trebuchet-a07c2f5c80908e8a612f4681314a7068b92baa9f.zip
Folder UI fixes
> Fixing top padding (b/21304523) > Alinging the label and page indicators to the icons > Fixing folder label alingment in RTL (b/21445821) > Updating footer animation (b/21336853) Bug: 21304523, 21445821, 21336853 Change-Id: I2cf3a48c76653b19437b31252d6ee559ce798094
Diffstat (limited to 'src/com/android/launcher3/Folder.java')
-rw-r--r--src/com/android/launcher3/Folder.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index ec4ea044c..a5b7a6003 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -29,10 +29,12 @@ import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Build;
+import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.text.InputType;
import android.text.Selection;
import android.text.Spannable;
import android.util.AttributeSet;
+import android.util.LayoutDirection;
import android.util.Log;
import android.view.ActionMode;
import android.view.KeyEvent;
@@ -89,7 +91,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
*/
private static final float ICON_OVERSCROLL_WIDTH_FACTOR = 0.45f;
- public static final int FOOTER_ANIMATION_DURATION = 200;
+ private static final int FOLDER_NAME_ANIMATION_DURATION = 633;
private static final int REORDER_DELAY = 250;
private static final int ON_EXIT_CLOSE_DELAY = 400;
@@ -502,7 +504,6 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
textAlpha.setStartDelay(mMaterialExpandStagger);
textAlpha.setInterpolator(new AccelerateInterpolator(1.5f));
-
anim.play(drift);
anim.play(iconsAlpha);
anim.play(textAlpha);
@@ -545,7 +546,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
- mFooter.getPaddingLeft() - mFooter.getPaddingRight();
float textWidth = mFolderName.getPaint().measureText(mFolderName.getText().toString());
- mFolderName.setTranslationX((footerWidth - textWidth) / 2);
+ float translation = (footerWidth - textWidth) / 2;
+ mFolderName.setTranslationX(mContent.mIsRtl ? -translation : translation);
mContent.setMarkerScale(0);
// Do not update the flag if we are in drag mode. The flag will be updated, when we
@@ -555,7 +557,9 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
@Override
public void onAnimationEnd(Animator animation) {
- mFolderName.animate().setDuration(FOOTER_ANIMATION_DURATION).translationX(0);
+ mFolderName.animate().setDuration(FOLDER_NAME_ANIMATION_DURATION)
+ .translationX(0)
+ .setInterpolator(new FastOutSlowInInterpolator());
mContent.animateMarkers();
if (updateAnimationFlag) {
@@ -1032,6 +1036,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
mContent.setFixedSize(contentWidth, contentHeight);
mContentWrapper.measure(contentAreaWidthSpec, contentAreaHeightSpec);
+
+ if (mContent.getChildCount() > 0) {
+ int cellIconGap = (mContent.getPageAt(0).getCellWidth()
+ - mLauncher.getDeviceProfile().iconSizePx) / 2;
+ mFooter.setPadding(mContent.getPaddingLeft() + cellIconGap,
+ mFooter.getPaddingTop(),
+ mContent.getPaddingRight() + cellIconGap,
+ mFooter.getPaddingBottom());
+ }
mFooter.measure(contentAreaWidthSpec,
MeasureSpec.makeMeasureSpec(mFooterHeight, MeasureSpec.EXACTLY));