Search in sources :

Example 6 with EpicenterCallback

use of android.transition.Transition.EpicenterCallback in project android_frameworks_base by crdroidandroid.

the class TransitionTest method testClone.

public void testClone() throws Throwable {
    View square1 = mActivity.findViewById(R.id.square1);
    View square2 = mActivity.findViewById(R.id.square2);
    View square3 = mActivity.findViewById(R.id.square3);
    Fade fade = new Fade();
    fade.setStartDelay(1000);
    fade.setDuration(1001);
    fade.addTarget(square1);
    fade.excludeTarget(square2, true);
    fade.excludeChildren(square3, true);
    fade.addTarget(R.id.square4);
    fade.excludeTarget(R.id.square3, true);
    fade.excludeChildren(R.id.square2, true);
    fade.addTarget("hello");
    fade.excludeTarget("world", true);
    fade.addTarget(View.class);
    fade.excludeTarget(TextView.class, true);
    fade.setMatchOrder(Transition.MATCH_ID);
    fade.setPropagation(new CircularPropagation());
    fade.setPathMotion(new ArcMotion());
    fade.setInterpolator(new AccelerateInterpolator());
    fade.setNameOverrides(new ArrayMap<>());
    EpicenterCallback epicenterCallback = new EpicenterCallback() {

        @Override
        public Rect onGetEpicenter(Transition transition) {
            return null;
        }
    };
    fade.setEpicenterCallback(epicenterCallback);
    Fade clone = (Fade) fade.clone();
    assertEquals(fade.mStartDelay, clone.mStartDelay);
    assertEquals(fade.mDuration, clone.mDuration);
    assertEquals(fade.mInterpolator, clone.mInterpolator);
    assertEquals(fade.mPropagation, clone.mPropagation);
    assertEquals(fade.getPathMotion(), clone.getPathMotion());
    assertEquals(fade.getEpicenterCallback(), clone.getEpicenterCallback());
    assertEquals(fade.mNameOverrides, clone.mNameOverrides);
    assertEquals(fade.mMatchOrder, clone.mMatchOrder);
    assertEquals(fade.mTargets, clone.mTargets);
    assertEquals(fade.mTargetExcludes, clone.mTargetExcludes);
    assertEquals(fade.mTargetChildExcludes, clone.mTargetChildExcludes);
    assertEquals(fade.mTargetIds, clone.mTargetIds);
    assertEquals(fade.mTargetIdExcludes, clone.mTargetIdExcludes);
    assertEquals(fade.mTargetIdChildExcludes, clone.mTargetIdChildExcludes);
    assertEquals(fade.mTargetNames, clone.mTargetNames);
    assertEquals(fade.mTargetNameExcludes, clone.mTargetNameExcludes);
    assertEquals(fade.mTargetTypes, clone.mTargetTypes);
    assertEquals(fade.mTargetTypeExcludes, clone.mTargetTypeExcludes);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) EpicenterCallback(android.transition.Transition.EpicenterCallback) TextView(android.widget.TextView) View(android.view.View)

Aggregations

EpicenterCallback (android.transition.Transition.EpicenterCallback)6 View (android.view.View)6 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)5 TextView (android.widget.TextView)5 Rect (android.graphics.Rect)1 Transition (android.transition.Transition)1 TransitionListenerAdapter (android.transition.Transition.TransitionListenerAdapter)1 ViewGroup (android.view.ViewGroup)1 ViewParent (android.view.ViewParent)1 LayoutParams (android.view.WindowManager.LayoutParams)1