Search in sources :

Example 46 with LayoutTransition

use of android.animation.LayoutTransition in project Android-Developers-Samples by johnjohndoe.

the class CardStreamLinearLayout method setCardStreamAnimator.

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void setCardStreamAnimator(CardStreamAnimator animators) {
    if (animators == null)
        mAnimators = new CardStreamAnimator.EmptyAnimator();
    else
        mAnimators = animators;
    LayoutTransition layoutTransition = getLayoutTransition();
    if (layoutTransition != null) {
        layoutTransition.setAnimator(LayoutTransition.APPEARING, mAnimators.getAppearingAnimator(getContext()));
        layoutTransition.setAnimator(LayoutTransition.DISAPPEARING, mAnimators.getDisappearingAnimator(getContext()));
    }
}
Also used : LayoutTransition(android.animation.LayoutTransition) TargetApi(android.annotation.TargetApi)

Example 47 with LayoutTransition

use of android.animation.LayoutTransition in project Android-Developers-Samples by johnjohndoe.

the class CardStreamLinearLayout method onLayout.

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
    super.onLayout(changed, l, t, r, b);
    Log.d(TAG, "onLayout: " + changed);
    if (changed && !mLayouted) {
        mLayouted = true;
        ObjectAnimator animator;
        LayoutTransition layoutTransition = new LayoutTransition();
        animator = mAnimators.getDisappearingAnimator(getContext());
        layoutTransition.setAnimator(LayoutTransition.DISAPPEARING, animator);
        animator = mAnimators.getAppearingAnimator(getContext());
        layoutTransition.setAnimator(LayoutTransition.APPEARING, animator);
        layoutTransition.addTransitionListener(mTransitionListener);
        if (animator != null)
            layoutTransition.setDuration(animator.getDuration());
        setLayoutTransition(layoutTransition);
        if (mShowInitialAnimation)
            runInitialAnimations();
        if (mFirstVisibleCardTag != null) {
            scrollToCard(mFirstVisibleCardTag);
            mFirstVisibleCardTag = null;
        }
    }
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) LayoutTransition(android.animation.LayoutTransition) TargetApi(android.annotation.TargetApi)

Example 48 with LayoutTransition

use of android.animation.LayoutTransition in project android-delicious by lexs.

the class ContainerActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(getContentResource());
    getActionBar().setHomeButtonEnabled(true);
    if (savedInstanceState == null) {
        ClipboardFragment clipboard = new ClipboardFragment();
        getFragmentManager().beginTransaction().add(R.id.content, createFragment(savedInstanceState)).add(R.id.clipboard_display, clipboard).hide(clipboard).commit();
    }
    ViewGroup container = (ViewGroup) findViewById(R.id.container);
    LayoutTransition transition = new LayoutTransition();
    transition.setStartDelay(LayoutTransition.APPEARING, 0);
    transition.setStartDelay(LayoutTransition.CHANGE_APPEARING, 0);
    transition.setStartDelay(LayoutTransition.CHANGE_DISAPPEARING, 0);
    transition.setStartDelay(LayoutTransition.DISAPPEARING, 0);
    ObjectAnimator animator = ObjectAnimator.ofFloat(null, View.ALPHA, 1f, 0f);
    transition.setAnimator(LayoutTransition.DISAPPEARING, animator);
    container.setLayoutTransition(transition);
}
Also used : ViewGroup(android.view.ViewGroup) ObjectAnimator(android.animation.ObjectAnimator) LayoutTransition(android.animation.LayoutTransition) ClipboardFragment(se.alexanderblom.delicious.fragments.ClipboardFragment)

Example 49 with LayoutTransition

use of android.animation.LayoutTransition in project Launcher3 by chislon.

the class Workspace method setupLayoutTransition.

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);
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Example 50 with LayoutTransition

use of android.animation.LayoutTransition in project Launcher3 by chislon.

the class PageIndicator method enableLayoutTransitions.

private void enableLayoutTransitions() {
    LayoutTransition transition = getLayoutTransition();
    transition.enableTransitionType(LayoutTransition.APPEARING);
    transition.enableTransitionType(LayoutTransition.DISAPPEARING);
    transition.enableTransitionType(LayoutTransition.CHANGE_APPEARING);
    transition.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Aggregations

LayoutTransition (android.animation.LayoutTransition)89 ViewGroup (android.view.ViewGroup)37 View (android.view.View)19 AnimationThread (android.animation.AnimationThread)18 Result (com.android.ide.common.rendering.api.Result)18 AdapterView (android.widget.AdapterView)13 ListView (android.widget.ListView)13 AbsListView (android.widget.AbsListView)12 ExpandableListView (android.widget.ExpandableListView)12 ActionMenuView (android.widget.ActionMenuView)10 ActionMenuItemView (com.android.internal.view.menu.ActionMenuItemView)10 IconMenuItemView (com.android.internal.view.menu.IconMenuItemView)10 ListMenuItemView (com.android.internal.view.menu.ListMenuItemView)10 MenuView (com.android.internal.view.menu.MenuView)10 Paint (android.graphics.Paint)8 TypedArray (android.content.res.TypedArray)7 LayoutParams (android.view.ViewGroup.LayoutParams)7 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)7 TransitionListener (android.animation.LayoutTransition.TransitionListener)6 BridgeContext (com.android.layoutlib.bridge.android.BridgeContext)6