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);
}
}
}
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);
}
}
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());
}
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);
}
}
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));
}
}
Aggregations