Add spring to QSB when opening all apps.

Bug: 64355491
Change-Id: I760856a32779b314c8b01ef2c051985e18b68ecb
This commit is contained in:
Jon Miranda
2017-08-23 13:19:24 -07:00
parent 86ba394ad0
commit c90a89d997
5 changed files with 63 additions and 6 deletions

View File

@@ -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);