当前位置: 首页>>代码示例>>Java>>正文


Java ChangeImageTransform类代码示例

本文整理汇总了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();

    }
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:25,代码来源:ImageSharedTransitionActivity.java

示例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);
    }
}
 
开发者ID:murielK,项目名称:AndroidWPTemplate,代码行数:18,代码来源:AbsBaseActivity.java

示例3: FragmentSharedElementTransition

import android.transition.ChangeImageTransform; //导入依赖的package包/类
public FragmentSharedElementTransition() {
  addTransition(new ChangeBounds());
  addTransition(new Fade());
  addTransition(new ChangeImageTransform());
  addTransition(new ChangeTransform());
  setInterpolator(new FastOutSlowInInterpolator());
}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:8,代码来源:FragmentSharedElementTransition.java

示例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;
}
 
开发者ID:airbnb,项目名称:native-navigation,代码行数:9,代码来源:AutoSharedElementCallback.java

示例5: ImageTransition

import android.transition.ChangeImageTransform; //导入依赖的package包/类
public ImageTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds());
    addTransition(new ChangeTransform());
    addTransition(new ChangeImageTransform());
    setPathMotion(new ArcMotion());
}
 
开发者ID:fzymek,项目名称:FunWithAndroid,代码行数:8,代码来源:ImageTransition.java

示例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);
}
 
开发者ID:HugoGresse,项目名称:Anecdote,代码行数:10,代码来源:ImageTransitionSet.java

示例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());
}
 
开发者ID:Zeyad-37,项目名称:UseCases,代码行数:8,代码来源:DetailsTransition.java

示例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);
        }
    }
}
 
开发者ID:dakshj,项目名称:TMDb_Sample,代码行数:32,代码来源:MovieListActivity.java

示例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");
    }
}
 
开发者ID:byoutline,项目名称:kickmaterial,代码行数:12,代码来源:SharedElementTransition.java

示例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;
            }

        }
 
开发者ID:ToxicBakery,项目名称:LollipopDemo,代码行数:30,代码来源:NewActivityTransitionsActivity.java

示例11: init

import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void init() {
  setOrdering(ORDERING_TOGETHER);
  addTransition(new ChangeBounds()).
      addTransition(new ChangeTransform()).
      addTransition(new ChangeImageTransform());
}
 
开发者ID:Arjun-sna,项目名称:android-permission-checker-app,代码行数:7,代码来源:Transition.java

示例12: init

import android.transition.ChangeImageTransform; //导入依赖的package包/类
private void init() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds()).
            addTransition(new ChangeTransform()).
            addTransition(new ChangeImageTransform());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:7,代码来源:DetailTransition.java

示例13: MorphTransition

import android.transition.ChangeImageTransform; //导入依赖的package包/类
private MorphTransition(int shape) {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new MusicCoverViewTransition(shape));
    addTransition(new ChangeImageTransform());
    addTransition(new ChangeTransform());
}
 
开发者ID:andremion,项目名称:Music-Cover-View,代码行数:7,代码来源:MusicCoverView.java

示例14: DetailTransition

import android.transition.ChangeImageTransform; //导入依赖的package包/类
public DetailTransition() {
    setOrdering(ORDERING_TOGETHER);
    addTransition(new ChangeBounds())
            .addTransition(new ChangeTransform())
            . addTransition(new ChangeImageTransform());
}
 
开发者ID:DMCApps,项目名称:NavigationFragment,代码行数:7,代码来源:DetailTransition.java

示例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);
}
 
开发者ID:afollestad,项目名称:polar-dashboard,代码行数:43,代码来源:ViewerActivity.java


注:本文中的android.transition.ChangeImageTransform类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。