Java 类android.transition.ChangeImageTransform 实例源码

项目:SunmiUI    文件:ImageSharedTransitionActivity.java   
@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();

    }
项目:SunmiUI    文件:ImageSharedTransitionActivity.java   
@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();

    }
项目:AndroidWPTemplate    文件:AbsBaseActivity.java   
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);
    }
}
项目:native-navigation    文件:FragmentSharedElementTransition.java   
public FragmentSharedElementTransition() {
  addTransition(new ChangeBounds());
  addTransition(new Fade());
  addTransition(new ChangeImageTransform());
  addTransition(new ChangeTransform());
  setInterpolator(new FastOutSlowInInterpolator());
}
项目:native-navigation    文件:AutoSharedElementCallback.java   
@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;
}
项目:FunWithAndroid    文件:ImageTransition.java   
public ImageTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds());
    addTransition(new ChangeTransform());
    addTransition(new ChangeImageTransform());
    setPathMotion(new ArcMotion());
}
项目:MVP-Sample    文件:ImageTransition.java   
public ImageTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds());
    addTransition(new ChangeTransform());
    addTransition(new ChangeImageTransform());
    setPathMotion(new ArcMotion());
}
项目:Anecdote    文件:ImageTransitionSet.java   
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());

    super.addListener(this);
}
项目:UseCases    文件:DetailsTransition.java   
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public DetailsTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds())
            .addTransition(new ChangeTransform())
            .addTransition(new ChangeImageTransform());
}
项目:TMDb_Sample    文件:MovieListActivity.java   
@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);
        }
    }
}
项目:kickmaterial    文件:SharedElementTransition.java   
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");
    }
}
项目:onyxbeacon-android-sdk    文件:SharedElementTransition.java   
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");
    }
}
项目:LollipopDemo    文件:NewActivityTransitionsActivity.java   
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;
            }

        }
项目:android-permission-checker-app    文件:Transition.java   
private void init() {
  setOrdering(ORDERING_TOGETHER);
  addTransition(new ChangeBounds()).
      addTransition(new ChangeTransform()).
      addTransition(new ChangeImageTransform());
}
项目:GitHub    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:Android-UtilCode    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:WatchIt    文件:DetailsTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:AndroidUtilCode-master    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:simple-stack    文件:DetailsTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:Music-Cover-View    文件:MusicCoverView.java   
private MorphTransition(int shape) {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new MusicCoverViewTransition(shape));
    addTransition(new ChangeImageTransform());
    addTransition(new ChangeTransform());
}
项目:AndroidUtilCode    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:AutoMusicTagFixer    文件:DetailsTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:ForPDA    文件:DetailsTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:Fragmentation    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:android101    文件:DetailTransition.java   
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
项目:NavigationFragment    文件:DetailTransition.java   
public DetailTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds())
            .addTransition(new ChangeTransform())
            . addTransition(new ChangeImageTransform());
}
项目:polar-dashboard    文件:ViewerActivity.java   
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);
}
项目:binea_project_for_android    文件:ImageTransformSample.java   
@Override protected Transition createTransition() {
    TransitionSet transition = new TransitionSet();
    transition.addTransition(new ChangeBounds()).addTransition(new ChangeImageTransform());
    return transition;
}
项目:wwmmo    文件:Transitions.java   
private void init() {
  setOrdering(ORDERING_TOGETHER);
  this.addTransition(new ChangeBounds())
      .addTransition(new ChangeTransform())
      .addTransition(new ChangeImageTransform());
}