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