Example usage for android.animation LayoutTransition DISAPPEARING

List of usage examples for android.animation LayoutTransition DISAPPEARING

Introduction

In this page you can find the example usage for android.animation LayoutTransition DISAPPEARING.

Prototype

int DISAPPEARING

To view the source code for android.animation LayoutTransition DISAPPEARING.

Click Source Link

Document

A flag indicating the animation that runs on those items that are disappearing from the container.

Usage

From source file:org.zywx.wbpalmstar.plugin.inputtextfieldview.ACEInputTextFieldView.java

/**
 *    initLayout Animator/*from   w  w  w .j a  v a 2 s  . c  o m*/
 */
private void initLayoutTransition() {
    if (mLayoutTransition != null) {
        return;
    }
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING,
            mLayoutTransition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    mLayoutTransition.setAnimator(LayoutTransition.APPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null);
    // mLayoutTransition.getAnimator(LayoutTransition.CHANGE_DISAPPEARING));
    mLayoutTransition.addTransitionListener(new TransitionListener() {

        @Override
        public void startTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
        }

        @Override
        public void endTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
            if (view.getId() == CRes.plugin_inputtextfieldview_parent_layout
                    && transitionType == LayoutTransition.CHANGE_APPEARING) {
                //Parent view height change ,so input and pager show together.
                goScroll(0);
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            } else if (view.getId() == CRes.plugin_inputtextfieldview_pager_layout
                    && transitionType == LayoutTransition.DISAPPEARING) {
                if (!isKeyBoardVisible)
                    backScroll();
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            }
        }
    });
    mParentLayout.setLayoutTransition(mLayoutTransition);
}

From source file:io.digibyte.tools.animation.BRAnimator.java

public static LayoutTransition getDefaultTransition() {
    LayoutTransition itemLayoutTransition = new LayoutTransition();
    itemLayoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
    itemLayoutTransition.setStartDelay(LayoutTransition.CHANGING, 0);
    itemLayoutTransition.setDuration(100);
    itemLayoutTransition.setInterpolator(LayoutTransition.CHANGING, new OvershootInterpolator(2f));
    Animator scaleUp = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 0, 1));
    scaleUp.setDuration(50);/*from  ww  w.  j  a v a2 s  . com*/
    scaleUp.setStartDelay(50);
    Animator scaleDown = ObjectAnimator.ofPropertyValuesHolder((Object) null,
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1, 1), PropertyValuesHolder.ofFloat(View.SCALE_Y, 1, 0));
    scaleDown.setDuration(2);
    itemLayoutTransition.setAnimator(LayoutTransition.APPEARING, scaleUp);
    itemLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    itemLayoutTransition.enableTransitionType(LayoutTransition.CHANGING);
    return itemLayoutTransition;
}

From source file:org.zywx.wbpalmstar.plugin.chatkeyboard.ACEChatKeyboardView.java

/**
 * initLayout Animator/*from   ww  w . j a v a 2s .c o m*/
 */
private void initLayoutTransition() {
    if (mLayoutTransition != null) {
        return;
    }
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_APPEARING,
            mLayoutTransition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    mLayoutTransition.setAnimator(LayoutTransition.APPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.DISAPPEARING, null);
    mLayoutTransition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, null);
    // mLayoutTransition.getAnimator(LayoutTransition.CHANGE_DISAPPEARING));
    mLayoutTransition.addTransitionListener(new TransitionListener() {

        @Override
        public void startTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
        }

        @Override
        public void endTransition(LayoutTransition transition, ViewGroup container, View view,
                int transitionType) {
            if (view.getId() == CRes.plugin_chatkeyboard_parent_layout
                    && transitionType == LayoutTransition.CHANGE_APPEARING) {
                goScroll(0);
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            } else if (view.getId() == CRes.plugin_chatkeyboard_pager_layout
                    && transitionType == LayoutTransition.DISAPPEARING) {
                if (!isKeyBoardVisible)
                    backScroll();
                jsonKeyBoardShowCallback(isKeyBoardVisible || mPagerLayout.isShown() ? 1 : 0);
            }
        }
    });
    mParentLayout.setLayoutTransition(mLayoutTransition);
}

From source file:cc.flydev.launcher.Workspace.java

private void setupLayoutTransition() {
    // We want to show layout transitions when pages are deleted, to close the gap.
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.enableTransitionType(LayoutTransition.DISAPPEARING);
    mLayoutTransition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
    setLayoutTransition(mLayoutTransition);
}

From source file:com.aidy.launcher3.ui.workspace.Workspace.java

private void setupLayoutTransition() {
    // We want to show layout transitions when pages are deleted, to close
    // the gap.//from  ww w.  j  a v a 2 s.com
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.enableTransitionType(LayoutTransition.DISAPPEARING);
    mLayoutTransition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
    setLayoutTransition(mLayoutTransition);
}

From source file:com.ywesee.amiko.MainActivity.java

@TargetApi(16)
void setLayoutTransition() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        LayoutTransition lt = new LayoutTransition();
        lt.enableTransitionType(LayoutTransition.CHANGING);
        lt.setDuration(LayoutTransition.APPEARING, 100 /*500*/);
        lt.setDuration(LayoutTransition.DISAPPEARING, 100);
        mViewHolder.setLayoutTransition(lt);
    }//from  w ww  . ja v  a 2s  . c om
}