diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-12-07 12:45:49 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-12-07 12:46:26 -0800 |
commit | e3c6d58b71ae46dfdd20b8aeefbff858b8a9dc99 (patch) | |
tree | 4d64bb1fb5f35d2ab785b6adec196f09093706f4 /src/com/android/launcher3/anim | |
parent | bc683e9d067e1346a5a1575ab2315062b8bc41a1 (diff) | |
download | android_packages_apps_Trebuchet-e3c6d58b71ae46dfdd20b8aeefbff858b8a9dc99.tar.gz android_packages_apps_Trebuchet-e3c6d58b71ae46dfdd20b8aeefbff858b8a9dc99.tar.bz2 android_packages_apps_Trebuchet-e3c6d58b71ae46dfdd20b8aeefbff858b8a9dc99.zip |
Adding support for tagging animations per controller, so that they can be controlled independently
Change-Id: I6f360362aa16f7e02fe5fe84976b23663f228030
Diffstat (limited to 'src/com/android/launcher3/anim')
-rw-r--r-- | src/com/android/launcher3/anim/AnimatorSetBuilder.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/com/android/launcher3/anim/AnimatorSetBuilder.java b/src/com/android/launcher3/anim/AnimatorSetBuilder.java new file mode 100644 index 000000000..0e44b73ce --- /dev/null +++ b/src/com/android/launcher3/anim/AnimatorSetBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.launcher3.anim; + +import android.animation.Animator; +import android.animation.AnimatorSet; + +import com.android.launcher3.LauncherAnimUtils; + +import java.util.ArrayList; + +/** + * Utility class for building animator set + */ +public class AnimatorSetBuilder { + + protected final ArrayList<Animator> mAnims = new ArrayList<>(); + + public void startTag(Object obj) { } + + public void play(Animator anim) { + mAnims.add(anim); + } + + public AnimatorSet build() { + AnimatorSet anim = LauncherAnimUtils.createAnimatorSet(); + anim.playTogether(mAnims); + return anim; + } +} |