use of android.transition.Transition in project focus-android by mozilla-mobile.
the class FirstrunFragment method onAttach.
@Override
public void onAttach(Context context) {
super.onAttach(context);
final Transition transition = TransitionInflater.from(context).inflateTransition(R.transition.firstrun_exit);
setExitTransition(transition);
// We will send a telemetry event whenever a new firstrun page is shown. However this page
// listener won't fire for the initial page we are showing. So we are going to firing here.
TelemetryWrapper.showFirstRunPageEvent(0);
}
use of android.transition.Transition in project Material-Movies by saulmm.
the class TransitionUtils method makeSharedElementEnterTransition.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static Transition makeSharedElementEnterTransition(Context context) {
Transition changeBounds = new ChangeBounds();
changeBounds.addTarget(R.id.item_movie_cover);
return changeBounds;
}
use of android.transition.Transition in project Material-Movies by saulmm.
the class MovieDetailActivity method configureEnterTransition.
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void configureEnterTransition() {
getWindow().setSharedElementEnterTransition(TransitionUtils.makeSharedElementEnterTransition(this));
postponeEnterTransition();
int moviePosition = getIntent().getIntExtra(MoviesActivity.EXTRA_MOVIE_POSITION, 0);
mCoverImageView.setTransitionName(MoviesActivity.SHARED_ELEMENT_COVER + moviePosition);
mObservableScrollView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
mObservableScrollView.getViewTreeObserver().removeOnPreDrawListener(this);
startPostponedEnterTransition();
return true;
}
});
getWindow().getSharedElementEnterTransition().addListener(new TransitionAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
animateElementsByScale();
}
});
}
use of android.transition.Transition in project packages_apps_Contacts by AOKP.
the class ExpandingEntryCardView method expand.
private void expand() {
ChangeBounds boundsTransition = new ChangeBounds();
boundsTransition.setDuration(DURATION_EXPAND_ANIMATION_CHANGE_BOUNDS);
Fade fadeIn = new Fade(Fade.IN);
fadeIn.setDuration(DURATION_EXPAND_ANIMATION_FADE_IN);
fadeIn.setStartDelay(DELAY_EXPAND_ANIMATION_FADE_IN);
TransitionSet transitionSet = new TransitionSet();
transitionSet.addTransition(boundsTransition);
transitionSet.addTransition(fadeIn);
transitionSet.excludeTarget(R.id.text, /* exclude = */
true);
final ViewGroup transitionViewContainer = mAnimationViewGroup == null ? this : mAnimationViewGroup;
transitionSet.addListener(new TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
mListener.onExpand();
}
@Override
public void onTransitionEnd(Transition transition) {
mListener.onExpandDone();
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
}
@Override
public void onTransitionResume(Transition transition) {
}
});
TransitionManager.beginDelayedTransition(transitionViewContainer, transitionSet);
mIsExpanded = true;
// In order to insert new entries, we may need to inflate them for the first time
inflateAllEntries(LayoutInflater.from(getContext()));
insertEntriesIntoViewGroup();
updateExpandCollapseButton(getCollapseButtonText(), DURATION_EXPAND_ANIMATION_CHANGE_BOUNDS);
}
use of android.transition.Transition in project animate by hitherejoe.
the class TransitionInActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_transition_in);
ButterKnife.bind(this);
String transition = getIntent().getStringExtra(EXTRA_TRANSITION);
switch(transition) {
case TRANSITION_SLIDE_RIGHT:
Transition transitionSlideRight = TransitionInflater.from(this).inflateTransition(R.transition.slide_right);
getWindow().setEnterTransition(transitionSlideRight);
break;
case TRANSITION_SLIDE_BOTTOM:
Transition transitionSlideBottom = TransitionInflater.from(this).inflateTransition(R.transition.slide_bottom);
getWindow().setEnterTransition(transitionSlideBottom);
break;
case TRANSITION_FADE_FAST:
Transition transitionFadeFast = TransitionInflater.from(this).inflateTransition(R.transition.fade_fast);
getWindow().setEnterTransition(transitionFadeFast);
break;
case TRANSITION_FADE_SLOW:
Transition transitionFadeSlow = TransitionInflater.from(this).inflateTransition(R.transition.fade_slow);
getWindow().setEnterTransition(transitionFadeSlow);
break;
case TRANSITION_EXPLODE:
Transition transitionExplode = TransitionInflater.from(this).inflateTransition(R.transition.explode);
getWindow().setEnterTransition(transitionExplode);
break;
case TRANSITION_EXPLODE_BOUNCE:
Transition transitionExplodeBounce = TransitionInflater.from(this).inflateTransition(R.transition.explode_bounce);
getWindow().setEnterTransition(transitionExplodeBounce);
break;
}
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
Aggregations