Best code examples for Android LayoutTransition class (android.animation.LayoutTransition)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android LayoutTransition class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android LayoutTransition examples from Open Source projects
This code example shows how to use the following methods: getDuration, setAnimator
                PropertyValuesHolder.ofFloat("scaleX", 1f, 0f, 1f);
        PropertyValuesHolder pvhScaleY =
                PropertyValuesHolder.ofFloat("scaleY", 1f, 0f, 1f);
        final ObjectAnimator changeIn = ObjectAnimator.ofPropertyValuesHolder(
                        this, pvhLeft, pvhTop, pvhRight, pvhBottom, pvhScaleX, pvhScaleY).
                setDuration(mTransitioner.getDuration(LayoutTransition.CHANGE_APPEARING));
        mTransitioner.setAnimator(LayoutTransition.CHANGE_APPEARING, changeIn);
        changeIn.addListener(new AnimatorListenerAdapter() {
            public void onAnimationEnd(Animator anim) {
                View view = (View) ((ObjectAnimator) anim).getTarget();
                view.setScaleX(1f);
                view.setScaleY(1f);
            } 
        }); 
 
        // Changing while Removing 
        Keyframe kf0 = Keyframe.ofFloat(0f, 0f);
        Keyframe kf1 = Keyframe.ofFloat(.9999f, 360f);
        Keyframe kf2 = Keyframe.ofFloat(1f, 0f);
        PropertyValuesHolder pvhRotation =

8
CodeRank
This code example shows how to use the following methods: isRunning, cancel
    // Suppress layout transitions for a little while. 
    public void setLayoutTransitionsEnabled(boolean b) {
        if (b) {
            setLayoutTransition(mRealLayoutTransition);
        } else { 
            if (mRealLayoutTransition.isRunning()) {
                mRealLayoutTransition.cancel();
            } 
            setLayoutTransition(null);
        } 
    } 
 
    public void dismissRowAnimated(View child) {
        dismissRowAnimated(child, 0);
    } 
 
    public void dismissRowAnimated(View child, int vel) {
        mSwipeHelper.dismissChild(child, vel);
    } 
 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: isChangingLayout, isRunning
    } 
 
    private void logLayoutTransition() { 
        Log.v(TAG, "layout " +
              (mRealLayoutTransition.isChangingLayout() ? "is " : "is not ") +
              "in transition and animations " + 
              (mRealLayoutTransition.isRunning() ? "are " : "are not ") +
              "running."); 
    } 
 
    @Override 
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (DEBUG) Log.v(TAG, "onInterceptTouchEvent()");
        if (DEBUG) logLayoutTransition();
 
        return mSwipeHelper.onInterceptTouchEvent(ev) ||
                super.onInterceptTouchEvent(ev);
    } 
 
    @Override 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getDuration
                PropertyValuesHolder.ofFloat("scaleX", 1f, 0f, 1f);
        PropertyValuesHolder pvhScaleY =
                PropertyValuesHolder.ofFloat("scaleY", 1f, 0f, 1f);
        customChangingAppearingAnim = ObjectAnimator.ofPropertyValuesHolder(
                        this, pvhLeft, pvhTop, pvhRight, pvhBottom, pvhScaleX, pvhScaleY).
                setDuration(transition.getDuration(LayoutTransition.CHANGE_APPEARING));
        customChangingAppearingAnim.addListener(new AnimatorListenerAdapter() {
            public void onAnimationEnd(Animator anim) {
                View view = (View) ((ObjectAnimator) anim).getTarget();
                view.setScaleX(1f);
                view.setScaleY(1f);
            } 
        }); 
 
        // Changing while Removing 
        Keyframe kf0 = Keyframe.ofFloat(0f, 0f);
        Keyframe kf1 = Keyframe.ofFloat(.9999f, 360f);
        Keyframe kf2 = Keyframe.ofFloat(1f, 0f);
        PropertyValuesHolder pvhRotation =
                PropertyValuesHolder.ofKeyframe("rotation", kf0, kf1, kf2);

6
CodeRank
This code example shows how to use the following methods: getDuration, setAnimator, setDuration, setStagger
        CheckBox customAnimCB = (CheckBox) findViewById(R.id.customAnimCB);
        customAnimCB.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                long duration;
                if (isChecked) {
                    mTransitioner.setStagger(LayoutTransition.CHANGE_APPEARING, 30);
                    mTransitioner.setStagger(LayoutTransition.CHANGE_DISAPPEARING, 30);
                    setupCustomAnimations(); 
                    duration = 500;
                } else { 
                    resetTransition(); 
                    duration = 300;
                } 
                mTransitioner.setDuration(duration);
            } 
        }); 
    } 
 
    private void resetTransition() { 
        mTransitioner = new LayoutTransition();

6
CodeRank
Related Android LayoutTransition Questions & Answers:
See Code Examples for Android LayoutTransition Methods: