需要实现一个效果:
A_Activity首先出现,显示B_Activity,A需要保持不动,B从屏幕下方覆盖到A的上层。
B退出时,再次从下方收回,收回的时候A的内容逐渐显示。
给人的感觉就像是B覆盖在A上面一样。
我在实现时,B使用style:
<style name="windowfloat">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
overridePendingTransition动画:
bottom_in.xml
<translate android:fromYDelta="100%p" android:toYDelta="0%p" android:duration="300"/>
bottom_out.xml
<translate android:fromYDelta="0%p" android:toYDelta="100%p" android:duration="300"/>
虽然B在显示时是从下面推上去的,但是在按返回时,没有动画。