Refactor and generalize SpringAnimationHandler.

SpringAnimationHandler is only responsible for motion tracking and
updating the list of springs it is handling.

Spring initialization and updates are handled by the AnimationFactory
interface.

This is done in preparation for future CLs where SpringAnimationHandler
will be used in more cases.

Bug: 38349031
Change-Id: I5ebce710cc05e4e88b708ceea5d2cfefbd0eb3d0
This commit is contained in:
Jon Miranda
2017-06-06 15:41:21 -07:00
parent 3a5b835297
commit 5c83e7cdc5
4 changed files with 212 additions and 130 deletions

View File

@@ -91,9 +91,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
mLauncher = Launcher.getLauncher(context);
mApps = new AlphabeticalAppsList(context);
mSpringAnimationHandler = new SpringAnimationHandler(SpringAnimationHandler.Y_DIRECTION);
mAdapter = new AllAppsGridAdapter(mLauncher, mApps, mLauncher, this,
mSpringAnimationHandler);
mAdapter = new AllAppsGridAdapter(mLauncher, mApps, mLauncher, this);
mSpringAnimationHandler = mAdapter.getSpringAnimationHandler();
mApps.setAdapter(mAdapter);
mLayoutManager = mAdapter.getLayoutManager();
mSearchQueryBuilder = new SpannableStringBuilder();