Example usage for android.animation LayoutTransition CHANGE_DISAPPEARING

List of usage examples for android.animation LayoutTransition CHANGE_DISAPPEARING

Introduction

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

Prototype

int CHANGE_DISAPPEARING

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

Click Source Link

Document

A flag indicating the animation that runs on those items that are changing due to an item disappearing from the container.

Usage

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

/**
 *    initLayout Animator//from  w w w  .ja  v a 2 s. co  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 w ww . j a  v  a2s.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  www .ja 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_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   w  w w .java  2 s . c o  m
    mLayoutTransition = new LayoutTransition();
    mLayoutTransition.enableTransitionType(LayoutTransition.DISAPPEARING);
    mLayoutTransition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.APPEARING);
    mLayoutTransition.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
    setLayoutTransition(mLayoutTransition);
}