查看选项卡内的动画
我有以下问题: 我有一个运行良好的 TabActivity。在内部,有一个 Activity(ListView),用户可以在其中按下 ListItem 以查看详细信息。所以我像这样切换选项卡内的视图:
public void replaceContentView(String id, Intent newIntent){
ActivityGroup ag = null;
try {
ag = (ActivityGroup)getParent();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (ag != null){
newIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
View view = ag.getLocalActivityManager()
.startActivity(id, newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
.getDecorView();
setContentView(view);
} else {
startActivity(newIntent);
}
}
新的 Activity 只是“看起来”不太可能 - 非常丑陋 -。如何制作动画让 currentActivity 淡出,同时新 Activity 淡入?我已经尝试过 这个,但现在 currentActivity只是淡出,而侦听器从未被调用。
I have following problem:
I have a TabActivity which works well. Inside, there is one Activity ( a ListView ) where the user is able to press on an ListItem to see details. So I'm switching the Views inside my Tab like this:
public void replaceContentView(String id, Intent newIntent){
ActivityGroup ag = null;
try {
ag = (ActivityGroup)getParent();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (ag != null){
newIntent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
View view = ag.getLocalActivityManager()
.startActivity(id, newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
.getDecorView();
setContentView(view);
} else {
startActivity(newIntent);
}
}
new Activity just "appears" unlikely - very ugly -. How can I animate that currentActivity is fadingOut, while new Activity fades in? I already tried this, but now currentActivity is just fading-out, while listener is never called.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在已经通过 Android Fragment API 完成了它,我认为它是对于正在使用
LocalActivityManager
和DecorView
的人来说是个好建议I have done it now through Androids Fragment API which I think it is a good advise to anyone who is playing with
LocalActivityManager
andDecorView
yet