Example usage for android.animation LayoutTransition APPEARING

List of usage examples for android.animation LayoutTransition APPEARING

Introduction

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

Prototype

int APPEARING

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

Click Source Link

Document

A flag indicating the animation that runs on those items that are appearing in the container.

Usage

From source file:org.wheelmap.android.activity.MainMultiPaneActivity.java

@SuppressLint("NewApi")
@Override//from   w  w w.  j a  v  a  2s .  c o m
public void onCreate(Bundle savedInstanceState) {

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    requestWindowFeature(Window.FEATURE_ACTION_BAR);

    super.onCreate(savedInstanceState);

    appProperties = new AppProperties(WheelmapApp.getApp());
    Log.d(TAG, "onCreate");

    setProgressBarIndeterminate(true);
    setSupportProgressBarIndeterminateVisibility(false);

    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setHomeButtonEnabled(false);

    setContentView(R.layout.activity_multipane);
    mMovableLayout = (ViewGroup) findViewById(R.id.movable_layout);
    mResizeButton = (ImageButton) findViewById(R.id.button_movable_resize);

    ViewGroup g = (ViewGroup) findViewById(R.id.layout_multi);
    if (Build.VERSION.SDK_INT > 16) {
        g.getLayoutTransition().disableTransitionType(LayoutTransition.APPEARING);
    }

    if (savedInstanceState != null) {
        executeState(savedInstanceState);
    } else {
        executeDefaultInstanceState();
    }

    Bundle extras = getIntent().getExtras();
    if (extras.containsKey(Extra.MAP_MODE_ENGAGE)) {
        mapModeType = MapModeType.MAP_MODE_ENGAGE;
    } else {
        mapModeType = MapModeType.MAP_MODE_NORMAL;
    }

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);

    mResizeButton.setOnClickListener(this);

    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction t = fm.beginTransaction();

    mWorkerFragment = (CombinedWorkerFragment) fm.findFragmentByTag(CombinedWorkerFragment.TAG);

    if (mWorkerFragment == null) {
        mWorkerFragment = new CombinedWorkerFragment();
        t.add(mWorkerFragment, CombinedWorkerFragment.TAG);
    }

    mListFragment = (POIsListFragment) fm.findFragmentById(R.id.list_layout);
    if (mListFragment == null) {
        mListFragment = POIsListFragment.newInstance(false, true);
        t.add(R.id.list_layout, mListFragment, POIsListFragment.TAG);
    }

    mMapFragment = (POIsOsmdroidFragment) fm.findFragmentById(R.id.map_layout);
    if (mMapFragment == null) {
        mMapFragment = POIsOsmdroidFragment.newInstance(false, true);
        t.add(R.id.map_layout, mMapFragment, POIsOsmdroidFragment.TAG);
    }

    mDetailFragment = (POIDetailFragment) fm.findFragmentById(R.id.detail_layout);
    if (mDetailFragment == null) {
        mDetailFragment = POIDetailFragment.newInstance();
        t.add(R.id.detail_layout, mDetailFragment);
    }

    t.commit();

    WheelmapApp.checkForUpdates(this);

    app = (WheelmapApp) this.getApplication();
    String uri = null;

    try {
        address = app.getAddressString();
    } catch (Exception ex) {
    }

    if (address != null) {
        showSearch();
    }

    // Show a dialog if meets conditions
    AppRate.showRateDialogIfMeetsConditions(this);

}

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

/**
 *    initLayout Animator/*ww w  . ja  va 2 s .c om*/
 */
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 w  w  .ja  v a  2  s . c  o  m*/
    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/* ww w.  ja  v  a  2  s  .  c om*/
 */
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  av  a  2s .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);
    }/*www.j ava 2s .c  o m*/
}