summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/FolderPagedView.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/FolderPagedView.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/FolderPagedView.java')
-rw-r--r--src/com/android/launcher3/FolderPagedView.java20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/launcher3/FolderPagedView.java b/src/com/android/launcher3/FolderPagedView.java
index 0bd6501ed..7d90ba2f7 100644
--- a/src/com/android/launcher3/FolderPagedView.java
+++ b/src/com/android/launcher3/FolderPagedView.java
@@ -24,6 +24,7 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
+import android.view.animation.Interpolator;
import android.view.animation.OvershootInterpolator;
import com.android.launcher3.FocusHelper.PagedFolderKeyEventListener;
@@ -46,7 +47,12 @@ public class FolderPagedView extends PagedView {
private static final int START_VIEW_REORDER_DELAY = 30;
private static final float VIEW_REORDER_DELAY_FACTOR = 0.9f;
- private static final int PAGE_INDICATOR_ANIMATION_DELAY = 150;
+ private static final int PAGE_INDICATOR_ANIMATION_START_DELAY = 300;
+ private static final int PAGE_INDICATOR_ANIMATION_STAGGERED_DELAY = 150;
+ private static final int PAGE_INDICATOR_ANIMATION_DURATION = 400;
+
+ // This value approximately overshoots to 1.5 times the original size.
+ private static final float PAGE_INDICATOR_OVERSHOOT_TENSION = 4.9f;
/**
* Fraction of the width to scroll when showing the next page hint.
@@ -274,6 +280,7 @@ public class FolderPagedView extends PagedView {
arrangeChildren(list, itemCount, true);
}
+ @SuppressLint("RtlHardcoded")
private void arrangeChildren(ArrayList<View> list, int itemCount, boolean saveChanges) {
ArrayList<CellLayout> pages = new ArrayList<CellLayout>();
for (int i = 0; i < getChildCount(); i++) {
@@ -340,7 +347,9 @@ public class FolderPagedView extends PagedView {
// Update footer
mPageIndicator.setVisibility(getPageCount() > 1 ? View.VISIBLE : View.GONE);
- mFolder.mFolderName.setGravity(getPageCount() > 1 ? Gravity.START : Gravity.CENTER_HORIZONTAL);
+ // Set the gravity as LEFT or RIGHT instead of START, as START depends on the actual text.
+ mFolder.mFolderName.setGravity(getPageCount() > 1 ?
+ (mIsRtl ? Gravity.RIGHT : Gravity.LEFT) : Gravity.CENTER_HORIZONTAL);
}
public int getDesiredWidth() {
@@ -645,12 +654,13 @@ public class FolderPagedView extends PagedView {
public void animateMarkers() {
int count = mPageIndicator.getChildCount();
- OvershootInterpolator interpolator = new OvershootInterpolator(4);
+ Interpolator interpolator = new OvershootInterpolator(PAGE_INDICATOR_OVERSHOOT_TENSION);
for (int i = 0; i < count; i++) {
mPageIndicator.getChildAt(i).animate().scaleX(1).scaleY(1)
.setInterpolator(interpolator)
- .setDuration(Folder.FOOTER_ANIMATION_DURATION)
- .setStartDelay(PAGE_INDICATOR_ANIMATION_DELAY * i);
+ .setDuration(PAGE_INDICATOR_ANIMATION_DURATION)
+ .setStartDelay(PAGE_INDICATOR_ANIMATION_STAGGERED_DELAY * i
+ + PAGE_INDICATOR_ANIMATION_START_DELAY);
}
}