diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-20 07:45:27 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-20 07:45:27 +0000 |
commit | 1b60530b9272671b6bddda223aea9dfd95f5d469 (patch) | |
tree | b755c5b64eb096681181d4ddb36c313988309141 /src/com/android/launcher3/allapps/AllAppsGridAdapter.java | |
parent | f78db7fa5c485433b362b68a497a80cd728faf19 (diff) | |
parent | fb46415e803a7f20a7d48bf42106f3f40cd769dd (diff) | |
download | android_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.tar.gz android_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.tar.bz2 android_packages_apps_Trebuchet-1b60530b9272671b6bddda223aea9dfd95f5d469.zip |
release-request-42a2a3ad-8c90-4c84-a0ad-5d067beb8e30-for-git_oc-mr1-release-4349323 snap-temp-L16100000104414353
Change-Id: I98e6266bf9b4b187c6ad6f24d06b1f02e8beef97
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsGridAdapter.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsGridAdapter.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java index ba4fbe061..1f60fcc73 100644 --- a/src/com/android/launcher3/allapps/AllAppsGridAdapter.java +++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java @@ -448,9 +448,20 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter. row = Math.abs(numTotalRows - row); } - // We manipulate the stiffness, min, and max values based on the items distance to the - // first row and the items distance to the center column to create the ^-shaped motion - // effect. + calculateSpringValues(spring, row, col); + } + + @Override + public void setDefaultValues(SpringAnimation spring) { + calculateSpringValues(spring, 0, mAppsPerRow / 2); + } + + /** + * We manipulate the stiffness, min, and max values based on the items distance to the + * first row and the items distance to the center column to create the ^-shaped motion + * effect. + */ + private void calculateSpringValues(SpringAnimation spring, int row, int col) { float rowFactor = (1 + row) * 0.5f; float colFactor = getColumnFactor(col, mAppsPerRow); |