mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Add springs when user clicks on caret / all apps snaps to top.
Bug: 65373058 Change-Id: I9cc5c4c98fd3e5b53d597c4493f2dcef6d9be94a
This commit is contained in:
committed by
Jonathan Miranda
parent
2021828034
commit
610af37575
@@ -424,6 +424,9 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
|
||||
// The amount by which each adjacent rows' stiffness will differ.
|
||||
private static final float ROW_STIFFNESS_COEFFICIENT = 50f;
|
||||
|
||||
// The percentage by which we multiply each row to create the row factor.
|
||||
private static final float ROW_PERCENTAGE = 0.3f;
|
||||
|
||||
@Override
|
||||
public SpringAnimation initialize(ViewHolder vh) {
|
||||
return SpringAnimationHandler.forView(vh.itemView, DynamicAnimation.TRANSLATION_Y, 0);
|
||||
@@ -462,7 +465,7 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
|
||||
* effect.
|
||||
*/
|
||||
private void calculateSpringValues(SpringAnimation spring, int row, int col) {
|
||||
float rowFactor = (1 + row) * 0.5f;
|
||||
float rowFactor = (1 + row) * ROW_PERCENTAGE;
|
||||
float colFactor = getColumnFactor(col, mAppsPerRow);
|
||||
|
||||
float minValue = DEFAULT_MIN_VALUE_PX * (rowFactor + colFactor);
|
||||
|
||||
Reference in New Issue
Block a user