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 Android-Material-Examples by saulmm.
the class TransitionSecondActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_transition_second);
rowContainer = (LinearLayout) findViewById(R.id.row_container2);
Slide slideExitTransition = new Slide(Gravity.BOTTOM);
slideExitTransition.excludeTarget(android.R.id.navigationBarBackground, true);
slideExitTransition.excludeTarget(android.R.id.statusBarBackground, true);
getWindow().getEnterTransition().addListener(new TransitionAdapter() {
@Override
public void onTransitionEnd(Transition transition) {
super.onTransitionEnd(transition);
getWindow().getEnterTransition().removeListener(this);
for (int i = 0; i < rowContainer.getChildCount(); i++) {
View rowView = rowContainer.getChildAt(i);
rowView.animate().setStartDelay(i * SCALE_DELAY).scaleX(1).scaleY(1);
}
}
});
}
use of android.transition.Transition in project BottomSheet by soarcn.
the class BottomSheet method showFullItems.
private void showFullItems() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Transition changeBounds = new ChangeBounds();
changeBounds.setDuration(300);
TransitionManager.beginDelayedTransition(list, changeBounds);
}
actions = fullMenuItem;
updateSection();
adapter.notifyDataSetChanged();
list.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
icon.setVisibility(View.VISIBLE);
icon.setImageDrawable(close);
icon.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showShortItems();
}
});
setListLayout();
}
use of android.transition.Transition in project platform_frameworks_base by android.
the class VolumeDialog method updateExpandedH.
private void updateExpandedH(final boolean expanded, final boolean dismissing) {
if (mExpanded == expanded)
return;
mExpanded = expanded;
mExpandButtonAnimationRunning = isAttached();
if (D.BUG)
Log.d(TAG, "updateExpandedH " + expanded);
updateExpandButtonH();
updateFooterH();
TransitionManager.endTransitions(mDialogView);
final VolumeRow activeRow = getActiveRow();
if (!dismissing) {
mWindow.setLayout(mWindow.getAttributes().width, ViewGroup.LayoutParams.MATCH_PARENT);
AutoTransition transition = new AutoTransition();
transition.setDuration(mExpandButtonAnimationDuration);
transition.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);
transition.addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
}
@Override
public void onTransitionEnd(Transition transition) {
mWindow.setLayout(mWindow.getAttributes().width, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onTransitionCancel(Transition transition) {
}
@Override
public void onTransitionPause(Transition transition) {
mWindow.setLayout(mWindow.getAttributes().width, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onTransitionResume(Transition transition) {
}
});
TransitionManager.beginDelayedTransition(mDialogView, transition);
}
updateRowsH(activeRow);
rescheduleTimeoutH();
}
Aggregations