Search in sources :

Example 21 with LayoutTransition

use of android.animation.LayoutTransition in project android_frameworks_base by ResurrectionRemix.

the class NavigationBarView method updateLayoutTransitionsEnabled.

private void updateLayoutTransitionsEnabled() {
    boolean enabled = !mWakeAndUnlocking && mLayoutTransitionsEnabled;
    ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons);
    LayoutTransition lt = navButtons.getLayoutTransition();
    if (lt != null) {
        if (enabled) {
            lt.enableTransitionType(LayoutTransition.APPEARING);
            lt.enableTransitionType(LayoutTransition.DISAPPEARING);
            lt.enableTransitionType(LayoutTransition.CHANGE_APPEARING);
            lt.enableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
        } else {
            lt.disableTransitionType(LayoutTransition.APPEARING);
            lt.disableTransitionType(LayoutTransition.DISAPPEARING);
            lt.disableTransitionType(LayoutTransition.CHANGE_APPEARING);
            lt.disableTransitionType(LayoutTransition.CHANGE_DISAPPEARING);
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) LayoutTransition(android.animation.LayoutTransition)

Example 22 with LayoutTransition

use of android.animation.LayoutTransition in project android_frameworks_base by ResurrectionRemix.

the class ViewGroup method setLayoutTransition.

/**
     * Sets the LayoutTransition object for this ViewGroup. If the LayoutTransition object is
     * not null, changes in layout which occur because of children being added to or removed from
     * the ViewGroup will be animated according to the animations defined in that LayoutTransition
     * object. By default, the transition object is null (so layout changes are not animated).
     *
     * <p>Replacing a non-null transition will cause that previous transition to be
     * canceled, if it is currently running, to restore this container to
     * its correct post-transition state.</p>
     *
     * @param transition The LayoutTransition object that will animated changes in layout. A value
     * of <code>null</code> means no transition will run on layout changes.
     * @attr ref android.R.styleable#ViewGroup_animateLayoutChanges
     */
public void setLayoutTransition(LayoutTransition transition) {
    if (mTransition != null) {
        LayoutTransition previousTransition = mTransition;
        previousTransition.cancel();
        previousTransition.removeTransitionListener(mLayoutTransitionListener);
    }
    mTransition = transition;
    if (mTransition != null) {
        mTransition.addTransitionListener(mLayoutTransitionListener);
    }
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Example 23 with LayoutTransition

use of android.animation.LayoutTransition in project android_frameworks_base by ResurrectionRemix.

the class FragmentBreadCrumbs method setActivity.

/**
     * Attach the bread crumbs to their activity.  This must be called once
     * when creating the bread crumbs.
     */
public void setActivity(Activity a) {
    mActivity = a;
    mInflater = (LayoutInflater) a.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    mContainer = (LinearLayout) mInflater.inflate(com.android.internal.R.layout.fragment_bread_crumbs, this, false);
    addView(mContainer);
    a.getFragmentManager().addOnBackStackChangedListener(this);
    updateCrumbs();
    setLayoutTransition(new LayoutTransition());
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Example 24 with LayoutTransition

use of android.animation.LayoutTransition in project android_frameworks_base by DirtyUnicorns.

the class ViewGroup method setLayoutTransition.

/**
     * Sets the LayoutTransition object for this ViewGroup. If the LayoutTransition object is
     * not null, changes in layout which occur because of children being added to or removed from
     * the ViewGroup will be animated according to the animations defined in that LayoutTransition
     * object. By default, the transition object is null (so layout changes are not animated).
     *
     * <p>Replacing a non-null transition will cause that previous transition to be
     * canceled, if it is currently running, to restore this container to
     * its correct post-transition state.</p>
     *
     * @param transition The LayoutTransition object that will animated changes in layout. A value
     * of <code>null</code> means no transition will run on layout changes.
     * @attr ref android.R.styleable#ViewGroup_animateLayoutChanges
     */
public void setLayoutTransition(LayoutTransition transition) {
    if (mTransition != null) {
        LayoutTransition previousTransition = mTransition;
        previousTransition.cancel();
        previousTransition.removeTransitionListener(mLayoutTransitionListener);
    }
    mTransition = transition;
    if (mTransition != null) {
        mTransition.addTransitionListener(mLayoutTransitionListener);
    }
}
Also used : LayoutTransition(android.animation.LayoutTransition)

Example 25 with LayoutTransition

use of android.animation.LayoutTransition in project android_frameworks_base by DirtyUnicorns.

the class MLand method setScoreFieldHolder.

public void setScoreFieldHolder(ViewGroup vg) {
    mScoreFields = vg;
    if (vg != null) {
        final LayoutTransition lt = new LayoutTransition();
        lt.setDuration(250);
        mScoreFields.setLayoutTransition(lt);
    }
    for (Player p : mPlayers) {
        mScoreFields.addView(p.mScoreField, new MarginLayoutParams(MarginLayoutParams.WRAP_CONTENT, MarginLayoutParams.MATCH_PARENT));
    }
}
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