本文整理汇总了Java中android.transition.ChangeImageTransform类的典型用法代码示例。如果您正苦于以下问题:Java ChangeImageTransform类的具体用法?Java ChangeImageTransform怎么用?Java ChangeImageTransform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChangeImageTransform类属于android.transition包,在下文中一共展示了ChangeImageTransform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.transition.ChangeImageTransform; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
// getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
super.onCreate(savedInstanceState);
Slide slideIn = new Slide();
slideIn.setDuration(500);
//设置为进入
slideIn.setMode(Visibility.MODE_IN);
//设置从右边进入
slideIn.setSlideEdge(Gravity.RIGHT);
getWindow().setEnterTransition(new ChangeImageTransform().setDuration(3000));
// getWindow().setEnterTransition(new Explode().setDuration(2000));
// getWindow().setExitTransition(new Explode().setDuration(2000));
Slide slideReturn =new Slide();
slideReturn.setDuration(500);
slideReturn.setSlideEdge(Gravity.LEFT);
slideReturn.setMode(Visibility.MODE_OUT);
getWindow().setReturnTransition (slideReturn );
setContentView(R.layout.activity_img_transition);
mImageView = (ImageView) findViewById(R.id.img);
// Transition sharedElementEnterTransition = getWindow().getSharedElementEnterTransition();
}
示例2: initAnimation
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void initAnimation() {
if (Build.VERSION.SDK_INT >= 21) {
//To enable window content transitions in your code instead, call the Window.requestFeature() method:
getWindow().requestFeature(android.view.Window.FEATURE_CONTENT_TRANSITIONS);
Transition ts_enter = new ChangeImageTransform(); //Slide(); //Explode();
Transition ts_exit = new ChangeTransform();
ts_enter.setDuration(400);
ts_exit.setDuration(400);
/*
If you have set an enter transition for the second activity,
the transition is also activated when the activity starts.
*/
getWindow().setEnterTransition(ts_enter);
getWindow().setExitTransition(ts_exit);
}
}
示例3: FragmentSharedElementTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
public FragmentSharedElementTransition() {
addTransition(new ChangeBounds());
addTransition(new Fade());
addTransition(new ChangeImageTransform());
addTransition(new ChangeTransform());
setInterpolator(new FastOutSlowInInterpolator());
}
示例4: getDefaultTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
@TargetApi(TARGET_API) private Transition getDefaultTransition() {
TransitionSet set = new TransitionSet();
set.addTransition(new ChangeBounds());
set.addTransition(new Fade());
set.addTransition(new ChangeImageTransform());
set.setInterpolator(new FastOutSlowInInterpolator());
return set;
}
示例5: ImageTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
public ImageTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds());
addTransition(new ChangeTransform());
addTransition(new ChangeImageTransform());
setPathMotion(new ArcMotion());
}
示例6: init
import android.transition.ChangeImageTransform; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
super.addListener(this);
}
示例7: DetailsTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public DetailsTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds())
.addTransition(new ChangeTransform())
.addTransition(new ChangeImageTransform());
}
示例8: showMovieDetails
import android.transition.ChangeImageTransform; //导入依赖的package包/类
@Override
public void showMovieDetails(Movie movie, MovieListItemBinding B) {
setSelectedMovie(movie);
if (isTwoPane()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
fragmentTwoPane = MovieDetailFragment.newInstance(movie);
fragmentTwoPane.setSharedElementEnterTransition(new ChangeImageTransform());
getSupportFragmentManager().beginTransaction()
.replace(R.id.movieDetailContainer, fragmentTwoPane)
.addToBackStack(null)
.addSharedElement(B.imagePoster, getString(R.string.poster_image_transition))
.commit();
} else {
loadTwoPaneMovieDetails(movie);
}
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//Shared Element Transition of Poster Image from Master List to Detail screen
ActivityOptionsCompat profileImageTransitionOptions = ActivityOptionsCompat
.makeSceneTransitionAnimation(this, B.imagePoster,
getString(R.string.poster_image_transition));
MovieDetailActivity.start(this, movie, profileImageTransitionOptions);
} else {
MovieDetailActivity.start(this, movie);
}
}
}
示例9: SharedElementTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
public SharedElementTransition(Context context, AttributeSet attrs) {
super(context, attrs);
fabTransition = new CircleTransition(context, attrs);
imageTransition = new ChangeImageTransform(context, attrs);
defaultTransition = new ChangeBounds(context, attrs);
fabTransitionName = context.getString(R.string.transition_fab);
transitionProperties = initTransProps();
if (BuildConfig.DEBUG && TextUtils.isEmpty(fabTransitionName)) {
throw new AssertionError("Transition name should not be empty");
}
}
示例10: setupTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void setupTransition() {
int transitionType = getIntent().getIntExtra(EXTRA_TRANSITION_TYPE, -1);
Window window = getWindow();
window.requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
window.setAllowEnterTransitionOverlap(true);
switch (transitionType) {
case TRAN_TYPE_EXPLODE:
window.setEnterTransition(new Explode());
window.setExitTransition(new Explode());
break;
case TRAN_TYPE_SLIDE:
window.setEnterTransition(new Slide(Gravity.LEFT));
window.setExitTransition(new Slide(Gravity.RIGHT));
break;
case TRAN_TYPE_FADE:
window.setEnterTransition(new Fade(Fade.MODE_IN));
window.setExitTransition(new Fade(Fade.MODE_OUT));
break;
case TRAN_TYPE_VIEW_SHARE:
window.requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
window.setSharedElementEnterTransition(new ChangeImageTransform());
window.setSharedElementExitTransition(new ChangeImageTransform());
break;
}
}
示例11: init
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
}
示例12: init
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
}
示例13: MorphTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private MorphTransition(int shape) {
setOrdering(ORDERING_TOGETHER);
addTransition(new MusicCoverViewTransition(shape));
addTransition(new ChangeImageTransform());
addTransition(new ChangeTransform());
}
示例14: DetailTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
public DetailTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds())
.addTransition(new ChangeTransform())
. addTransition(new ChangeImageTransform());
}
示例15: setTransition
import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void setTransition() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return;
}
final TransitionSet transition = new TransitionSet();
ChangeBounds transition1 = new ChangeBounds();
transition.addTransition(transition1);
ChangeTransform transition2 = new ChangeTransform();
transition.addTransition(transition2);
ChangeClipBounds transition3 = new ChangeClipBounds();
transition.addTransition(transition3);
ChangeImageTransform transition4 = new ChangeImageTransform();
transition.addTransition(transition4);
transition.setDuration(SHARED_ELEMENT_TRANSITION_DURATION);
FastOutSlowInInterpolator interpolator = new FastOutSlowInInterpolator();
transition1.setInterpolator(interpolator);
transition2.setInterpolator(interpolator);
transition3.setInterpolator(interpolator);
transition4.setInterpolator(interpolator);
final GravityArcMotion pathMotion = new GravityArcMotion();
transition.setPathMotion(pathMotion);
getWindow().setSharedElementEnterTransition(transition);
getWindow().setSharedElementReturnTransition(transition);
getWindow().setSharedElementsUseOverlay(false);
Slide slide = new Slide(Gravity.TOP);
slide.setInterpolator(new LinearOutSlowInInterpolator());
slide.addTarget(appBar);
slide.setDuration(225);
slide.setStartDelay(100);
getWindow().setEnterTransition(slide);
Slide slideOut = (Slide) slide.clone();
slideOut.setInterpolator(new FastOutLinearInInterpolator());
slideOut.setStartDelay(0);
getWindow().setReturnTransition(slideOut);
}