1f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek/* 2a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * Copyright (C) 2017 The Android Open Source Project 3f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek * 4a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * Licensed under the Apache License, Version 2.0 (the "License"); 5a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * you may not use this file except in compliance with the License. 6a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * You may obtain a copy of the License at 7f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek * 8f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek * http://www.apache.org/licenses/LICENSE-2.0 9f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek * 10a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * Unless required by applicable law or agreed to in writing, software 11a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * distributed under the License is distributed on an "AS IS" BASIS, 12a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * See the License for the specific language governing permissions and 14a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinek * limitations under the License 15f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek */ 16f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 17a7679b6f3f0fc3e7c40102b732cfa51a9830a891Selim Cinekpackage com.android.systemui.statusbar.notification; 18f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 19340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport static org.junit.Assert.assertEquals; 20340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport static org.junit.Assert.assertFalse; 21340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport static org.junit.Assert.assertNotNull; 22340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport static org.junit.Assert.assertTrue; 23340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport static org.mockito.Mockito.mock; 24340b0e5216b4fcc435e0459b1ca46155a572100dJason Monk 25f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.animation.AnimatorListenerAdapter; 26f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.animation.ValueAnimator; 27f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.test.suitebuilder.annotation.SmallTest; 28340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport android.testing.AndroidTestingRunner; 29340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport android.testing.UiThreadTest; 30f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.util.FloatProperty; 31f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.util.Property; 32f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.view.View; 33f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport android.view.animation.Interpolator; 34f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 35340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport com.android.systemui.Interpolators; 36340b0e5216b4fcc435e0459b1ca46155a572100dJason Monkimport com.android.systemui.R; 37f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport com.android.systemui.SysuiTestCase; 38f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport com.android.systemui.statusbar.stack.AnimationFilter; 39f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport com.android.systemui.statusbar.stack.AnimationProperties; 40f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport com.android.systemui.statusbar.stack.ViewState; 41f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 4260661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupinimport org.junit.Assert; 43f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport org.junit.Before; 44f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport org.junit.Test; 45f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekimport org.junit.runner.RunWith; 46f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 47f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek@SmallTest 48340b0e5216b4fcc435e0459b1ca46155a572100dJason Monk@RunWith(AndroidTestingRunner.class) 49ba3643290df00210ea0011d7ae294931e2298b7eJason Monk@UiThreadTest 50f082fe2319884737225952547bbaf5fc02359fc6Selim Cinekpublic class PropertyAnimatorTest extends SysuiTestCase { 51f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 52f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private View mView; 53f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private FloatProperty<View> mEffectiveProperty = new FloatProperty<View>("TEST") { 54f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public float mValue = 100; 55f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 56f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 57f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void setValue(View view, float value) { 58f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mValue = value; 59f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 60f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 61f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 62f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public Float get(View object) { 63f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return mValue; 64f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 65f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek }; 660228a255d6713a255dc3d68c0858be7d75fb0f97Selim Cinek private AnimatableProperty mProperty 670228a255d6713a255dc3d68c0858be7d75fb0f97Selim Cinek = new AnimatableProperty() { 68f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 69f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 70f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public int getAnimationStartTag() { 71f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return R.id.scale_x_animator_start_value_tag; 72f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 73f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 74f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 75f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public int getAnimationEndTag() { 76f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return R.id.scale_x_animator_end_value_tag; 77f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 78f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 79f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 80f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public int getAnimatorTag() { 81f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return R.id.scale_x_animator_tag; 82f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 83f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 84f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 85f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public Property getProperty() { 86f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return mEffectiveProperty; 87f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 88f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek }; 89f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private AnimatorListenerAdapter mFinishListener = mock(AnimatorListenerAdapter.class); 90f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private AnimationProperties mAnimationProperties = new AnimationProperties() { 91f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 92f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public AnimationFilter getAnimationFilter() { 93f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return mAnimationFilter; 94f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 95f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 96f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Override 97f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public AnimatorListenerAdapter getAnimationFinishListener() { 98f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek return mFinishListener; 99f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 100f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek }.setDuration(200); 101f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private AnimationFilter mAnimationFilter = new AnimationFilter(); 102f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek private Interpolator mTestInterpolator = Interpolators.ALPHA_IN; 103f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 104f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 105f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Before 106f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void setUp() { 107f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mView = new View(getContext()); 108f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 109f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 110f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 111f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testAnimationStarted() { 112f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 113f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 114f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200, mAnimationProperties); 115f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertTrue(ViewState.isAnimating(mView, mProperty)); 116f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 117f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 118f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 119f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testNoAnimationStarted() { 120f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 121f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200, mAnimationProperties); 122f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertFalse(ViewState.isAnimating(mView, mProperty)); 123f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 124f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 125f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 126f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testEndValueUpdated() { 127f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 128f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 129f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 130f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(ViewState.getChildTag(mView, mProperty.getAnimationEndTag()), 131f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek Float.valueOf(200f)); 132f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 133f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 134f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 135f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testStartTagUpdated() { 136f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mEffectiveProperty.set(mView, 100f); 137f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 138f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 139f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 140f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(ViewState.getChildTag(mView, mProperty.getAnimationStartTag()), 141f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek Float.valueOf(100f)); 142f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 143f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 144f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 145f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testValueIsSetUnAnimated() { 146f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 147f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 148f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(Float.valueOf(200f), mEffectiveProperty.get(mView)); 149f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 150f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 151f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 152f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testAnimationToRightValueUpdated() { 153f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 154f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 155f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 156f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 157f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 220f, mAnimationProperties); 158f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertTrue(ViewState.isAnimating(mView, mProperty)); 159f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(ViewState.getChildTag(mView, mProperty.getAnimationEndTag()), 160f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek Float.valueOf(220f)); 161f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 162f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 163f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 164f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testAnimationToRightValueUpdateAnimated() { 165f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 166f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 167f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 168f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 169f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 170f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 220f, mAnimationProperties); 171f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertTrue(ViewState.isAnimating(mView, mProperty)); 172f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(ViewState.getChildTag(mView, mProperty.getAnimationEndTag()), 173f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek Float.valueOf(220f)); 174f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 175f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 176f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 177f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testStartTagShiftedWhenChanging() { 178f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mEffectiveProperty.set(mView, 100f); 179f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 180f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 181f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 182f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 183f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 220f, mAnimationProperties); 184f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(ViewState.getChildTag(mView, mProperty.getAnimationStartTag()), 185f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek Float.valueOf(120f)); 186f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 187f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 188f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 189f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testUsingDuration() { 190f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 191f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 192f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationProperties.setDuration(500); 193f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 194f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek ValueAnimator animator = ViewState.getChildTag(mView, mProperty.getAnimatorTag()); 195f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertNotNull(animator); 196f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(animator.getDuration(), 500); 197f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 198f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 199f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 200f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testUsingDelay() { 201f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 202f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 203f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationProperties.setDelay(200); 204f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 205f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek ValueAnimator animator = ViewState.getChildTag(mView, mProperty.getAnimatorTag()); 206f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertNotNull(animator); 207f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(animator.getStartDelay(), 200); 208f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 209f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 210f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 211f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testUsingInterpolator() { 212f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 213f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 214f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationProperties.setCustomInterpolator(mEffectiveProperty, mTestInterpolator); 215f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 216f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek ValueAnimator animator = ViewState.getChildTag(mView, mProperty.getAnimatorTag()); 217f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertNotNull(animator); 218f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertEquals(animator.getInterpolator(), mTestInterpolator); 219f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 220f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek 221f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek @Test 222f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek public void testUsingListener() { 223f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.reset(); 224f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationFilter.animate(mProperty.getProperty()); 225f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek mAnimationProperties.setCustomInterpolator(mEffectiveProperty, mTestInterpolator); 226f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 227f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek ValueAnimator animator = ViewState.getChildTag(mView, mProperty.getAnimatorTag()); 228f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertNotNull(animator); 229f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek assertTrue(animator.getListeners().contains(mFinishListener)); 230f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek } 23160661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin 23260661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin @Test 23360661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin public void testIsAnimating() { 23460661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin mAnimationFilter.reset(); 23560661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin mAnimationFilter.animate(mProperty.getProperty()); 23660661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin assertFalse(PropertyAnimator.isAnimating(mView, mProperty)); 23760661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin PropertyAnimator.startAnimation(mView, mProperty, 200f, mAnimationProperties); 23860661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin assertTrue(PropertyAnimator.isAnimating(mView, mProperty)); 23960661a6dd8ad7728b87a36da005acaec0272dd5aLucas Dupin } 240f082fe2319884737225952547bbaf5fc02359fc6Selim Cinek} 241