【发布时间】:2015-03-07 08:13:27
【问题描述】:
我目前正在尝试在我的 FAB 和另一个 Activity 之间创建一个循环过渡。
根据我在文档中的理解,我应该以与此类似的方式使用 makeSceneTransitionAnimation:
public void onFabClicked(View v){
try {
Intent intent = new Intent(this, SearchActivity.class);
ActivityOptions options = ActivityOptions
.makeSceneTransitionAnimation(this, v, "reveal");
startActivity(intent, options.toBundle());
} catch (Exception e) {
// makeSceneTransitionAnimation not supported, maybe a check of SDK level is enough to avoid catching an error?
Intent intent = new Intent(this, SearchActivity.class);
startActivity(intent);
e.printStackTrace();
}
}
不幸的是,当前动画在动画期间显示了一个矩形。
怎么可能把它变成我们喜欢棒棒糖的美丽圆形展示?
谢谢。
编辑:
我正在努力实现这一点(除了颜色应该是全屏的,但你明白了..)):
我实际得到的:
【问题讨论】:
-
你的意思是晶圆厂是在两个活动之间共享的,它被陶醉的方式是从矩形到圆形?你能举个例子来说明你试图实现的动画(应用程序)吗?
-
FAB 应该变成活动背景。我希望我添加的屏幕截图更好......
-
我写了一个做类似事情的示例应用程序。你可以看看here。
-
另外,您确实需要发布更多代码...我没有看到任何迹象表明您试图在帖子中实现循环显示。
-
还有一些关于高级活动转换的有用博客文章on George Mount's blog。
标签: android android-5.0-lollipop activity-transition circularreveal