当前位置: 编程技术>移动开发
activitygroup 切换动画效果如何实现
来源: 互联网 发布时间:2014-10-11
本文导语: **一下提供伪代码,仅说明自己的理解,思路**/ /*************************************************/ /*假设*/ AActivity,BActivity,CActivity,DActivity 都extends ActivityGroup. A1Activity,B1Activity,C1Activity,D1Activity 都extends Activity. A2Activity,B2Activity,C2Activity,D2Activ...
**一下提供伪代码,仅说明自己的理解,思路**/
/*************************************************/
/*假设*/
AActivity,BActivity,CActivity,DActivity 都extends ActivityGroup.
A1Activity,B1Activity,C1Activity,D1Activity 都extends Activity.
A2Activity,B2Activity,C2Activity,D2Activity 都extends Activity
/*一,AActivity继承了Activity,调用startActivity()的时候会在tab内部contentView显示A1Activity*/
AActivity.this.startActivity(A1Activity.class)
BActivity.this.startActivity(B1Activity.class)
CActivity.this.startActivity(C1Activity.class)
DActivity.this.startActivity(D1Activity.class)
/*二,A1Activity没有继承ActivityGroup,所以调用startActivity()的时候和普通的调用没有区别,A2会填满窗口*/
A1Activity.this.startActivity(A2Activity.class)
B1Activity.this.startActivity(B2Activity.class)
C1Activity.this.startActivity(C2Activity.class)
D1Activity.this.startActivity(D2Activity.class)
/*三,A1Activity.this.getParent()获得的是AActivity, 其实就是ActivityGroup; 虽然A1Activity没有继承ActivityGroup,但是A2Activity实际是由A1Activity的父类AActivity启动的,所以A2Activity的启动效果和一差不多*/
A1Activity.this.getParent().startActivity(A2Activity.class)
B1Activity.this.getParent().startActivity(B2Activity.class)
C1Activity.this.getParent().startActivity(C2Activity.class)
D1Activity.this.getParent().startActivity(D2Activity.class)
/*************************************************/
/*假设*/
AActivity,BActivity,CActivity,DActivity 都extends ActivityGroup.
A1Activity,B1Activity,C1Activity,D1Activity 都extends Activity.
A2Activity,B2Activity,C2Activity,D2Activity 都extends Activity
/*一,AActivity继承了Activity,调用startActivity()的时候会在tab内部contentView显示A1Activity*/
AActivity.this.startActivity(A1Activity.class)
BActivity.this.startActivity(B1Activity.class)
CActivity.this.startActivity(C1Activity.class)
DActivity.this.startActivity(D1Activity.class)
/*二,A1Activity没有继承ActivityGroup,所以调用startActivity()的时候和普通的调用没有区别,A2会填满窗口*/
A1Activity.this.startActivity(A2Activity.class)
B1Activity.this.startActivity(B2Activity.class)
C1Activity.this.startActivity(C2Activity.class)
D1Activity.this.startActivity(D2Activity.class)
/*三,A1Activity.this.getParent()获得的是AActivity, 其实就是ActivityGroup; 虽然A1Activity没有继承ActivityGroup,但是A2Activity实际是由A1Activity的父类AActivity启动的,所以A2Activity的启动效果和一差不多*/
A1Activity.this.getParent().startActivity(A2Activity.class)
B1Activity.this.getParent().startActivity(B2Activity.class)
C1Activity.this.getParent().startActivity(C2Activity.class)
D1Activity.this.getParent().startActivity(D2Activity.class)
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。