本文整理汇总了Java中android.transition.ChangeTransform类的典型用法代码示例。如果您正苦于以下问题:Java ChangeTransform类的具体用法?Java ChangeTransform怎么用?Java ChangeTransform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChangeTransform类属于android.transition包,在下文中一共展示了ChangeTransform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
private void startTransition(){
lifeGridFragment = LifeGridFragment.newInstance();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
if(Build.VERSION.SDK_INT >= 21) {
TransitionSet gridTransition = new TransitionSet();
gridTransition.setDuration(600);
gridTransition.addTransition(new ChangeBounds());
gridTransition.addTransition((new ChangeTransform()));
lifeGridFragment.setSharedElementEnterTransition(gridTransition);
}
fragmentTransaction.addSharedElement(findViewById(R.id.intro_card_view), getString(R.string.card_view_transition_name));
fragmentTransaction.replace(R.id.container, lifeGridFragment);
fragmentTransaction.addToBackStack(null);
fragmentTransaction.commit();
appBarLayout.setExpanded(false, true);
}
示例2: createTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
@NonNull
@Override
protected Transition createTransition(@NonNull ViewGroup container, @NonNull View entering, @Nullable View leaving, boolean push) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return new TransitionSet()
.setOrdering(ORDERING_TOGETHER)
.addTransition(new Fade(Fade.OUT))
.addTransition(new Fade(Fade.IN));
}
final TransitionSet transition = new TransitionSet()
.addTransition(new ChangeBounds())
.addTransition(new ChangeClipBounds())
.addTransition(new ChangeTransform());
transition.setPathMotion(new ArcMotion());
return transition;
}
示例3: initAnimation
import android.transition.ChangeTransform; //导入依赖的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);
}
}
示例4: getTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
@Override
@NonNull
protected Transition getTransition(@NonNull ViewGroup container, View from, View to, boolean isPush) {
TransitionSet transition = new TransitionSet()
.setOrdering(TransitionSet.ORDERING_SEQUENTIAL)
.addTransition(new Fade(Fade.OUT))
.addTransition(new TransitionSet().addTransition(new ChangeBounds()).addTransition(new ChangeClipBounds()).addTransition(new ChangeTransform()))
.addTransition(new Fade(Fade.IN));
transition.setPathMotion(new ArcMotion());
return transition;
}
示例5: FragmentSharedElementTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
public FragmentSharedElementTransition() {
addTransition(new ChangeBounds());
addTransition(new Fade());
addTransition(new ChangeImageTransform());
addTransition(new ChangeTransform());
setInterpolator(new FastOutSlowInInterpolator());
}
示例6: ImageTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
public ImageTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds());
addTransition(new ChangeTransform());
addTransition(new ChangeImageTransform());
setPathMotion(new ArcMotion());
}
示例7: getInstance
import android.transition.ChangeTransform; //导入依赖的package包/类
static public LinkStoryFragment getInstance(Story story, boolean isExpanded) {
LinkStoryFragment f = new LinkStoryFragment();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
f.setSharedElementEnterTransition(new ChangeTransform());
}
f.setSharedElementEnterTransition(new ChangeBounds());
}
Bundle bundle = new Bundle();
bundle.putBoolean("isExpanded", isExpanded);
bundle.putParcelable("story", Parcels.wrap(story));
f.setArguments(bundle);
return f;
}
示例8: getInstance
import android.transition.ChangeTransform; //导入依赖的package包/类
static public FileStoryFragment getInstance(Story story, boolean isExpanded) {
FileStoryFragment f = new FileStoryFragment();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
f.setSharedElementEnterTransition(new ChangeTransform());
}
f.setSharedElementEnterTransition(new ChangeBounds());
}
Bundle bundle = new Bundle();
bundle.putBoolean("isExpanded", isExpanded);
bundle.putParcelable("story", Parcels.wrap(story));
f.setArguments(bundle);
return f;
}
示例9: getInstance
import android.transition.ChangeTransform; //导入依赖的package包/类
static public TopicStoryFragment getInstance(Story story, boolean isExpanded) {
TopicStoryFragment f = new TopicStoryFragment();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
f.setSharedElementEnterTransition(new ChangeTransform());
}
f.setSharedElementEnterTransition(new ChangeBounds());
}
Bundle bundle = new Bundle();
bundle.putBoolean("isExpanded", isExpanded);
bundle.putParcelable("story", Parcels.wrap(story));
f.setArguments(bundle);
return f;
}
示例10: init
import android.transition.ChangeTransform; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
super.addListener(this);
}
示例11: DetailsTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public DetailsTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds())
.addTransition(new ChangeTransform())
.addTransition(new ChangeImageTransform());
}
示例12: init
import android.transition.ChangeTransform; //导入依赖的package包/类
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
}
示例13: init
import android.transition.ChangeTransform; //导入依赖的package包/类
private void init() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds()).
addTransition(new ChangeTransform()).
addTransition(new ChangeImageTransform());
}
示例14: MorphTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
private MorphTransition(int shape) {
setOrdering(ORDERING_TOGETHER);
addTransition(new MusicCoverViewTransition(shape));
addTransition(new ChangeImageTransform());
addTransition(new ChangeTransform());
}
示例15: DetailTransition
import android.transition.ChangeTransform; //导入依赖的package包/类
public DetailTransition() {
setOrdering(ORDERING_TOGETHER);
addTransition(new ChangeBounds())
.addTransition(new ChangeTransform())
. addTransition(new ChangeImageTransform());
}